function isWpcomDefaults( nameservers ) { if ( nameservers.length === 0 ) { return false; } return every( nameservers, ( nameserver ) => { return /^ns[1-4]\.wordpress\.com$/i.test( nameserver ); } ); }
params.tokens.every(function forToken(token) { if (token.type === "heading_open") { addErrorDetailIf(onError, token.lineNumber, tag, token.tag); return false; } return true; });
// The Body top level keys should start with an alphabet const keysValidator = (req, res, next) => { let validKeys = Array.isArray(req.body) ? req.body.every(helper.isValidKeys) : helper.isValidKeys(req.body); if (validKeys) next(); else throwError("Invalid JSON keys. Keys should start with an alphabet"); }
function checkDescriptors(rawDescriptors) { rawDescriptors.forEach((ds) => { if (!ds.className) { throw new Error('import - expected a class name for every group of descriptors') } if (!ds.faceDescriptors.every(d => d.length === descriptorSize)) { throw new Error(`import - expected every descriptor to have ${descriptorSize} entries`) } }) }
it('should get the history of the chat (user)', function (done) { api.getThreadHistory(userID, 5, null, function(err, data) { checkErr(done)(err); assert(getType(data) === "Array"); assert(data.every(function(v) {return getType(v) == "Object";})); done(); }); });
let validateForm = formValues => { const allFieldsValid = [DEFAULT_FIELDS.NAME, DEFAULT_FIELDS.PATH].every(f => { const field = formValues[f]; return !isEmptyString(field) && !field.includes(' '); }); const pathIsValid = isLowerCase(formValues[DEFAULT_FIELDS.NAME]); const valid = allFieldsValid && pathIsValid; return { ...(!valid && { [FORM_ERROR]: valid }) }; }
const someVariablesLeakOutOfTheLoop = (forStatement, variables, forScope) => { return variables.some(variable => { return !variable.references.every(reference => { return scopeContains(forScope, reference.from) || nodeContains(forStatement, reference.identifier); }); }); }
function validateFilename(words, caseFunctions) { return words .filter(({ignored}) => !ignored) .every(({word}) => caseFunctions.some(fn => fn(word) === word)); }
yup.addMethod(yup.array, 'matchesEnumRegex', function(message) { return this.test('matchesEnumRegex', message, function(array) { return array.every(value => { return ENUM_REGEX.test(value); }); }); });
const isTemplateLiteralEqual = (node1, node2) => { const {quasis: quasis1} = node1; const {quasis: quasis2} = node2; return ( quasis1.length === quasis2.length && quasis1.every((templateElement, index) => isEqual(templateElement, quasis2[index]) ) ); }
const checkCTPermsDeleteHaveFieldsToNull = permissions => !Array.isArray(permissions) || permissions.every( perm => perm.action !== 'plugins::content-manager.explorer.delete' || _.isNil(perm.fields) )
params.tokens.every((token) => { if (token.type === "html_block") { return true; } if ((token.type !== "heading_open") || (token.tag !== tag)) { addErrorContext(onError, token.lineNumber, token.line); } return false; });
applyFiltersWithArgs(req, ...args) { this[HANDLERS] = this[HANDLERS].filter(({ route, handler }) => [...handler.get('filters')].every(fn => fn(requestWithParams(req, route), ...args) ) ); }
it('should get the history of the chat (group)', function (done) { api.getThreadHistory(groupChatID, 5, null, function(err, data) { checkErr(done)(err); assert(getType(data) === "Array"); assert(data.every(function(v) {return getType(v) == "Object";})); done(); }); });