/* * Warn user of unsupported services * This event exists to */ app.events.on('post-start', 9, () => { const allServices = _.map(app.lagoon.services, 'name'); const supportedServices = _.map(getLandoServices(app.lagoon.services), 'name'); const unsupportedServices = _.difference(allServices, supportedServices); if (!_.isEmpty(unsupportedServices)) { app.addWarning(warnings.unsupportedServices(unsupportedServices.join(', '))); } });
_(applications) // Get the basics .map(app => _.merge({}, app, { application: true, appMountDir: getAppMount(app, appRoot, applicationFiles), closeness: _.indexOf(traverseUp(), getAppMount(app, appRoot, applicationFiles)), // @TODO: can we assume the 0? is this an index value? // @NOTE: probably not relevant until we officially support multiapp? hostname: `${app.name}.0`, sourceDir: _.has(app, 'source.root') ? path.join('/app', app.source.root) : '/app', webroot: utils.getDocRoot(app), })) // And the webPrefix .map(app => _.merge({}, app, { webPrefix: _.difference(app.appMountDir.split(path.sep), appRoot.split(path.sep)).join(path.sep), })) // Return .value()
const allServices = _.map(app.platformsh.services, 'name'); const supportedServices = _.map(getLandoServices(app.platformsh.services), 'name'); const unsupportedServices = _.difference(allServices, supportedServices); if (!_.isEmpty(unsupportedServices)) { app.addWarning(warnings.unsupportedServices(unsupportedServices.join(', ')));
handleTogglePermission(data){ let self = this; let index = _.findIndex(self.state.permissionMap, function (role) { return role.role_id == data.role; }); let currentPermissions = self.state.permissionMap[index].permission_ids; if(!data.yes){ //removing permission from state let removePermissions = _.remove(currentPermissions, function (pid) { return (pid == data.permission); }); let newPermissions = _.difference(currentPermissions, removePermissions); let newPermissionMap = self.state.permissionMap; newPermissionMap[index].permission_ids = newPermissions; self.setState({changed: true, permissionMap: newPermissionMap}); }else{ //adding permission to state let newPermissions = _.concat(currentPermissions, data.permission); let newPermissionMap = self.state.permissionMap; newPermissionMap[index].permission_ids = newPermissions; self.setState({changed: true, permissionMap: newPermissionMap}); } }
}, pullMedia: ['updatePage', function (callback, results) { var pullMedia = _.difference(_.map(_.get(results, 'updatePage.mixed.pageMedia'), function (medium) { return medium.toString() }), newMedia); }], addMedia: ['updatePage', function (callback, results) { var addMedia = _.difference(newMedia, _.map(_.get(results, 'updatePage.mixed.pageMedia'), function (medium) { return medium.toString() }));
var pullMedia = _.difference(_.map(oldMedia, function (medium) { return medium.toString() }), newMedia); var newThumbnail = data.thumbnail; var addMedia = _.difference(newMedia, _.map(oldMedia, function (medium) { return medium.toString() }));
var pullMedia = _.difference(_.map(oldMedia, function (medium) { return medium.toString() }), newMedia); var newThumbnail = data.thumbnail; var addMedia = _.difference(newMedia, _.map(oldMedia, function (medium) { return medium.toString() }));
allFilesGit (cwd) { _.difference( exec.commandSync('git ls-files', { cwd }).stdout.trim().split('\n'), exec.commandSync('git ls-files --deleted', { cwd }).stdout.trim().split('\n') ).forEach(f => this.addFile(f)) }
it('can call constant functions', async function() { const c = new FlexContract(ABI, {provider: provider, bytecode: BYTECODE}); await c.new(123).send(); assert.equal(await c.constFn().call(), 1); assert.equal(await c.constFn(2).call(), 4); assert.equal(await c.constFn(1, 2).call(), 9); const addr = randomAddress(); assert.equal(await c.echoAddress(addr).call(), addr); const array = _.times(3, () => randomHex(32)); assert.equal(_.difference(array, await c.echoArray(array).call()).length, 0); assert.equal(_.difference(array, await c.echoFixedArray(array).call()).length, 0); });
const validatePlugins = function (pluginList) { return co(function* () { const existingPlugins = yield getAllPlugins(); const notExist = _.difference(pluginList, existingPlugins); if (notExist && notExist.length) { _.forEach(notExist, (x) => archLog.error(`arch plugin ${x} not found!`)); } return _.intersection(pluginList, existingPlugins); }); }
const addReferencesToImages = (prevDoc, nextDoc, fields) => { const diff = _.reduce(fields, (memo, field) => { const oldValue = _.get(prevDoc, field); const newValue = _.get(nextDoc, field); if (newValue !== undefined) { if (_.isArray(newValue)) { _.set(memo, field, _.difference(newValue, oldValue)); } else if (oldValue !== newValue && _.isString(newValue) && newValue.length > 0) { _.set(memo, field, newValue); } } return memo; }, {}); return storageCtrl.addImagesReferences(diff, Object.keys(diff)); }
_.each(components, function (component) { if (componentBuilderMethods[component]) { var bm_diff = _.difference(Object.keys(componentBuilderMethods[component]), builderMethods); builderMethods = builderMethods.concat(bm_diff); } if (componentMethods[component]) { var cm_diff = _.difference(Object.keys(componentMethods[component]), compilerMethods); compilerMethods = compilerMethods.concat(cm_diff); } });
var aggr_makeShort = function(name){ var parts = _.difference(name.replace(/\s+/g," ").replace(/['"«]/g,"").split(/[\s]/),["ООО","ПАО","АО","Ф-л","ДПО","ЗАО","ОАО","(юр. лицо)","ЧУ"]); return _.map(parts,function(p){ return (_.first(p)+'').toUpperCase(); }).join("") }
function validateSchemaProperties (api, response, schema, path) { _.forEach(_.difference(schema.required || [], getSchemaProperties(schema)), function (name) { response.errors.push({ code: 'OBJECT_MISSING_REQUIRED_PROPERTY_DEFINITION', message: 'Missing required property definition: ' + name, path: path }); }); }
// Identify unused references (missing references are already handled above) _.forEach(_.difference(referenceable, Object.keys(references)), function (ptr) { response.warnings.push({ code: 'UNUSED_DEFINITION', message: 'Definition is not used: ' + ptr, path: JsonRefs.pathFromPtr(ptr) }); });