Repository navigation
Expand file tree
/
Copy pathless.ts
More file actions
56 lines (55 loc) · 1.99 KB
/
Copy pathless.ts
File metadata and controls
56 lines (55 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import equal from '@app/string/equal.ts'
/**
* Compare strings for ordering.
* @description Reports whether the left string sorts before the right.
* @param first - First string to compare
* @param second - Second string to compare
* @param inclusive - When true, treats equal strings as matching
* @returns Comparison result
*/
export default function less(
first: string,
second: string,
inclusive?: boolean
): boolean
/**
* Compare string vectors for ordering.
* @description Reports whether the left strings sort before the right strings.
* @param first - First string or vector of strings
* @param second - Second string or vector of strings
* @param inclusive - When true, treats equal strings as matching
* @returns Vector of comparison results
*/
export default function less(
first: string | string[],
second: string | string[],
inclusive?: boolean
): boolean[]
/**
* Compare string arrays for ordering.
* @description Reports whether the left string sorts before the right.
* @param first - First string, vector, or matrix of strings
* @param second - Second string, vector, or matrix of strings
* @param inclusive - When true, treats equal strings as matching
* @returns Comparison results matching the input shape
*/
export default function less(
first: string | string[] | string[][],
second: string | string[] | string[][],
inclusive?: boolean
): boolean | boolean[] | boolean[][]
/**
* Compare strings for ordering.
* @description Reports whether the left string sorts before the right.
* @param first - First string, vector, or matrix of strings
* @param second - Second string, vector, or matrix of strings
* @param inclusive - When true, treats equal strings as matching
* @returns Comparison results matching the input shape
*/
export default function less(
first: string | string[] | string[][],
second: string | string[] | string[][],
inclusive: boolean = false
): boolean | boolean[] | boolean[][] {
return equal(first, second, inclusive ? 'less_equal' : 'less')
}