3.1.0 • Published 1 year ago
@shopify/predicates v3.1.0
@shopify/predicates
A set of common JavaScript predicates. The functions in this library either take one input and return true
/false
, or return a customized function that does so.
Installation
yarn add @shopify/predicates
API
Predicates
isPositiveNumericString
Returnstrue
when its input is a positive numeric string andfalse
otherwise.isNumericString
Returnstrue
when its input is a numeric string andfalse
otherwise.isEmpty
Returnstrue
when its input isnull
,undefined
, or haslength
0.isEmptyString
Returnstrue
when it's input is an empty string or contains only whitespace.notEmpty
Returnstrue
when its input is notnull
,undefined
or haslength
0.notNumericString
Returnstrue
when its input is not a numeric string andfalse
otherwise.
Predicate creators
lengthMoreThan
Given a number, returns a function that returns true when that input has length more than that number and false otherwise.lengthLessThan
Given a number, returns a function that returns true when that input has length less than that number and false otherwise.
Helpers
not
Given a function that returns a boolean, returns a function that returns a boolean in the opposite cases.
3.1.0
1 year ago
3.0.1
3 years ago
3.0.0
3 years ago
2.0.8
3 years ago
2.0.6-export-beta.0
3 years ago
2.0.5
3 years ago
2.0.7
3 years ago
2.0.6
3 years ago
2.0.4
4 years ago
2.0.3
4 years ago
2.0.2
4 years ago
2.0.1
4 years ago
2.0.0
4 years ago
1.3.4
4 years ago
1.3.3
4 years ago
1.3.2
4 years ago
1.3.1-mandatory-extensions-beta.0
4 years ago
1.3.1
4 years ago
1.3.0
5 years ago
1.3.0-sk-next-beta.1
5 years ago
1.3.0-sk-next-beta.0
5 years ago
1.2.7
5 years ago
1.0.0-sknext-beta.2
5 years ago
1.0.0-sknext-beta.1
5 years ago
1.2.6-sknext-beta.9
5 years ago
0.0.8-sknext-beta.8
5 years ago
0.0.2-sknext-beta.2
5 years ago
0.0.1-sknext-beta.1
5 years ago
1.2.6
5 years ago
1.2.5
5 years ago
1.2.4
5 years ago
1.2.3
6 years ago
1.2.2
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.1.0
6 years ago
1.0.0
6 years ago