this.setState({ keyName: event.target.value }, () => { delay(() => { this.setState({ keyName: camelCase(event.target.value.trim()) }); }, 300); });
function createInstance(type, props) { let elementName = type !== `div` ? `Term${upperFirst(camelCase(type))}` : `TermElement`; let ElementClass = TermElements[elementName]; if (!ElementClass) throw new Error(`Invalid element type "${type}" (${elementName} is not amongst ${Object.keys(TermElements).join(`, `)})`); let instance = new ElementClass(props); Reflect.set(instance, EVENT_SYMBOL, new Map()); Reflect.set(instance, SHORTCUT_SYMBOL, new Map()); return instance; }
Object.keys(this.admin.models || []).reduce((acc, key) => { if (!this.admin.models[key].identity) { this.admin.models[key].identity = upperFirst(key); } if (!this.admin.models[key].globalId) { this.admin.models[key].globalId = upperFirst(camelCase(`admin-${key}`)); } if (!this.admin.models[key].connection) { this.admin.models[key].connection = this.config.currentEnvironment.database.defaultConnection; } acc[key] = this.admin.models[key]; return acc; }, {})
constructor(file, content, page, options) { super(file, options); this.index = parseInt(path.basename(this.file).replace(/^(\d+-)?(.*)$/i, '$1'), 10) || 0; this.visible = this.index > 0; this.invisible = !this.visible; this.identifier = path.relative(options.paths.content, this.file).split('/').map(partial => partial.replace(/^(\d+-)?(.*)$/i, '$2')).join('/'); this.url = `${options.base}/${this.identifier}`; this.output = path.resolve(options.paths.output, this.identifier); if (content) { fs.readFileSync(content, 'utf8').split(options.separators.line).forEach((line) => { const partials = line.split(options.separators.values); const key = camelCase(partials.shift().trim()); const value = partials.join(options.separators.values).trim(); this[key] = value; }); } }
Object.keys(this.api || []).reduce((acc, key) => { for (let index in this.api[key].models) { if (!this.api[key].models[index].globalId) { this.api[key].models[index].globalId = upperFirst(camelCase(index)); } if (!this.api[key].models[index].connection) { this.api[key].models[index].connection = this.config.currentEnvironment.database.defaultConnection; } if (!this.api[key].models[index].collectionName) { this.api[key].models[index].collectionName = (`${index}`).toLowerCase(); } acc[index] = this.api[key].models[index]; } return acc; }, {})
transactions.map(x => camelCase(`send_${x}`))
setupGlobals(options) { this.visible = this.index > 0; this.invisible = !this.visible; this.url = `${options.base}/${this.identifier.length ? options.permalink(this.identifier) : ''}`; this.output = path.resolve(options.paths.output, this.identifier, `index.${options.extensions.output}`); this.children = []; this.hasChildren = false; this.files = []; this.hasFiles = false; Object.keys(files).forEach((property) => { this[property] = []; this[camelCase(`has-${property}`)] = false; }); if (this.parent) { this.genesis = this.parent; while (this.genesis && this.genesis.parent) { this.genesis = this.genesis.parent; } } else { this.genesis = this; } }
export default function createRoutes(store) { // Create reusable async injectors using getAsyncInjectors factory const { injectReducer, injectSagas } = getAsyncInjectors(store); // eslint-disable-line no-unused-vars // Inject app sagas const appSagas = tryRequire('App/sagas'); if (appSagas) injectSagas(appSagas.default); return map(routes, (route, key) => ({ path: key === '/' ? '' : key, name: route.name, getComponent(nextState, cb) { const reducer = tryRequire(`${route.container}/reducer`); // eslint-disable-line global-require const sagas = tryRequire(`${route.container}/sagas`); // eslint-disable-line global-require const component = tryRequire(`${route.container}/index`); // eslint-disable-line global-require process.nextTick(() => { if (reducer) injectReducer(camelCase(route.container), reducer.default); if (sagas) injectSagas(sagas.default); cb(null, component.default); }); }, })); }
generateFiles(options) { Object.keys(files).forEach((property) => { const Type = files[property]; glob.sync(`*.+(${options.extensions[property].join('|')})`, { cwd: path.dirname(this.file), absolute: true, }).sort(naturalSort).forEach((file) => { const matches = glob.sync(`${file}.+(${options.extensions.content.join('|')})`, { cwd: path.dirname(this.file), absolute: true, }).sort(naturalSort); const instance = new Type(file, matches[0], this, options); this[property].push(instance); this.files.push(instance); this[camelCase(`has-${property}`)] = true; this.hasFiles = true; }); }); return this; }
constructor(file, options, parent) { super(file, options, parent); fs.readFileSync(this.file, 'utf8').split(options.separators.line).forEach((line) => { const partials = line.split(options.separators.values); const key = camelCase(partials.shift().trim()); const value = partials.join(options.separators.values).trim(); this[key] = value; }); this.index = parseInt(path.basename(path.dirname(this.file)).replace(/^(\d+-)?(.*)$/i, '$1'), 10) || 0; this.identifier = path.relative(options.paths.content, path.dirname(this.file)).split('/').map(partial => partial.replace(/^(\d+-)?(.*)$/i, '$2')).join('/'); this.template = path.basename(this.file, path.extname(this.file)); this.setupGlobals(options); this.setupHelpers(options); this.generateChildren(options); this.generateFiles(options); this.addVirtualPage = (props) => { const page = new VirtualPage(props, options, this); this.children.push(page); this.children.sort((a, b) => a.index - b.index); return page; }; }
const configKey = camelCase(plugin.configKey || plugin.name || (plugin.pkg && plugin.pkg.name) || '')
this.plugins[key].models[index].globalId = upperFirst(camelCase(`${key}-${index}`));
transactions.map(x => camelCase(`encode_${x}`))
transactions.map(x => camelCase(`sign_${x}`))
multiSignTxs.map(x => camelCase(`multi_sign_${x}`))