_sendPendingOriginalsImmediately() { const keys = Object.keys( this.pendingOriginals ); if ( keys.length ) { debug( `Sending ${ keys.length } originals to GP_Record` ); recordOriginals( keys ); this.pendingOriginals = {}; } }
/** * Returns true if the specified funciton name is valid translate function name * * @param {string} name Function name to test. * * @returns {boolean} Whether function name is valid translate function name. */ function isValidFunctionName( name ) { return Object.keys( DEFAULT_FUNCTIONS_ARGUMENTS_ORDER ).includes( name ); }
compose( connect( ( state ) => ( { filters: getThemeFilters( state ), allValidFilters: Object.keys( getThemeFilterToTermTable( state ) ), } ) ), localize, wrapWithClickOutside, withMobileBreakpoint )( ThemesMagicSearchCard )
Object.keys(header) .map( (key) => encodeURIComponent(key) + '=' + encodeURIComponent(header[key]), ) .join('; ')
validateForm() { const formData = this.formRef.getFormData(); const errors = Object.keys(this.validatedFields).reduce((memo, fieldName) => { const fieldValue = formData[fieldName]; if (!this.validatedFields[fieldName].isValid(fieldValue)) { memo[fieldName] = this.validatedFields[fieldName].error; } return memo; }, {}); return {errors, isValid: !Object.keys(errors).length}; }
// remove target from each group that it may exist in Object.keys(index.groups).forEach(function (groupName) { index.groups[groupName] = index.groups[groupName].filter( doesntMatch(target), ) // delete group if now empty if (!index.groups[groupName].length) { delete index.groups[groupName] } })
handleSettingsFetchSuccess(settings) { this.fetchStatus.floodSettingsFetched = true; Object.keys(settings).forEach(property => { const incomingSettingsValue = settings[property]; if (incomingSettingsValue != null) { this.floodSettings[property] = incomingSettingsValue; } }); this.emit(EventTypes.SETTINGS_FETCH_REQUEST_SUCCESS); this.processSettingsState(); }
static addKeys(value, table) { if (Array.isArray(value)) return; table = table || {}; let i = Object.keys(table).length; for (const p in value) { if (!value.hasOwnProperty(p)) continue; if (table.hasOwnProperty(p)) continue; table[p] = i++; } return table; }
/** * @description Return the number of users in this instance. * @returns {number} Return the number of users. * @example * const nbOfUser = user.getUserCount(); */ function getUserCount() { return Object.keys(this.stateManager.state.user).length; }
/** * @description Return list of sensors. * @returns {Array} Return array of sensor. * @example * xiaomi.getSensors(); */ function getSensors() { return Object.keys(this.sensors).map((sensorId) => this.sensors[sensorId]); }
// copy opts to run Object.keys(options) .filter(key => copyOptions.indexOf(key) > -1) .forEach((key) => { childOpts[key] = options[key]; });
/** * @public * @description Start all services * @returns {Promise} - Resolve when all services are started. * @example * service.startAll(); */ async function startAll() { return Promise.all(Object.keys(this.getServices()).map((serviceKey) => this.start(serviceKey))); }
Object.keys(publicEnv).forEach(key => { if (!process.env[key]) { process.env[key] = publicEnv[key]; } });
function iterateOnTypeKeysToAddNestedSchemas(type, schema, isArray) { Object.keys(type).forEach((key) => { addNestedSchemaToParentSchema(type[key], schema, isArray ? 0 : key); }); }
Object.keys(output).forEach((key) => { const value = output[key]; if (value > maxValue) { maxProp = key; maxValue = value; } });