@webdeveric/utils 0.54.0 → 0.54.1
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.range =
|
|
4
|
-
|
|
3
|
+
exports.range = range;
|
|
4
|
+
function range(min, max) {
|
|
5
5
|
if (min === Number.NEGATIVE_INFINITY && max === Number.POSITIVE_INFINITY) {
|
|
6
6
|
throw new RangeError('min and max cannot be -Infinity and Infinity');
|
|
7
7
|
}
|
|
@@ -12,5 +12,4 @@ const range = (min, max) => {
|
|
|
12
12
|
throw new RangeError('min must be less than max');
|
|
13
13
|
}
|
|
14
14
|
return (input) => (typeof input === 'number' || typeof input === 'bigint') && input >= min && input <= max;
|
|
15
|
-
}
|
|
16
|
-
exports.range = range;
|
|
15
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export function range(min, max) {
|
|
2
2
|
if (min === Number.NEGATIVE_INFINITY && max === Number.POSITIVE_INFINITY) {
|
|
3
3
|
throw new RangeError('min and max cannot be -Infinity and Infinity');
|
|
4
4
|
}
|
|
@@ -9,4 +9,4 @@ export const range = (min, max) => {
|
|
|
9
9
|
throw new RangeError('min must be less than max');
|
|
10
10
|
}
|
|
11
11
|
return (input) => (typeof input === 'number' || typeof input === 'bigint') && input >= min && input <= max;
|
|
12
|
-
}
|
|
12
|
+
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { TypePredicateFn } from '../../types/functions.js';
|
|
2
|
-
export declare
|
|
2
|
+
export declare function range(min: number, max: number): TypePredicateFn<number>;
|
|
3
|
+
export declare function range(min: bigint, max: bigint): TypePredicateFn<bigint>;
|