function updateDomainState( state, domainName, data ) { const command = { [ domainName ]: { $set: Object.assign( {}, state[ domainName ] || initialDomainState, data ), }, }; return update( state, command ); }
/** * Activate the plugin * This method is a shorthand of update() * * @param {object} [query] - query object parameter * @param {Function} [fn] - callback function * @returns {Promise} Promise */ activate( query, fn ) { return this.update( query, { active: true }, fn ); }
$('.w-req-data-list .ReactVirtualized__Grid:first').scroll(function() { var modal = self.state.network; scrollTimeout && clearTimeout(scrollTimeout); scrollTimeout = null; if (modal && atBottom()) { scrollTimeout = setTimeout(function() { update(modal, true); }, 1000); } })
(async () => { const withYarn = await hasYarn() const margin = chalk.bgGreen(' ') const command = withYarn ? `yarn global add ${pkg.name}` : `npm i -g ${pkg.name}` console.log() console.log(`${margin} Update available: ${chalk.bold(notifier.update.latest)}`) console.log(`${margin} Run ${chalk.cyan(command)} to update`) console.log() })()
function getAppSecretPath(authData, options = {}) { const appSecret = options.appSecret; if (!appSecret) { return ''; } const appsecret_proof = crypto.createHmac('sha256', appSecret).update(authData.access_token).digest('hex'); return `&appsecret_proof=${appsecret_proof}`; }
function verifySignature(publicKey, authData) { const verifier = crypto.createVerify('sha256'); verifier.update(authData.playerId, 'utf8'); verifier.update(authData.bundleId, 'utf8'); verifier.update(convertTimestampToBigEndian(authData.timestamp)); verifier.update(authData.salt, 'base64'); if (!verifier.verify(publicKey, authData.signature, 'base64')) { throw new Parse.Error(Parse.Error.OBJECT_NOT_FOUND, 'Apple Game Center - invalid signature'); } }
async updateEventUpdate (eventUpdate, eventType) { eventUpdate.validate() await this.eventUpdatesStore.update(eventUpdate) await new SNS().notifyEvent(eventUpdate.getEventID(), eventType) }
deleteFeature(featureIndex) { const device = update(this.state.device, { features: { $splice: [[featureIndex, 1]] } }); this.setState({ device }); }
/** * Regenerates the given user's email verification token * * @param user * @returns {*} */ regenerateEmailVerifyToken(user) { this.setEmailVerifyToken(user); return this.config.database.update('_User', { username: user.username }, user); }
function shasum(str) { var shasum = crypto.createHash('sha1'); shasum.update(str || ''); return shasum.digest('hex'); }
updateHouseName(state, name, houseIndex) { const newState = update(state, { houses: { [houseIndex]: { name: { $set: name } } } }); store.setState(newState); }
this.setState(prevState => { const newState = update(prevState, { scene: { triggers: { $splice: [[index, 1]] } } }); return newState; });
const wrapUpdateFunc = (keystoneSchemaInfo, invalidateTypes, update) => (proxy, data) => { if (invalidateTypes) { updater(keystoneSchemaInfo, invalidateTypes)(proxy, data); } return update(proxy, data); }
let updateStackConsumers = slideInFrom => { allStackConsumers[slideInFrom].forEach(update => { update(); }); }
function updateDomainState( state, domainName, dns ) { const command = { [ domainName ]: { $set: Object.assign( {}, state[ domainName ] || initialState, dns ), }, }; return update( state, command ); }