_.clickNodes.forEach(function (item, index) { if (type === 'row') { var x = _.baseX + (item.x - _.baseX) / (imgNum - 1) * i var y = item.y _.imgAnimateDataObj[i].push({ x: x, y: y }) } else if(type === 'col') { var x = item.x var y = _.baseY + (item.y - _.baseY) / (imgNum - 1) * i _.imgAnimateDataObj[i].push({ x: x, y: y }) } })
function eventLoopHinder() { var id = Math.random().toString().split('.')[1] var newHinder = new Hinder(id) newHinder.draw() hinderArray.push(newHinder) setTimeout(eventLoopHinder, 1000) }
jest.fn( ( query, listener ) => { if ( listeners[ query ] ) { listeners[ query ].push( listener ); } else { listeners[ query ] = [ listener ]; } } )
/** * Make `getFlow()` call to exclude the given steps. * The main usage at the moment is to serve as a quick solution to remove steps that have been pre-fulfilled * without explicit user inputs, e.g. query arguments. * * @param {string} step Name of the step to be excluded. */ excludeStep( step ) { step && Flows.excludedSteps.indexOf( step ) === -1 && Flows.excludedSteps.push( step ); }
stream.on( 'data', function ( chunk ) { debug( 'wrapped data' ); if ( state.decoder ) chunk = state.decoder.write( chunk ); if ( ! chunk || ( ! state.objectMode && ! chunk.length ) ) return; var ret = self.push( chunk ); if ( ! ret ) { paused = true; stream.pause(); } } );
/** * * @param m * @returns {Matrix} */ observe(m) { this.states.push({ forwardFn() {}, backpropagationFn() {}, }); return m; }
filterTokens(params, "paragraph_open", (token) => { for (let i = token.map[0]; i < token.map[1] - 1; i++) { paragraphLineNumbers.push(i + 1); } });
readdirSync( dir ) .filter( ignored ) .forEach( function ( path ) { path = join( dir, path ); if ( statSync( path ).isDirectory() ) { exports.files( path, ext, ret ); } else if ( path.match( re ) ) { ret.push( path ); } } );
// Outputs the no newline at end of file warning if needed function eofNL( curRange, i, current ) { var last = diff[ diff.length - 2 ], isLast = i === diff.length - 2, isLastOfType = i === diff.length - 3 && current.added !== last.added; // Figure out if this is the last line for the given file and missing NL if ( ! /\n$/.test( current.value ) && ( isLast || isLastOfType ) ) { curRange.push( '\\ No newline at end of file' ); } }
getURLsFromForm() { const formData = this.formRef.getFormData(); return Object.keys(formData).reduce((accumulator, formItemKey) => { if (/^urls/.test(formItemKey)) { accumulator.push(formData[formItemKey]); } return accumulator; }, []); }
filterTokens(params, "inline", function (token) { var childTokenTypes = ""; token.children.forEach(function (child) { if (child.type !== "text" || child.content !== "") { childTokenTypes += tokenTypeMap[child.type] || "x"; } }); if (linkOrImageOnlyLineRe.test(childTokenTypes)) { linkOnlyLineNumbers.push(token.lineNumber); } });
stateUtilsImports.find( j.ImportSpecifier ).forEach( ( item ) => { importNames.push( { local: item.value.local.name, imported: item.value.imported.name, } ); } );
function log() { console.log('%d messages per sent second', count); store.push(count); count = 0; }
// Output our changes curRange.push.apply( curRange, map( lines, function ( entry ) { return ( current.added ? '+' : '-' ) + entry; } ) );