Skip to content

Latest commit

 

History

History
133 lines (128 loc) · 8.35 KB

MATCHERS_AND_FILTERS.md

File metadata and controls

133 lines (128 loc) · 8.35 KB

Complete List of Lodash Match Pattern Matching Functions and Added Filters

  1. Matchers from lodash and checkit modules
  2. Additional lodash-match-pattern matchers
  3. Additional lodash-match-pattern filters

Matchers from lodash and checkit modules

Name From
isAlpha checkit "alpha" regex /^[a-z]+$/i
isAlphaDash checkit "alphaDash" regex /^[a-z0-9_-]+$/i
isAlphaNumeric checkit "alphaNumeric" regex /^[a-z0-9]+$/i
isAlphaUnderscore checkit "alphaUnderscore" regex /^[a-z0-9_]+$/i
isArguments lodash isArguments
isArray lodash isArray
isArrayBuffer lodash isArrayBuffer
isArrayLike lodash isArrayLike
isArrayLikeObject lodash isArrayLikeObject
isBase64 checkit "base64" regex /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/
isBetween checkit validator between
isBoolean lodash isBoolean
isBuffer lodash isBuffer
isCamelCase lodash camelCase
isContainerFor checkit validator contains
isDate lodash isDate
isDifferent checkit validator different
isElement lodash isElement
isEmail checkit "email" regex /^(.+)@(.+).(.+)$/i
isEmpty lodash isEmpty
isEqual lodash isEqual
isEqualWith lodash isEqualWith
isError lodash isError
isExactLength checkit validator exactLength
isExists checkit validator exists
isFinite lodash isFinite
isFunction lodash isFunction
isGreaterThan checkit validator greaterThan
isGreaterThanEqualTo checkit validator greaterThanEqualTo
isInRange checkit validator range
isInteger lodash isInteger
isIpv4 checkit "ipv4" regex /^((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2}).){3}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})$/i
isIpv6 checkit "ipv6" regex /^((?=.::)(?!.::.+::)(::)?([\dA-F]{1,4}:(:|\b)|){5}|([\dA-F]{1,4}:){6})((([\dA-F]{1,4}((?!\3)::|:\b|$))|(?!\2\3)){2}|(((2[0-4]|1\d|[1-9])?\d|25[0-5]).?\b){4})$/i
isKebabCase lodash kebabCase
isLength lodash isLength
isLessThan checkit validator lessThan
isLessThanEqualTo checkit validator lessThanEqualTo
isLowerCase lodash lowerCase
isLuhn checkit "luhn" regex /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/
isMap lodash isMap
isMatch lodash isMatch
isMatchWith lodash isMatchWith
isMaxLength checkit validator maxLength
isMinLength checkit validator minLength
isNaN lodash isNaN
isNative lodash isNative
isNatural checkit "natural" regex /^[0-9]+$/i
isNaturalNonZero checkit "naturalNonZero" regex /^[1-9][0-9]*$/i
isNil lodash isNil
isNotAlpha not "isAlpha"
isNotAlphaDash not "isAlphaDash"
isNotAlphaNumeric not "isAlphaNumeric"
isNotAlphaUnderscore not "isAlphaUnderscore"
isNotBase64 not "isBase64"
isNotBetween not "isBetween"
isNotCamelCase not "isCamelCase"
isNotContainerFor not "isContainerFor"
isNotDifferent not "isDifferent"
isNotEmail not "isEmail"
isNotExactLength not "isExactLength"
isNotExists not "isExists"
isNotGreaterThan not "isGreaterThan"
isNotGreaterThanEqualTo not "isGreaterThanEqualTo"
isNotInRange not "isInRange"
isNotIpv4 not "isIpv4"
isNotIpv6 not "isIpv6"
isNotKebabCase not "isKebabCase"
isNotLessThan not "isLessThan"
isNotLessThanEqualTo not "isLessThanEqualTo"
isNotLowerCase not "isLowerCase"
isNotLuhn not "isLuhn"
isNotMaxLength not "isMaxLength"
isNotMinLength not "isMinLength"
isNotNatural not "isNatural"
isNotNaturalNonZero not "isNaturalNonZero"
isNotNumeric not "isNumeric"
isNotRequired not "isRequired"
isNotSnakeCase not "isSnakeCase"
isNotStartCase not "isStartCase"
isNotUpperCase not "isUpperCase"
isNotUrl not "isUrl"
isNotUuid not "isUuid"
isNull lodash isNull
isNumber lodash isNumber
isNumeric checkit validator numeric
isObject lodash isObject
isObjectLike lodash isObjectLike
isPlainObject lodash isPlainObject
isRegExp lodash isRegExp
isRequired checkit validator required
isSafeInteger lodash isSafeInteger
isSet lodash isSet
isSnakeCase lodash snakeCase
isStartCase lodash startCase
isString lodash isString
isSymbol lodash isSymbol
isTypedArray lodash isTypedArray
isUndefined lodash isUndefined
isUpperCase lodash upperCase
isUrl checkit "url" regex /^((http|https)://(\w+:{0,1}\w*@)?(\S+)|)(:[0-9]+)?(/|/([\w#!:.?+=&%@!-/]))?$/
isUuid checkit "uuid" regex /^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i
isWeakMap lodash isWeakMap
isWeakSet lodash isWeakSet

Additional lodash-match-pattern matchers

Name From
isDateString is parsable into a valid date
isDefined any defined value including null
isEqualToMemo s -> _.isEqualToMemo|key -> memo.hash.key === s
isNotEqualToMemo s -> _.isNotEqualToMemo|key -> memo.hash.key !== s
isOmitted alias for _.isUndefined
isPrinted the most useful function; prints and returns true
isSetAsMemo s -> _.isSetAsMemo|key -> true and sets memo.hash.key = s
isSize s -> _.isSize|n -> _.size(s) === n

Additional lodash-match-pattern filters

Name From
clearMemos clears memo.hash
extractUrls extracts URLs from a string into an array
filterPattern use a lodash-match-pattern as a filter argument
setMemo s -> _.setMemo|key -> s and sets memo.hash.key = s