@guillaume-docquier/tools-ts 2.1.1 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/Range.d.ts +110 -0
- package/dist/Range.js +153 -0
- package/dist/Range.js.map +1 -0
- package/dist/entry.tools-ts.d.ts +1 -0
- package/dist/entry.tools-ts.js +1 -0
- package/dist/entry.tools-ts.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,6 +35,15 @@ external APIs, CLI input, local storage, or other unknown data.
|
|
|
35
35
|
| `getEnumKey` | Looks up the enum key associated with a value. | You have an enum value and need the more descriptive key for display, logs, or diagnostics. |
|
|
36
36
|
| `asArray` | Normalizes a single value or array into an array. | An API accepts both `T` and `T[]`, but downstream logic should iterate uniformly. |
|
|
37
37
|
|
|
38
|
+
### Numeric Ranges
|
|
39
|
+
|
|
40
|
+
Use this tool when code needs a reusable, validated numeric interval instead of
|
|
41
|
+
duplicating min/max checks across call sites.
|
|
42
|
+
|
|
43
|
+
| Export | What it is | Use it when |
|
|
44
|
+
| ------- | ---------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
45
|
+
| `Range` | Helpers for creating, validating, comparing, and testing ranges. | You need finite integer or float intervals with inclusive minimums and configurable maximums. |
|
|
46
|
+
|
|
38
47
|
### Utility Types
|
|
39
48
|
|
|
40
49
|
These exports are type-only helpers for common TypeScript modeling problems.
|
package/dist/Range.d.ts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Result } from "./Result.js";
|
|
2
|
+
/**
|
|
3
|
+
* A finite numeric interval with an inclusive minimum and either an inclusive or exclusive maximum.
|
|
4
|
+
* Use {@link Range.createMaxInclusive} and {@link Range.createMaxExclusive} factory methods to create valid ranges.
|
|
5
|
+
*/
|
|
6
|
+
export type Range<TNumericType extends NumericType = NumericType> = InclusiveRange<TNumericType> | ExclusiveRange<TNumericType>;
|
|
7
|
+
/**
|
|
8
|
+
* A finite numeric interval whose maximum value is included in the range.
|
|
9
|
+
* Use the {@link Range.createMaxInclusive} factory method to create valid InclusiveRanges.
|
|
10
|
+
*/
|
|
11
|
+
export type InclusiveRange<TNumericType extends NumericType> = {
|
|
12
|
+
/**
|
|
13
|
+
* Discriminator for ranges where the maximum value is included.
|
|
14
|
+
*/
|
|
15
|
+
readonly type: "MaxInclusive";
|
|
16
|
+
/**
|
|
17
|
+
* The kind of numeric values accepted by the range.
|
|
18
|
+
*/
|
|
19
|
+
readonly numericType: TNumericType;
|
|
20
|
+
/**
|
|
21
|
+
* The inclusive lower bound.
|
|
22
|
+
*/
|
|
23
|
+
readonly min: number;
|
|
24
|
+
/**
|
|
25
|
+
* The inclusive upper bound.
|
|
26
|
+
*/
|
|
27
|
+
readonly maxInclusive: number;
|
|
28
|
+
/**
|
|
29
|
+
* Optional outer range that this range must stay within.
|
|
30
|
+
*/
|
|
31
|
+
readonly limits?: Range<TNumericType>;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* A finite numeric interval whose maximum value is excluded from the range.
|
|
35
|
+
* Use the {@link Range.createMaxExclusive} factory method to create valid ExclusiveRanges.
|
|
36
|
+
*/
|
|
37
|
+
export type ExclusiveRange<TNumericType extends NumericType> = {
|
|
38
|
+
/**
|
|
39
|
+
* Discriminator for ranges where the maximum value is excluded.
|
|
40
|
+
*/
|
|
41
|
+
readonly type: "MaxExclusive";
|
|
42
|
+
/**
|
|
43
|
+
* The kind of numeric values accepted by the range.
|
|
44
|
+
*/
|
|
45
|
+
readonly numericType: TNumericType;
|
|
46
|
+
/**
|
|
47
|
+
* The inclusive lower bound.
|
|
48
|
+
*/
|
|
49
|
+
readonly min: number;
|
|
50
|
+
/**
|
|
51
|
+
* The exclusive upper bound.
|
|
52
|
+
*/
|
|
53
|
+
readonly maxExclusive: number;
|
|
54
|
+
/**
|
|
55
|
+
* Optional outer range that this range must stay within.
|
|
56
|
+
*/
|
|
57
|
+
readonly limits?: Range<TNumericType>;
|
|
58
|
+
};
|
|
59
|
+
type NumericType = "float" | "integer";
|
|
60
|
+
/**
|
|
61
|
+
* Helpers for creating, validating, comparing, and narrowing numeric ranges.
|
|
62
|
+
*/
|
|
63
|
+
export declare const Range: {
|
|
64
|
+
/**
|
|
65
|
+
* Creates a range that includes its maximum value.
|
|
66
|
+
* The function returns a Failure if the Range parameters are invalid.
|
|
67
|
+
*
|
|
68
|
+
* @param range The range values, excluding the discriminator added by this function.
|
|
69
|
+
*/
|
|
70
|
+
createMaxInclusive: <TNumericType extends NumericType>(range: Omit<InclusiveRange<TNumericType>, "type">) => Result<InclusiveRange<TNumericType>, string>;
|
|
71
|
+
/**
|
|
72
|
+
* Creates a range that excludes its maximum value.
|
|
73
|
+
* The function returns a Failure if the Range parameters are invalid.
|
|
74
|
+
*
|
|
75
|
+
* @param range The range values, excluding the discriminator added by this function.
|
|
76
|
+
*/
|
|
77
|
+
createMaxExclusive: <TNumericType extends NumericType>(range: Omit<ExclusiveRange<TNumericType>, "type">) => Result<ExclusiveRange<TNumericType>, string>;
|
|
78
|
+
/**
|
|
79
|
+
* Creates a new range with the same discriminator, numeric type, and limits as another range.
|
|
80
|
+
*
|
|
81
|
+
* @param fromRange The range to copy the shape from.
|
|
82
|
+
* @param withValues The replacement minimum and maximum values.
|
|
83
|
+
*/
|
|
84
|
+
from: <TRange extends Range<TNumericType>, TNumericType extends NumericType>(fromRange: TRange, withValues: {
|
|
85
|
+
min: number;
|
|
86
|
+
max: number;
|
|
87
|
+
}) => Result<TRange, string>;
|
|
88
|
+
/**
|
|
89
|
+
* Checks whether a Range is valid.
|
|
90
|
+
* This is only useful to run on untrusted input since the Range constructors already ensures the Range is valid.
|
|
91
|
+
*
|
|
92
|
+
* @param range The range to validate.
|
|
93
|
+
*/
|
|
94
|
+
validate: (range: Range) => string | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Checks whether a numeric value is inside the Range.
|
|
97
|
+
*
|
|
98
|
+
* @param range The range to test against.
|
|
99
|
+
* @param value The value to test.
|
|
100
|
+
*/
|
|
101
|
+
isWithin: (range: Range, value: number) => boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Checks whether two Ranges share at least one value.
|
|
104
|
+
*
|
|
105
|
+
* @param a The first range.
|
|
106
|
+
* @param b The second range.
|
|
107
|
+
*/
|
|
108
|
+
overlaps: <TNumericType extends NumericType>(a: Range<TNumericType>, b: Range<TNumericType>) => boolean;
|
|
109
|
+
};
|
|
110
|
+
export {};
|
package/dist/Range.js
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { Result } from "./Result.js";
|
|
2
|
+
/**
|
|
3
|
+
* Helpers for creating, validating, comparing, and narrowing numeric ranges.
|
|
4
|
+
*/
|
|
5
|
+
export const Range = {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a range that includes its maximum value.
|
|
8
|
+
* The function returns a Failure if the Range parameters are invalid.
|
|
9
|
+
*
|
|
10
|
+
* @param range The range values, excluding the discriminator added by this function.
|
|
11
|
+
*/
|
|
12
|
+
createMaxInclusive: (range) => {
|
|
13
|
+
const inclusiveRange = {
|
|
14
|
+
...range,
|
|
15
|
+
type: "MaxInclusive",
|
|
16
|
+
};
|
|
17
|
+
const invalidReason = Range.validate(inclusiveRange);
|
|
18
|
+
if (invalidReason !== undefined) {
|
|
19
|
+
return Result.Failure(invalidReason);
|
|
20
|
+
}
|
|
21
|
+
return Result.Success(inclusiveRange);
|
|
22
|
+
},
|
|
23
|
+
/**
|
|
24
|
+
* Creates a range that excludes its maximum value.
|
|
25
|
+
* The function returns a Failure if the Range parameters are invalid.
|
|
26
|
+
*
|
|
27
|
+
* @param range The range values, excluding the discriminator added by this function.
|
|
28
|
+
*/
|
|
29
|
+
createMaxExclusive: (range) => {
|
|
30
|
+
const exclusiveRange = {
|
|
31
|
+
...range,
|
|
32
|
+
type: "MaxExclusive",
|
|
33
|
+
};
|
|
34
|
+
const invalidReason = Range.validate(exclusiveRange);
|
|
35
|
+
if (invalidReason !== undefined) {
|
|
36
|
+
return Result.Failure(invalidReason);
|
|
37
|
+
}
|
|
38
|
+
return Result.Success(exclusiveRange);
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* Creates a new range with the same discriminator, numeric type, and limits as another range.
|
|
42
|
+
*
|
|
43
|
+
* @param fromRange The range to copy the shape from.
|
|
44
|
+
* @param withValues The replacement minimum and maximum values.
|
|
45
|
+
*/
|
|
46
|
+
from: (fromRange, withValues) => {
|
|
47
|
+
switch (fromRange.type) {
|
|
48
|
+
case "MaxExclusive":
|
|
49
|
+
return Range.createMaxExclusive({
|
|
50
|
+
numericType: fromRange.numericType,
|
|
51
|
+
min: withValues.min,
|
|
52
|
+
maxExclusive: withValues.max,
|
|
53
|
+
limits: fromRange.limits,
|
|
54
|
+
});
|
|
55
|
+
case "MaxInclusive":
|
|
56
|
+
return Range.createMaxInclusive({
|
|
57
|
+
numericType: fromRange.numericType,
|
|
58
|
+
min: withValues.min,
|
|
59
|
+
maxInclusive: withValues.max,
|
|
60
|
+
limits: fromRange.limits,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* Checks whether a Range is valid.
|
|
66
|
+
* This is only useful to run on untrusted input since the Range constructors already ensures the Range is valid.
|
|
67
|
+
*
|
|
68
|
+
* @param range The range to validate.
|
|
69
|
+
*/
|
|
70
|
+
validate: (range) => {
|
|
71
|
+
for (const rule of RANGE_VALIDATION_RULES) {
|
|
72
|
+
const reason = rule(range);
|
|
73
|
+
if (reason !== undefined) {
|
|
74
|
+
return reason;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return undefined;
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* Checks whether a numeric value is inside the Range.
|
|
81
|
+
*
|
|
82
|
+
* @param range The range to test against.
|
|
83
|
+
* @param value The value to test.
|
|
84
|
+
*/
|
|
85
|
+
isWithin: (range, value) => {
|
|
86
|
+
if (value < range.min) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
switch (range.type) {
|
|
90
|
+
case "MaxExclusive":
|
|
91
|
+
return value < range.maxExclusive;
|
|
92
|
+
case "MaxInclusive":
|
|
93
|
+
return value <= range.maxInclusive;
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
/**
|
|
97
|
+
* Checks whether two Ranges share at least one value.
|
|
98
|
+
*
|
|
99
|
+
* @param a The first range.
|
|
100
|
+
* @param b The second range.
|
|
101
|
+
*/
|
|
102
|
+
overlaps: (a, b) => {
|
|
103
|
+
return Range.isWithin(a, b.min) || Range.isWithin(b, a.min);
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
const RANGE_VALIDATION_RULES = [
|
|
107
|
+
minIsFinite,
|
|
108
|
+
maxIsFinite,
|
|
109
|
+
minIsValidNumberType,
|
|
110
|
+
maxIsValidNumberType,
|
|
111
|
+
minIsSmallerThanMax,
|
|
112
|
+
limitsAreValid,
|
|
113
|
+
minIsWithinLimits,
|
|
114
|
+
maxIsWithinLimits,
|
|
115
|
+
];
|
|
116
|
+
function minIsFinite(range) {
|
|
117
|
+
return Number.isFinite(range.min) ? undefined : "Min must be a finite number";
|
|
118
|
+
}
|
|
119
|
+
function maxIsFinite(range) {
|
|
120
|
+
return Number.isFinite(getMax(range)) ? undefined : "Min must be a finite number";
|
|
121
|
+
}
|
|
122
|
+
function minIsValidNumberType(range) {
|
|
123
|
+
return range.numericType === "float" || Number.isInteger(range.min) ? undefined : `Min must be a ${range.numericType} number`;
|
|
124
|
+
}
|
|
125
|
+
function maxIsValidNumberType(range) {
|
|
126
|
+
return range.numericType === "float" || Number.isInteger(getMax(range)) ? undefined : `Max must be a ${range.numericType} number`;
|
|
127
|
+
}
|
|
128
|
+
function minIsSmallerThanMax(range) {
|
|
129
|
+
switch (range.type) {
|
|
130
|
+
case "MaxExclusive":
|
|
131
|
+
return range.min < range.maxExclusive ? undefined : "Min must be smaller than the exclusive max";
|
|
132
|
+
case "MaxInclusive":
|
|
133
|
+
return range.min <= range.maxInclusive ? undefined : "Min must be smaller or equal to the inclusive max";
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
function limitsAreValid(range) {
|
|
137
|
+
return range.limits === undefined ? undefined : Range.validate(range.limits);
|
|
138
|
+
}
|
|
139
|
+
function minIsWithinLimits(range) {
|
|
140
|
+
return range.limits === undefined || Range.isWithin(range.limits, range.min) ? undefined : "Min must be within limits";
|
|
141
|
+
}
|
|
142
|
+
function maxIsWithinLimits(range) {
|
|
143
|
+
return range.limits === undefined || Range.isWithin(range.limits, getMax(range)) ? undefined : "Max must be within limits";
|
|
144
|
+
}
|
|
145
|
+
function getMax(range) {
|
|
146
|
+
switch (range.type) {
|
|
147
|
+
case "MaxExclusive":
|
|
148
|
+
return range.maxExclusive;
|
|
149
|
+
case "MaxInclusive":
|
|
150
|
+
return range.maxInclusive;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=Range.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Range.js","sourceRoot":"","sources":["../src/Range.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAwEpC;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB;;;;;OAKG;IACH,kBAAkB,EAAE,CAClB,KAAiD,EACH,EAAE;QAChD,MAAM,cAAc,GAAiC;YACnD,GAAG,KAAK;YACR,IAAI,EAAE,cAAc;SACrB,CAAA;QAED,MAAM,aAAa,GAAG,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAA;QACpD,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YAChC,OAAO,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;QACtC,CAAC;QAED,OAAO,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;IACvC,CAAC;IAED;;;;;OAKG;IACH,kBAAkB,EAAE,CAClB,KAAiD,EACH,E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AC,CAAC,2BAA2B,CAAA;AAC5H,CAAC;AAED,SAAS,MAAM,CAAC,KAAY;IAC1B,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,cAAc;YACjB,OAAO,KAAK,CAAC,YAAY,CAAA;QAC3B,KAAK,cAAc;YACjB,OAAO,KAAK,CAAC,YAAY,CAAA;IAC7B,CAAC;AACH,CAAC"}
|
package/dist/entry.tools-ts.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { asArray } from "./asArray.js";
|
|
|
9
9
|
export { Assert } from "./Assert.js";
|
|
10
10
|
export { Result, type Success, type Failure } from "./Result.js";
|
|
11
11
|
export { Measure } from "./Measure.js";
|
|
12
|
+
export { Range, type InclusiveRange, type ExclusiveRange } from "./Range.js";
|
|
12
13
|
export { TypeGuard } from "./TypeGuard.js";
|
|
13
14
|
export { setTimeoutAsync } from "./setTimeoutAsync.js";
|
|
14
15
|
export { noop, asyncNoop } from "./noop.js";
|
package/dist/entry.tools-ts.js
CHANGED
|
@@ -8,6 +8,7 @@ export { asArray } from "./asArray.js";
|
|
|
8
8
|
export { Assert } from "./Assert.js";
|
|
9
9
|
export { Result } from "./Result.js";
|
|
10
10
|
export { Measure } from "./Measure.js";
|
|
11
|
+
export { Range } from "./Range.js";
|
|
11
12
|
export { TypeGuard } from "./TypeGuard.js";
|
|
12
13
|
export { setTimeoutAsync } from "./setTimeoutAsync.js";
|
|
13
14
|
export { noop, asyncNoop } from "./noop.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.tools-ts.js","sourceRoot":"","sources":["../src/entry.tools-ts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AACrE,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