This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
npx --yes create-nx-workspace@latest $1 --preset=next --appName=$2 --nextAppDir=true --nextSrcDir=false --nxCloud=skip --style=css --unitTestRunner=jest --linter=eslint --e2eTestRunner=cypress --formatter=prettier --interactive=false | |
cd $1 | |
npm i next@latest | |
npm i -D eslint-config-next@latest prisma | |
npm i yargs | |
npm i @prisma/client |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getVariationSchema = (node, index) => { | |
const nodeVariationPrice = get(node, `variations.${index}.price`); | |
const variationPriceSchema = { | |
price: Joi.number().required().min(0), | |
priceConfirmation: Joi.any().when('price', { | |
// not: Joi.number().valid(Joi.ref('$node.variations..price')), | |
not: Joi.number().valid(nodeVariationPrice), | |
then: Joi.number().valid(Joi.ref('price')), | |
}), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const formDta = { | |
variations: [ | |
{ | |
id: 'foo_v1', | |
price: '100', | |
priceConfirmation: '', | |
}, | |
{ | |
id: 'foo_v2', | |
price: '110', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const product = { | |
id: 'foo', | |
title: 'bar', | |
variations: [ | |
{ | |
id: 'foo_v1', | |
price: 100, | |
}, | |
{ | |
id: 'foo_v2', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"merchantOrderNo": "20190820jtOCjpd2oHI0ZaaBSKCS", | |
"createdAt": "1566230510", | |
"testKey": ";,/?:@&=+$#-_.!~*'()" | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object { | |
"appid": "F3E812C9-60EE-4617-B0F5-89D8DFADB2BB", | |
"birth": "1980-01-01", | |
"id": "A131841032", | |
"mobile": "0911781506", | |
"token": "uUoloruhJMEWdZo8VKepwcdNDqOkcuC8Nn-KvtehWZyeMB2IwSRruRSSamNAmmfno3vcg6RZjHwC_RqeHeqaZA", | |
"verifymobile": "0905030081", | |
} |