predictype / predicates/strings / stringComparison
stringComparison(
source
,oper
,target
):boolean
Defined in: predicates/strings/stringComparison.ts:27
Compares two strings using the specified operation.
string
The first string.
The comparison operation to perform (e.g. ‘equals’, ‘greater_than’).
string
The second string.
boolean
True if the comparison is valid according to the operator, otherwise false.
If the operation is not recognized.
const a = 'foo';
const b = 'bar';
stringComparison(a, 'greater_than', b); // true
stringComparison(a, 'equals', a); // true
Supported Operators: