process(src, filename) { const assetFilename = JSON.stringify(path.basename(filename)); if (filename.match(/\.svg$/)) { // Based on how SVGR generates a component name: // https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6 const pascalCaseFileName = camelcase(path.parse(filename).name, { pascalCase: true, }); const componentName = `Svg${pascalCaseFileName}`; return `const React = require('react'); module.exports = { __esModule: true, default: ${assetFilename}, ReactComponent: React.forwardRef(function ${componentName}(props, ref) { return { $$typeof: Symbol.for('react.element'), type: 'svg', ref: ref, key: null, props: Object.assign({}, props, { children: ${assetFilename} }) }; }), };`; } return `module.exports = ${assetFilename};`; }
_getApiClient (tag) { const apiType = camelCase(tag, { pascalCase: true }) + 'Api' if (!(apiType in this.apiClients)) { this.apiClients[apiType] = this.kubeconfig.makeApiClient(this.client[apiType]) } return this.apiClients[apiType] }
const method = operationObject.operationId.replace(camelCase(tag, { pascalCase: true }), '')
columns.reduce((acc, column) => { acc[formatFieldName(column.name)] = { type: transformColumnToType(column.type), primaryKey: column.pk === 1, field: column.name, allowNull: column.notnull === 0 || column.dflt_value !== null, defaultValue: column.dflt_value, autoIncrement: column.type === 'INTEGER' && column.pk === 1, }; return acc; }, {})
Object.keys(returnObject).forEach(key => { (localPath && !aliasKeys.includes(name)) && (() => { returnObject[camelCase(arrayDsl(key.split('/')).last())] = returnObject[name] delete returnObject[name] })() })
watch('./read', () => { const indexFd = openSync('./index.js', 'w'); const files = readdirSync('./read'); files.map(f => { const name = f.replace("js", ""); console.log(`Adding a file: ${f}`); writeSync(indexFd, `module.exports.${camelCase(name)} = require('./read/${name}').read;\n`); }); closeSync(indexFd); });
const pascalCase = string => { const cameled = camelcase(string); return cameled.substr(0, 1).toUpperCase() + cameled.substr(1); }
static get references() { return this.sqlColumnsData .filter(x => x.references) .reduce( (accum, item) => Object.assign({}, accum, { [item.property || camelCase(item.column || item)]: item.references }), {} ); }
const getPolyKeys = (model, otherModel) => { const key = getPkFieldKey(model); const otherKey = getPkFieldKey(otherModel); if (otherKey === key) { return [ key, otherKey, camelcase(`${singular(otherModel.name)}_${otherKey}`), ]; } return [key, otherKey, otherKey]; }
static get columns() { return this.sqlColumnsData.map( x => x.property || camelCase(x.column || x) ); }
static get displayName() { return camelCase(this.tableName); }
process(src, filename) { const assetFilename = JSON.stringify(path.basename(filename)); if (filename.match(/\.svg$/)) { // Based on how SVGR generates a component name: // https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6 const pascalCaseFilename = camelcase(path.parse(filename).name, { pascalCase: true, }); const componentName = `Svg${pascalCaseFilename}`; return `const React = require('react'); module.exports = { __esModule: true, default: ${assetFilename}, ReactComponent: React.forwardRef(function ${componentName}(props, ref) { return { $$typeof: Symbol.for('react.element'), type: 'svg', ref: ref, key: null, props: Object.assign({}, props, { children: ${assetFilename} }) }; }), };`; } return `module.exports = ${assetFilename};`; }
process(src, filename) { const assetFilename = JSON.stringify(path.basename(filename)); if (filename.match(/\.svg$/)) { // Based on how SVGR generates a component name: // https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6 const pascalCaseFileName = camelcase(path.parse(filename).name, { pascalCase: true, }); const componentName = `Svg${pascalCaseFileName}`; return `const React = require('react'); module.exports = { __esModule: true, default: ${assetFilename}, ReactComponent: React.forwardRef(function ${componentName}(props, ref) { return { $$typeof: Symbol.for('react.element'), type: 'svg', ref: ref, key: null, props: Object.assign({}, props, { children: ${assetFilename} }) }; }), };`; } return `module.exports = ${assetFilename};`; }
process(src, filename) { const assetFilename = JSON.stringify(path.basename(filename)); if (filename.match(/\.svg$/)) { // Based on how SVGR generates a component name: // https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6 const pascalCaseFilename = camelcase(path.parse(filename).name, { pascalCase: true, }); const componentName = `Svg${pascalCaseFilename}`; return `const React = require('react'); module.exports = { __esModule: true, default: ${assetFilename}, ReactComponent: React.forwardRef(function ${componentName}(props, ref) { return { $$typeof: Symbol.for('react.element'), type: 'svg', ref: ref, key: null, props: Object.assign({}, props, { children: ${assetFilename} }) }; }), };`; } return `module.exports = ${assetFilename};`; }
Object.keys(returnObject).forEach(key => { (localPath && !aliasKeys.includes(name)) && (() => { returnObject[camelCase(arrayDsl(key.split('/')).last())] = returnObject[name] delete returnObject[name] })() })