/** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { var name = elem.nodeName.toLowerCase(); return name === "input" && elem.type === type; }; }
withoutPersistence( ( state = null, action ) => { switch ( action.type ) { case CONCIERGE_INITIAL_REQUEST: return null; case CONCIERGE_INITIAL_UPDATE: return action.initial.nextAppointment; } return state; } )
[ 'single', 'plural', 'options' ].slice( 0, args.length ).forEach( function ( field, i ) { if ( 'StringLiteral' === args[ i ].type ) { finalProps[ field ] = makeDoubleQuoted( args[ i ].extra.raw ); } else if ( 'BinaryExpression' === args[ i ].type ) { finalProps[ field ] = encapsulateString( concatenateBinaryExpression( args[ i ] ) ); } else if ( 'ObjectExpression' === args[ i ].type && 'undefined' === typeof options ) { options = args[ i ]; } else if ( 'TemplateLiteral' === args[ i ].type ) { finalProps[ field ] = makeDoubleQuoted( '`' + args[ i ].quasis[ 0 ].value.raw + '`' ); } } );
const reducer = function ( state = DEFAUlT_STATE, action: PlanAction ) { switch ( action.type ) { case 'SET_PRICES': return { ...state, prices: action.prices, }; default: return state; } }
filterTokens(params, "inline", function forToken(token) { token.children.forEach(function forChild(child) { if (child.type === type) { handler(child, token); } }); });
params.tokens.every(function forToken(token) { if (token.type === "heading_open") { addErrorDetailIf(onError, token.lineNumber, tag, token.tag); return false; } return true; });
assert(message, ...args) { assert( `[${this.constructor.type}:${this.constructor.id}] ${message}`, ...args ); }
params.tokens .filter(function (token) { return token.type === "fence"; }) .forEach(function (fenceToken) { var lineNumber = fenceToken.lineNumber, markup = fenceToken.markup; if (expectedStyle === "consistent") { expectedStyle = fencedCodeBlockStyleFor(markup); } addErrorDetailIf(onError, lineNumber, expectedStyle, fencedCodeBlockStyleFor(markup)); });
// Destination for 'back' button on theme sheet export function backPath( state = '/themes', action ) { switch ( action.type ) { case THEME_BACK_PATH_SET: return action.path !== undefined ? action.path : state; } return state; }
json(obj) { if (!this.hasHeader('Content-Type')) { this.type('application/json'); } return this.send(stringify(obj)); }
// Fix IE bugs, see support tests function fixInput( src, dest ) { var nodeName = dest.nodeName.toLowerCase(); // Fails to persist the checked state of a cloned checkbox or radio button. if ( nodeName === "input" && rcheckableType.test( src.type ) ) { dest.checked = src.checked; // Fails to return the selected option to the default selected state when cloning options } else if ( nodeName === "input" || nodeName === "textarea" ) { dest.defaultValue = src.defaultValue; } }
it('.send() - should not override existing type', function() { base.type('text/plain; charset=utf-9000'); base.send('foo'); expect(base.body).to.equal('foo'); expect(base.getHeader('Content-Type')).to.equal( 'text/plain; charset=utf-9000' ); });
export function themesBookmark( state = '', action ) { if ( THEMES_BOOKMARK_SET === action.type ) { return action.payload; } return state; }