generator-begcode
Version:
Spring Boot + Angular/React/Vue in one handy generator
32 lines (31 loc) • 1.38 kB
JavaScript
import createTokenFromConfig from './token-creator.js';
import { KEYWORD, UNARY_OPTION, BINARY_OPTION } from './shared-tokens.js';
const tokens = [
{ name: 'WITH', pattern: 'with' },
{ name: 'EXCEPT', pattern: 'except' },
{ name: 'USE', pattern: 'use' },
{ name: 'FOR', pattern: 'for' },
{ name: 'CLIENT_ROOT_FOLDER', pattern: 'clientRootFolder', type: 'binary' },
{ name: 'NO_FLUENT_METHOD', pattern: 'noFluentMethod', type: 'unary' },
{ name: 'READ_ONLY', pattern: 'readOnly', type: 'unary' },
{ name: 'EMBEDDED', pattern: 'embedded', type: 'unary' },
{ name: 'DTO', pattern: 'dto', type: 'binary' },
{ name: 'PAGINATE', pattern: 'paginate', type: 'binary' },
{ name: 'SERVICE', pattern: 'service', type: 'binary' },
{ name: 'MICROSERVICE', pattern: 'microservice', type: 'binary' },
{ name: 'SEARCH', pattern: 'search', type: 'binary' },
{ name: 'ANGULAR_SUFFIX', pattern: 'angularSuffix', type: 'binary' },
{ name: 'FILTER', pattern: 'filter', type: 'unary' },
].map(tokenConfig => {
if (tokenConfig.type === 'unary') {
tokenConfig.categories = [UNARY_OPTION, KEYWORD];
}
else if (tokenConfig.type === 'binary') {
tokenConfig.categories = [BINARY_OPTION, KEYWORD];
}
delete tokenConfig.type;
return createTokenFromConfig(tokenConfig);
});
export default {
tokens,
};