( function add( args ) { jQuery.each( args, function( _, arg ) { if ( isFunction( arg ) ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } } else if ( arg && arg.length && toType( arg ) !== "string" ) { // Inspect recursively add( arg ); } } ); } )( arguments );
export function isExpiringSoon( domain, expiresWithinDays ) { return ( ! domain.expired && moment.utc( domain.expiry ).isBefore( moment.utc().add( expiresWithinDays, 'days' ) ) ); }
colorsMap.map(color => { colorStories.add(color.name, () => ( <span style={{ color: color.code }}>{color.name} - {color.code}</span> )) })
// Buttons storiesOf('Card', module) .add('default', () => ( <Card style={{ margin: '1em' }}> <H3 font="secondary">Hello</H3> <p>Lunas persuadere! Urias sunt castors de alter nomen. Sunt nixes perdere alter, festus capioes.</p> </Card> ))
const errHandler = (err) => { recorder.session.start('teardown'); recorder.cleanAsyncErr(); event.emit(event.test.failed, suite, err); if (hookName === 'after') event.emit(event.test.after, suite); if (hookName === 'afterSuite') event.emit(event.suite.after, suite); recorder.add(() => done(err)); }
componentWillMount() { const from = moment() .startOf('week') .subtract(7, 'day') .toDate(); const to = moment() .endOf('week') .add(7, 'day') .toDate(); this.props.getEventsInRange(from, to); }
function () { var v1 = new THREE.Vector2(); return function ( center, size ) { var halfSize = v1.copy( size ).multiplyScalar( 0.5 ); this.min.copy( center ).sub( halfSize ); this.max.copy( center ).add( halfSize ); return this; }; }()
// Approximate a curved face with recursively sub-divided triangles. function make( v1, v2, v3 ) { var face = new THREE.Face3( v1.index, v2.index, v3.index, [ v1.clone(), v2.clone(), v3.clone() ] ); face.centroid.add( v1 ).add( v2 ).add( v3 ).divideScalar( 3 ); that.faces.push( face ); var azi = azimuth( face.centroid ); that.faceVertexUvs[ 0 ].push( [ correctUV( v1.uv, v1, azi ), correctUV( v2.uv, v2, azi ), correctUV( v3.uv, v3, azi ) ] ); }
describe('add', () => { it('calls forwardFn', () => { const equation = new Equation(); const input = fourSquareMatrix(1); equation.add(input, fourSquareMatrix(1)); expect(equation.states.length).toBe(1); jest.spyOn(equation.states[0], 'forwardFn'); equation.runIndex(); expect(equation.states[0].forwardFn).toBeCalled(); }); });
router.post('/books/add', async (req, res) => { try { const book = await Book.add({ userId: req.user.id, ...req.body }); res.json(book); } catch (err) { logger.error(err); res.json({ error: err.message || err.toString() }); } });
/** * The cache of this Manager * @type {Collection<Snowflake, GuildMember>} * @name GuildMemberManager#cache */ add(data, cache = true) { return super.add(data, cache, { id: data.user.id, extras: [this.guild] }); }
/** * The cache of Messages * @type {Collection<Snowflake, Message>} * @name MessageManager#cache */ add(data, cache) { return super.add(data, cache, { extras: [this.channel] }); }
fontsMap.map(font => { fontsStories.add(font.name, () => ( <span style={{ fontFamily: font.family }}>{font.name} - {font.family}</span> )) })
describe('multiplyElement', () => { it('calls forwardFn', () => { const equation = new Equation(); const input = fourSquareMatrix(1); equation.add(input, fourSquareMatrix(1)); expect(equation.states.length).toBe(1); jest.spyOn(equation.states[0], 'forwardFn'); equation.runIndex(); expect(equation.states[0].forwardFn).toBeCalled(); }); });
componentWillMount() { const from = moment() .startOf('week') .subtract(7, 'day') .toDate(); const to = moment() .endOf('week') .add(7, 'day') .toDate(); this.props.getEventsInRange(from, to); }