text.map(function(key) { return getKey(util.removeProtocol(key.trim())); }).filter(function(key) { return !!key; })
get filename() { const _ = Error.prepareStackTrace; Error.prepareStackTrace = (error, stack) => stack; const {stack} = new Error(); Error.prepareStackTrace = _; const callers = stack.map(x => x.getFileName()); const firstExternalFilePath = callers.find(x => { return x !== callers[0]; }); return firstExternalFilePath ? path.basename(firstExternalFilePath) : 'anonymous'; }
verb.map(method => method.toLocaleLowerCase())
/** * Load services from a folder * * @param {string} [folder="./services"] Folder of services * @param {string} [fileMask="**\/*.service.js"] Service filename mask * @returns {Number} Number of found services * * @memberof ServiceBroker */ loadServices(folder = "./services", fileMask = "**/*.service.js") { this.logger.debug(`Search services in '${folder}/${fileMask}'...`); let serviceFiles; if (Array.isArray(fileMask)) serviceFiles = fileMask.map(f => path.join(folder, f)); else serviceFiles = glob.sync(path.join(folder, fileMask)); if (serviceFiles) serviceFiles.forEach(filename => this.loadService(filename)); return serviceFiles.length; }
if (ctx.children[0].getText() === originalAlias) { const withoutFirst = R.drop(1, ctx.children); result += [tableAlias].concat(withoutFirst.map(c => c.getText())).join(''); cursor = ctx.stop.stop + 1; } else if (ctx.children.length === 1) { result += [tableAlias, '.'].concat(ctx.children.map(c => c.getText())).join(''); cursor = ctx.stop.stop + 1; } else {
/** * import collections from json * * @param {string} collections MongoDB collection name * @param {array} importSettingsMap key: collection name, value: ImportSettings instance */ async import(collections, importSettingsMap) { // init status object this.currentProgressingStatus = new CollectionProgressingStatus(collections); // process serially so as not to waste memory const promises = collections.map((collectionName) => { const importSettings = importSettingsMap[collectionName]; return this.importCollection(collectionName, importSettings); }); for await (const promise of promises) { try { await promise; } // catch ImportingCollectionError catch (err) { const { collectionProgress } = err; logger.error(`failed to import to ${collectionProgress.collectionName}`, err); this.emitProgressEvent(collectionProgress, { message: err.message }); } } this.currentProgressingStatus = null; this.emitTerminateEvent(); }
((Array.isArray(value) && value.map(String).includes(compare)) || (value === compare));
db.collection('consortia').findOneAndUpdate({ _id: ObjectID(args.consortiumId) }, { $set: { mappedForRun: args.mappedForRun.map(id => ObjectID(id)) } }, { returnOriginal: false })
doviz(val) { this.setState({doviz: val}) this.state.options.map(function(item,index){ if (val.code == item.code) { this.setState({selectItem:item.selling}) } }.bind(this)) }
/** * @desc file or tree * @param {String} list * @param {String} file * @returns String */ function findDir(list, file) { let type = ''; list.map(item => { if(item.path === file) { type = item.type; } }) return type; }
export async function getStaticPaths() { const psgIDs = await describePsgIDs(); const paths = psgIDs.map((psgID) => ({ params: { psgID, }, })); return { paths, fallback: false, }; }
verb.map(method => method.toLocaleLowerCase())
db.collection('consortia').findOneAndUpdate({ _id: ObjectID(args.consortiumId) }, { $set: { mappedForRun: args.mappedForRun.map(id => ObjectID(id)) } }, { returnOriginal: false })
export async function getStaticPaths() { const psgIDs = await describePsgIDs(); const paths = psgIDs.map((psgID) => ({ params: { psgID, }, })); return { paths, fallback: false, }; }
get filename() { const _ = Error.prepareStackTrace; Error.prepareStackTrace = (error, stack) => stack; const {stack} = new Error(); Error.prepareStackTrace = _; const callers = stack.map(x => x.getFileName()); const firstExternalFilePath = callers.find(x => { return x !== callers[0]; }); return firstExternalFilePath ? path$1__default.basename(firstExternalFilePath) : 'anonymous'; }