/** * Determines whether the specified product slug is for G Suite Basic or Business. * * @param {string} productSlug - slug of the product * @returns {boolean} true if the slug refers to G Suite Basic or Business, false otherwise */ export function isGSuiteProductSlug( productSlug ) { return [ GSUITE_BASIC_SLUG, GSUITE_BUSINESS_SLUG ].includes( productSlug ); }
/** * Given a domain object, does that domain have G Suite with us. * * @param {object} domain - domain object * @returns {boolean} - true if the domain is under our management, false otherwise */ export function hasGSuiteWithUs( domain ) { const defaultValue = ''; const domainStatus = get( domain, 'googleAppsSubscription.status', defaultValue ); return ! includes( [ defaultValue, 'no_subscription', 'other_provider' ], domainStatus ); }
connect( ( state, ownProps ) => { const siteId = parseInt( get( ownProps, [ 'initialContext', 'query', 'siteId' ], 0 ) ); const rewindState = getRewindState( state, siteId ); return { siteId, rewindIsNowActive: includes( [ 'active', 'provisioning' ], rewindState.state ), }; }, { submitSignupStep } )( localize( RewindFormCreds ) )
test('clinic flame --collect-only - bad status code', function (t) { cli({ relayStderr: false }, [ 'clinic', 'flame', '--collect-only', '--', 'node', '-e', 'process.exit(1)' ], function (err, stdout, stderr) { t.strictDeepEqual(err, new Error('process exited with exit code 1')) t.strictEqual(stdout, 'To stop data collection press: Ctrl + C\n') t.ok(stderr.includes('subprocess error, code: 1')) t.end() }) })
suggest(input = this.input, choices = this.state._choices) { if (typeof this.options.suggest === 'function') { return this.options.suggest.call(this, input, choices); } let str = input.toLowerCase(); return choices.filter(ch => ch.message.toLowerCase().includes(str)); }
// NOTICE: Check the foreign key's reference unicity function checkUnicity(primaryKeys, uniqueIndexes, columnName) { const isUnique = uniqueIndexes !== null && uniqueIndexes.find((indexColumnName) => indexColumnName.length === 1 && indexColumnName.includes(columnName)); const isPrimary = _.isEqual([columnName], primaryKeys); return { isPrimary, isUnique }; }
set mode(mode) { const possibleModes = Object.values(MODES); assert( `Invalid mode provided: "${mode}". Possible modes: ${possibleModes.join( ', ' )}.`, possibleModes.includes(mode) ); this.config.mode = mode; }
/** * The filtered collection of roles of the guild emoji * @type {Collection<Snowflake, Role>} * @private * @readonly */ get _roles() { return this.guild.roles.cache.filter(role => this.emoji._roles.includes(role.id)); }
function setIdToSchema(type, schema) { const idUsage = detectSubDocumentsIdUsage(schema, type); if (['ambiguous', false].includes(idUsage)) { schema._id = idUsage; delete type._id; } }
/** * Returns true if a collision exists for the specified WordPress.com site ID. * * @param {object} state Global state tree * @param {number} siteId Site ID * @returns {boolean} Whether collision exists */ export default function isSiteConflicting( state, siteId ) { return includes( getSiteCollisions( state ), siteId ); }
function customizer(objValue, srcValue, key) { // Arrays and `context` options should just replace the existing value // and not be deep merged. if (Array.isArray(objValue) || ['context'].includes(key)) { return srcValue; } }
test('clinic flame --visualize-only - missing data', function (t) { const arg = 'missing.clinic-flame' cli({ relayStderr: false }, [ 'clinic', 'flame', '--visualize-only', arg ], function (err, stdout, stderr) { t.strictDeepEqual(err, new Error('process exited with exit code 1')) t.strictEqual(stdout, '') t.ok(stderr.includes(`Unknown argument "${arg}". Pattern: {pid}.clinic-{command}`)) t.end() }) })
validate(value) { if (value.includes('jon')) { this.error = 'Invalid email address'; return false; } this.error = void 0; return true; }
validate(value, state) { if (value && !value.includes('@sellside.com')) { this.error = 'Invalid email address'; return false; } this.error = void 0; return true; }