function generateBinArgs( name ) { if ( Object.prototype.hasOwnProperty.call( config.codemodArgs, name ) ) { // Is the codemod defined in the codemodArgs object? return config.codemodArgs[ name ]; } if ( getLocalCodemodFileNames().includes( name ) ) { return [ `--transform=${ transformsDir }/${ name }.js` ]; } throw new Error( `"${ name }" is an unrecognized codemod.` ); }
function getNormalizedKey(key) { const normalizedKey = getNormalizedKeyAttributeValue(key); if (key !== normalizedKey) { this.debugSection('Input', `Mapping key '${key}' to '${normalizedKey}'`); } // Use key definition to ensure correct key is displayed when Shift modifier is active if (Object.prototype.hasOwnProperty.call(keyDefinitionMap, normalizedKey)) { return keyDefinitionMap[normalizedKey]; } return normalizedKey; }
/** * @desc Return WebGlUniformLocation for various variables * related to webGl program, such as user-defined variables, * as well as, dimension sizes, etc. */ getUniformLocation(name) { if (this.programUniformLocationCache.hasOwnProperty(name)) { return this.programUniformLocationCache[name]; } return this.programUniformLocationCache[name] = this.context.getUniformLocation(this.program, name); }
function applyDeviceTokenExists(where) { where = (0, _deepcopy.default)(where); if (!Object.prototype.hasOwnProperty.call(where, 'deviceToken')) { where['deviceToken'] = { $exists: true }; } return where; }
// Private function isArrayLike(x: mixed): boolean { return ( typeof x === 'object' && x !== null && typeof x.length === 'number' && (x.length === 0 || (x.length > 0 && Object.prototype.hasOwnProperty.call(x, x.length - 1))) ); }
function getPrefix(access) { // prettier-ignore let prefix = `${yesNo(access.create)}Create${yesNo(access.read)}Read${yesNo(access.update)}Update${yesNo(access.auth)}Auth`; if (Object.prototype.hasOwnProperty.call(access, 'delete')) { prefix = `${prefix}${yesNo(access.delete)}Delete`; } return prefix; }
const updateLikes = ( { dispatch }, { noteId } ) => { const likeTimers = timers.localLikes; // local override should be a sliding window // so update time if it's still counting down if ( likeTimers.hasOwnProperty( noteId ) ) { clearTimeout( likeTimers[ noteId ] ); } likeTimers[ noteId ] = setTimeout( () => dispatch( actions.notes.resetLocalLike( noteId ) ), LOCAL_ACTION_PERSISTENCE ); }
getInternalVariableName(name) { if (!this._internalVariableNames.hasOwnProperty(name)) { this._internalVariableNames[name] = 0; } this._internalVariableNames[name]++; if (this._internalVariableNames[name] === 1) { return name; } return name + this._internalVariableNames[name]; }
/** * Generally used to lookup the value type returned from a member expressions * @param {String} type * @return {String} */ getLookupType(type) { if (!typeLookupMap.hasOwnProperty(type)) { throw new Error(`unknown typeLookupMap ${ type }`); } return typeLookupMap[type]; }
static getExpirationInterval(body = {}) { const hasExpirationInterval = Object.prototype.hasOwnProperty.call(body, 'expiration_interval'); if (!hasExpirationInterval) { return; } var expirationIntervalParam = body['expiration_interval']; if (typeof expirationIntervalParam !== 'number' || expirationIntervalParam <= 0) { throw new _node.Parse.Error(_node.Parse.Error.PUSH_MISCONFIGURED, `expiration_interval must be a number greater than 0`); } return expirationIntervalParam; }
Object.keys(options).forEach(key => { if (!Object.prototype.hasOwnProperty.call(this, key)) { this[key] = options[key]; } });
function getMediaQueryList( breakpoint ) { if ( ! mediaQueryLists.hasOwnProperty( breakpoint ) ) { try { // eslint-disable-next-line no-console console.warn( 'Undefined breakpoint used in `mobile-first-breakpoint`', breakpoint ); } catch ( e ) {} return undefined; } return mediaQueryLists[ breakpoint ]; }
export function dump(obj) { let out = ''; for (const key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { out += `${key}: ${obj[key]}\n`; } } return out; }
// If obj.hasOwnProperty has been overridden, then calling // obj.hasOwnProperty(prop) will break. // See: https://github.com/joyent/node/issues/1707 function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
function convertKeyToRawKey(key) { if (Object.prototype.hasOwnProperty.call(keyUnicodeMap, key)) { return keyUnicodeMap[key]; } // Key is raw key when no representative unicode code point for value return key; }