@tspro/ts-utils-lib 1.4.0 → 1.6.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/CHANGELOG.md +22 -0
- package/dist/index.d.mts +35 -3
- package/dist/index.d.ts +35 -3
- package/dist/index.js +72 -8
- package/dist/index.mjs +72 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.6.0] - 2025-09-16
|
|
4
|
+
### Added
|
|
5
|
+
- Utils.Is.isEmptyArray()
|
|
6
|
+
- Utils.Is.isNonEmptyArray()
|
|
7
|
+
- Utils.Is.isEmptyArrayOrUndefined()
|
|
8
|
+
- Utils.Is.isNonEmptyArrayOrUndefined()
|
|
9
|
+
- Utils.Is.isEmptyStringOrUndefined()
|
|
10
|
+
- Utils.Is.isNonEmptyStringOrUndefined()
|
|
11
|
+
- Utils.Is.isFinite()
|
|
12
|
+
|
|
13
|
+
## [1.5.0] - 2025-09-16
|
|
14
|
+
### Added
|
|
15
|
+
- Utils.Is.isNullish()
|
|
16
|
+
- Utils.Is.isEmptyString()
|
|
17
|
+
- Utils.Is.isNonEmptyString()
|
|
18
|
+
- Utils.Is.isIntegerOrUndefined()
|
|
19
|
+
- Utils.Is.isIntegerBetween()
|
|
20
|
+
- Utils.Is.isNaNValue()
|
|
21
|
+
- Utils.Is.isInfinity()
|
|
22
|
+
- Utils.Is.isPosInfinity()
|
|
23
|
+
- Utils.Is.isNegInfinity()
|
|
24
|
+
|
|
3
25
|
## [1.4.0] - 2025-09-16
|
|
4
26
|
### Added
|
|
5
27
|
- Utils.Str.charCount(str, ch)
|
package/dist/index.d.mts
CHANGED
|
@@ -113,49 +113,81 @@ declare namespace index$6 {
|
|
|
113
113
|
|
|
114
114
|
declare function isUndefined(value: unknown): value is undefined;
|
|
115
115
|
declare function isNull(value: unknown): value is null;
|
|
116
|
+
declare function isNullish(value: unknown): value is null | undefined;
|
|
116
117
|
declare function isObject$1(value: unknown): value is Record<string, unknown>;
|
|
117
118
|
declare function isObjectOrUndefined(value: unknown): value is Record<string, unknown> | undefined;
|
|
118
119
|
declare function isArray<T>(a: T[] | unknown): a is T[];
|
|
119
120
|
declare function isArrayOrUndefined(value: unknown): value is unknown[] | undefined;
|
|
121
|
+
declare function isEmptyArray<T>(a: T[] | unknown): a is T[];
|
|
122
|
+
declare function isNonEmptyArray<T>(a: T[] | unknown): a is T[];
|
|
123
|
+
declare function isEmptyArrayOrUndefined<T>(a: T[] | unknown): a is T[] | undefined;
|
|
124
|
+
declare function isNonEmptyArrayOrUndefined<T>(a: T[] | unknown): a is T[] | undefined;
|
|
120
125
|
declare function isString(value: unknown): value is string;
|
|
126
|
+
declare function isEmptyString(value: unknown): value is "";
|
|
127
|
+
declare function isNonEmptyString(value: unknown): value is string;
|
|
121
128
|
declare function isStringOrUndefined(value: unknown): value is string | undefined;
|
|
129
|
+
declare function isEmptyStringOrUndefined(value: unknown): value is "" | undefined;
|
|
130
|
+
declare function isNonEmptyStringOrUndefined(value: unknown): value is string | undefined;
|
|
122
131
|
declare function isBoolean(value: unknown): value is boolean;
|
|
123
132
|
declare function isBooleanOrUndefined(value: unknown): value is boolean | undefined;
|
|
124
133
|
declare function isFunction(value: unknown): value is Function;
|
|
125
134
|
declare function isFunctionOrUndefined(value: unknown): value is Function | undefined;
|
|
126
|
-
declare function isNumber(value: unknown): value is number;
|
|
127
|
-
declare function isNumberOrUndefined(value: unknown): value is number | undefined;
|
|
128
135
|
declare function isEnumValue<E extends Record<string, string | number>>(value: unknown, enumObj: E, name?: string): value is E[keyof E];
|
|
129
136
|
declare function isEnumValueOrUndefined<E extends Record<string, string | number>>(value: unknown, enumObj: E, name?: string): value is E[keyof E] | undefined;
|
|
137
|
+
declare function isNumber(value: unknown): value is number;
|
|
138
|
+
declare function isNumberOrUndefined(value: unknown): value is number | undefined;
|
|
139
|
+
declare function isFinite(value: unknown): value is number;
|
|
130
140
|
declare function isInteger$1(n: unknown): n is number;
|
|
141
|
+
declare function isIntegerOrUndefined(n: unknown): n is number | undefined;
|
|
131
142
|
declare function isIntegerEq(value: unknown, compareTo: number): value is number;
|
|
132
143
|
declare function isIntegerGt(value: unknown, compareTo: number): value is number;
|
|
133
144
|
declare function isIntegerGte(value: unknown, compareTo: number): value is number;
|
|
134
145
|
declare function isIntegerLt(value: unknown, compareTo: number): value is number;
|
|
135
146
|
declare function isIntegerLte(value: unknown, compareTo: number): value is number;
|
|
147
|
+
declare function isIntegerBetween(value: unknown, min: number, max: number): value is number;
|
|
148
|
+
declare function isNaNValue(value: unknown): value is number;
|
|
149
|
+
declare function isInfinity(value: unknown): value is number;
|
|
150
|
+
declare function isPosInfinity(value: unknown): value is number;
|
|
151
|
+
declare function isNegInfinity(value: unknown): value is number;
|
|
136
152
|
|
|
137
153
|
declare const index$5_isArray: typeof isArray;
|
|
138
154
|
declare const index$5_isArrayOrUndefined: typeof isArrayOrUndefined;
|
|
139
155
|
declare const index$5_isBoolean: typeof isBoolean;
|
|
140
156
|
declare const index$5_isBooleanOrUndefined: typeof isBooleanOrUndefined;
|
|
157
|
+
declare const index$5_isEmptyArray: typeof isEmptyArray;
|
|
158
|
+
declare const index$5_isEmptyArrayOrUndefined: typeof isEmptyArrayOrUndefined;
|
|
159
|
+
declare const index$5_isEmptyString: typeof isEmptyString;
|
|
160
|
+
declare const index$5_isEmptyStringOrUndefined: typeof isEmptyStringOrUndefined;
|
|
141
161
|
declare const index$5_isEnumValue: typeof isEnumValue;
|
|
142
162
|
declare const index$5_isEnumValueOrUndefined: typeof isEnumValueOrUndefined;
|
|
163
|
+
declare const index$5_isFinite: typeof isFinite;
|
|
143
164
|
declare const index$5_isFunction: typeof isFunction;
|
|
144
165
|
declare const index$5_isFunctionOrUndefined: typeof isFunctionOrUndefined;
|
|
166
|
+
declare const index$5_isInfinity: typeof isInfinity;
|
|
167
|
+
declare const index$5_isIntegerBetween: typeof isIntegerBetween;
|
|
145
168
|
declare const index$5_isIntegerEq: typeof isIntegerEq;
|
|
146
169
|
declare const index$5_isIntegerGt: typeof isIntegerGt;
|
|
147
170
|
declare const index$5_isIntegerGte: typeof isIntegerGte;
|
|
148
171
|
declare const index$5_isIntegerLt: typeof isIntegerLt;
|
|
149
172
|
declare const index$5_isIntegerLte: typeof isIntegerLte;
|
|
173
|
+
declare const index$5_isIntegerOrUndefined: typeof isIntegerOrUndefined;
|
|
174
|
+
declare const index$5_isNaNValue: typeof isNaNValue;
|
|
175
|
+
declare const index$5_isNegInfinity: typeof isNegInfinity;
|
|
176
|
+
declare const index$5_isNonEmptyArray: typeof isNonEmptyArray;
|
|
177
|
+
declare const index$5_isNonEmptyArrayOrUndefined: typeof isNonEmptyArrayOrUndefined;
|
|
178
|
+
declare const index$5_isNonEmptyString: typeof isNonEmptyString;
|
|
179
|
+
declare const index$5_isNonEmptyStringOrUndefined: typeof isNonEmptyStringOrUndefined;
|
|
150
180
|
declare const index$5_isNull: typeof isNull;
|
|
181
|
+
declare const index$5_isNullish: typeof isNullish;
|
|
151
182
|
declare const index$5_isNumber: typeof isNumber;
|
|
152
183
|
declare const index$5_isNumberOrUndefined: typeof isNumberOrUndefined;
|
|
153
184
|
declare const index$5_isObjectOrUndefined: typeof isObjectOrUndefined;
|
|
185
|
+
declare const index$5_isPosInfinity: typeof isPosInfinity;
|
|
154
186
|
declare const index$5_isString: typeof isString;
|
|
155
187
|
declare const index$5_isStringOrUndefined: typeof isStringOrUndefined;
|
|
156
188
|
declare const index$5_isUndefined: typeof isUndefined;
|
|
157
189
|
declare namespace index$5 {
|
|
158
|
-
export { index$5_isArray as isArray, index$5_isArrayOrUndefined as isArrayOrUndefined, index$5_isBoolean as isBoolean, index$5_isBooleanOrUndefined as isBooleanOrUndefined, index$5_isEnumValue as isEnumValue, index$5_isEnumValueOrUndefined as isEnumValueOrUndefined, index$5_isFunction as isFunction, index$5_isFunctionOrUndefined as isFunctionOrUndefined, isInteger$1 as isInteger, index$5_isIntegerEq as isIntegerEq, index$5_isIntegerGt as isIntegerGt, index$5_isIntegerGte as isIntegerGte, index$5_isIntegerLt as isIntegerLt, index$5_isIntegerLte as isIntegerLte, index$5_isNull as isNull, index$5_isNumber as isNumber, index$5_isNumberOrUndefined as isNumberOrUndefined, isObject$1 as isObject, index$5_isObjectOrUndefined as isObjectOrUndefined, index$5_isString as isString, index$5_isStringOrUndefined as isStringOrUndefined, index$5_isUndefined as isUndefined };
|
|
190
|
+
export { index$5_isArray as isArray, index$5_isArrayOrUndefined as isArrayOrUndefined, index$5_isBoolean as isBoolean, index$5_isBooleanOrUndefined as isBooleanOrUndefined, index$5_isEmptyArray as isEmptyArray, index$5_isEmptyArrayOrUndefined as isEmptyArrayOrUndefined, index$5_isEmptyString as isEmptyString, index$5_isEmptyStringOrUndefined as isEmptyStringOrUndefined, index$5_isEnumValue as isEnumValue, index$5_isEnumValueOrUndefined as isEnumValueOrUndefined, index$5_isFinite as isFinite, index$5_isFunction as isFunction, index$5_isFunctionOrUndefined as isFunctionOrUndefined, index$5_isInfinity as isInfinity, isInteger$1 as isInteger, index$5_isIntegerBetween as isIntegerBetween, index$5_isIntegerEq as isIntegerEq, index$5_isIntegerGt as isIntegerGt, index$5_isIntegerGte as isIntegerGte, index$5_isIntegerLt as isIntegerLt, index$5_isIntegerLte as isIntegerLte, index$5_isIntegerOrUndefined as isIntegerOrUndefined, index$5_isNaNValue as isNaNValue, index$5_isNegInfinity as isNegInfinity, index$5_isNonEmptyArray as isNonEmptyArray, index$5_isNonEmptyArrayOrUndefined as isNonEmptyArrayOrUndefined, index$5_isNonEmptyString as isNonEmptyString, index$5_isNonEmptyStringOrUndefined as isNonEmptyStringOrUndefined, index$5_isNull as isNull, index$5_isNullish as isNullish, index$5_isNumber as isNumber, index$5_isNumberOrUndefined as isNumberOrUndefined, isObject$1 as isObject, index$5_isObjectOrUndefined as isObjectOrUndefined, index$5_isPosInfinity as isPosInfinity, index$5_isString as isString, index$5_isStringOrUndefined as isStringOrUndefined, index$5_isUndefined as isUndefined };
|
|
159
191
|
}
|
|
160
192
|
|
|
161
193
|
declare function getMapKeys<K, V>(map: Map<K, V>): K[];
|
package/dist/index.d.ts
CHANGED
|
@@ -113,49 +113,81 @@ declare namespace index$6 {
|
|
|
113
113
|
|
|
114
114
|
declare function isUndefined(value: unknown): value is undefined;
|
|
115
115
|
declare function isNull(value: unknown): value is null;
|
|
116
|
+
declare function isNullish(value: unknown): value is null | undefined;
|
|
116
117
|
declare function isObject$1(value: unknown): value is Record<string, unknown>;
|
|
117
118
|
declare function isObjectOrUndefined(value: unknown): value is Record<string, unknown> | undefined;
|
|
118
119
|
declare function isArray<T>(a: T[] | unknown): a is T[];
|
|
119
120
|
declare function isArrayOrUndefined(value: unknown): value is unknown[] | undefined;
|
|
121
|
+
declare function isEmptyArray<T>(a: T[] | unknown): a is T[];
|
|
122
|
+
declare function isNonEmptyArray<T>(a: T[] | unknown): a is T[];
|
|
123
|
+
declare function isEmptyArrayOrUndefined<T>(a: T[] | unknown): a is T[] | undefined;
|
|
124
|
+
declare function isNonEmptyArrayOrUndefined<T>(a: T[] | unknown): a is T[] | undefined;
|
|
120
125
|
declare function isString(value: unknown): value is string;
|
|
126
|
+
declare function isEmptyString(value: unknown): value is "";
|
|
127
|
+
declare function isNonEmptyString(value: unknown): value is string;
|
|
121
128
|
declare function isStringOrUndefined(value: unknown): value is string | undefined;
|
|
129
|
+
declare function isEmptyStringOrUndefined(value: unknown): value is "" | undefined;
|
|
130
|
+
declare function isNonEmptyStringOrUndefined(value: unknown): value is string | undefined;
|
|
122
131
|
declare function isBoolean(value: unknown): value is boolean;
|
|
123
132
|
declare function isBooleanOrUndefined(value: unknown): value is boolean | undefined;
|
|
124
133
|
declare function isFunction(value: unknown): value is Function;
|
|
125
134
|
declare function isFunctionOrUndefined(value: unknown): value is Function | undefined;
|
|
126
|
-
declare function isNumber(value: unknown): value is number;
|
|
127
|
-
declare function isNumberOrUndefined(value: unknown): value is number | undefined;
|
|
128
135
|
declare function isEnumValue<E extends Record<string, string | number>>(value: unknown, enumObj: E, name?: string): value is E[keyof E];
|
|
129
136
|
declare function isEnumValueOrUndefined<E extends Record<string, string | number>>(value: unknown, enumObj: E, name?: string): value is E[keyof E] | undefined;
|
|
137
|
+
declare function isNumber(value: unknown): value is number;
|
|
138
|
+
declare function isNumberOrUndefined(value: unknown): value is number | undefined;
|
|
139
|
+
declare function isFinite(value: unknown): value is number;
|
|
130
140
|
declare function isInteger$1(n: unknown): n is number;
|
|
141
|
+
declare function isIntegerOrUndefined(n: unknown): n is number | undefined;
|
|
131
142
|
declare function isIntegerEq(value: unknown, compareTo: number): value is number;
|
|
132
143
|
declare function isIntegerGt(value: unknown, compareTo: number): value is number;
|
|
133
144
|
declare function isIntegerGte(value: unknown, compareTo: number): value is number;
|
|
134
145
|
declare function isIntegerLt(value: unknown, compareTo: number): value is number;
|
|
135
146
|
declare function isIntegerLte(value: unknown, compareTo: number): value is number;
|
|
147
|
+
declare function isIntegerBetween(value: unknown, min: number, max: number): value is number;
|
|
148
|
+
declare function isNaNValue(value: unknown): value is number;
|
|
149
|
+
declare function isInfinity(value: unknown): value is number;
|
|
150
|
+
declare function isPosInfinity(value: unknown): value is number;
|
|
151
|
+
declare function isNegInfinity(value: unknown): value is number;
|
|
136
152
|
|
|
137
153
|
declare const index$5_isArray: typeof isArray;
|
|
138
154
|
declare const index$5_isArrayOrUndefined: typeof isArrayOrUndefined;
|
|
139
155
|
declare const index$5_isBoolean: typeof isBoolean;
|
|
140
156
|
declare const index$5_isBooleanOrUndefined: typeof isBooleanOrUndefined;
|
|
157
|
+
declare const index$5_isEmptyArray: typeof isEmptyArray;
|
|
158
|
+
declare const index$5_isEmptyArrayOrUndefined: typeof isEmptyArrayOrUndefined;
|
|
159
|
+
declare const index$5_isEmptyString: typeof isEmptyString;
|
|
160
|
+
declare const index$5_isEmptyStringOrUndefined: typeof isEmptyStringOrUndefined;
|
|
141
161
|
declare const index$5_isEnumValue: typeof isEnumValue;
|
|
142
162
|
declare const index$5_isEnumValueOrUndefined: typeof isEnumValueOrUndefined;
|
|
163
|
+
declare const index$5_isFinite: typeof isFinite;
|
|
143
164
|
declare const index$5_isFunction: typeof isFunction;
|
|
144
165
|
declare const index$5_isFunctionOrUndefined: typeof isFunctionOrUndefined;
|
|
166
|
+
declare const index$5_isInfinity: typeof isInfinity;
|
|
167
|
+
declare const index$5_isIntegerBetween: typeof isIntegerBetween;
|
|
145
168
|
declare const index$5_isIntegerEq: typeof isIntegerEq;
|
|
146
169
|
declare const index$5_isIntegerGt: typeof isIntegerGt;
|
|
147
170
|
declare const index$5_isIntegerGte: typeof isIntegerGte;
|
|
148
171
|
declare const index$5_isIntegerLt: typeof isIntegerLt;
|
|
149
172
|
declare const index$5_isIntegerLte: typeof isIntegerLte;
|
|
173
|
+
declare const index$5_isIntegerOrUndefined: typeof isIntegerOrUndefined;
|
|
174
|
+
declare const index$5_isNaNValue: typeof isNaNValue;
|
|
175
|
+
declare const index$5_isNegInfinity: typeof isNegInfinity;
|
|
176
|
+
declare const index$5_isNonEmptyArray: typeof isNonEmptyArray;
|
|
177
|
+
declare const index$5_isNonEmptyArrayOrUndefined: typeof isNonEmptyArrayOrUndefined;
|
|
178
|
+
declare const index$5_isNonEmptyString: typeof isNonEmptyString;
|
|
179
|
+
declare const index$5_isNonEmptyStringOrUndefined: typeof isNonEmptyStringOrUndefined;
|
|
150
180
|
declare const index$5_isNull: typeof isNull;
|
|
181
|
+
declare const index$5_isNullish: typeof isNullish;
|
|
151
182
|
declare const index$5_isNumber: typeof isNumber;
|
|
152
183
|
declare const index$5_isNumberOrUndefined: typeof isNumberOrUndefined;
|
|
153
184
|
declare const index$5_isObjectOrUndefined: typeof isObjectOrUndefined;
|
|
185
|
+
declare const index$5_isPosInfinity: typeof isPosInfinity;
|
|
154
186
|
declare const index$5_isString: typeof isString;
|
|
155
187
|
declare const index$5_isStringOrUndefined: typeof isStringOrUndefined;
|
|
156
188
|
declare const index$5_isUndefined: typeof isUndefined;
|
|
157
189
|
declare namespace index$5 {
|
|
158
|
-
export { index$5_isArray as isArray, index$5_isArrayOrUndefined as isArrayOrUndefined, index$5_isBoolean as isBoolean, index$5_isBooleanOrUndefined as isBooleanOrUndefined, index$5_isEnumValue as isEnumValue, index$5_isEnumValueOrUndefined as isEnumValueOrUndefined, index$5_isFunction as isFunction, index$5_isFunctionOrUndefined as isFunctionOrUndefined, isInteger$1 as isInteger, index$5_isIntegerEq as isIntegerEq, index$5_isIntegerGt as isIntegerGt, index$5_isIntegerGte as isIntegerGte, index$5_isIntegerLt as isIntegerLt, index$5_isIntegerLte as isIntegerLte, index$5_isNull as isNull, index$5_isNumber as isNumber, index$5_isNumberOrUndefined as isNumberOrUndefined, isObject$1 as isObject, index$5_isObjectOrUndefined as isObjectOrUndefined, index$5_isString as isString, index$5_isStringOrUndefined as isStringOrUndefined, index$5_isUndefined as isUndefined };
|
|
190
|
+
export { index$5_isArray as isArray, index$5_isArrayOrUndefined as isArrayOrUndefined, index$5_isBoolean as isBoolean, index$5_isBooleanOrUndefined as isBooleanOrUndefined, index$5_isEmptyArray as isEmptyArray, index$5_isEmptyArrayOrUndefined as isEmptyArrayOrUndefined, index$5_isEmptyString as isEmptyString, index$5_isEmptyStringOrUndefined as isEmptyStringOrUndefined, index$5_isEnumValue as isEnumValue, index$5_isEnumValueOrUndefined as isEnumValueOrUndefined, index$5_isFinite as isFinite, index$5_isFunction as isFunction, index$5_isFunctionOrUndefined as isFunctionOrUndefined, index$5_isInfinity as isInfinity, isInteger$1 as isInteger, index$5_isIntegerBetween as isIntegerBetween, index$5_isIntegerEq as isIntegerEq, index$5_isIntegerGt as isIntegerGt, index$5_isIntegerGte as isIntegerGte, index$5_isIntegerLt as isIntegerLt, index$5_isIntegerLte as isIntegerLte, index$5_isIntegerOrUndefined as isIntegerOrUndefined, index$5_isNaNValue as isNaNValue, index$5_isNegInfinity as isNegInfinity, index$5_isNonEmptyArray as isNonEmptyArray, index$5_isNonEmptyArrayOrUndefined as isNonEmptyArrayOrUndefined, index$5_isNonEmptyString as isNonEmptyString, index$5_isNonEmptyStringOrUndefined as isNonEmptyStringOrUndefined, index$5_isNull as isNull, index$5_isNullish as isNullish, index$5_isNumber as isNumber, index$5_isNumberOrUndefined as isNumberOrUndefined, isObject$1 as isObject, index$5_isObjectOrUndefined as isObjectOrUndefined, index$5_isPosInfinity as isPosInfinity, index$5_isString as isString, index$5_isStringOrUndefined as isStringOrUndefined, index$5_isUndefined as isUndefined };
|
|
159
191
|
}
|
|
160
192
|
|
|
161
193
|
declare function getMapKeys<K, V>(map: Map<K, V>): K[];
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* TsUtilsLib v1.
|
|
1
|
+
/* TsUtilsLib v1.6.0 | (c) 2023 PahkaSoft | Licensed under the MIT License */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -707,21 +707,37 @@ __export(is_exports, {
|
|
|
707
707
|
isArrayOrUndefined: () => isArrayOrUndefined,
|
|
708
708
|
isBoolean: () => isBoolean,
|
|
709
709
|
isBooleanOrUndefined: () => isBooleanOrUndefined,
|
|
710
|
+
isEmptyArray: () => isEmptyArray,
|
|
711
|
+
isEmptyArrayOrUndefined: () => isEmptyArrayOrUndefined,
|
|
712
|
+
isEmptyString: () => isEmptyString,
|
|
713
|
+
isEmptyStringOrUndefined: () => isEmptyStringOrUndefined,
|
|
710
714
|
isEnumValue: () => isEnumValue,
|
|
711
715
|
isEnumValueOrUndefined: () => isEnumValueOrUndefined,
|
|
716
|
+
isFinite: () => isFinite2,
|
|
712
717
|
isFunction: () => isFunction,
|
|
713
718
|
isFunctionOrUndefined: () => isFunctionOrUndefined,
|
|
719
|
+
isInfinity: () => isInfinity,
|
|
714
720
|
isInteger: () => isInteger2,
|
|
721
|
+
isIntegerBetween: () => isIntegerBetween,
|
|
715
722
|
isIntegerEq: () => isIntegerEq,
|
|
716
723
|
isIntegerGt: () => isIntegerGt,
|
|
717
724
|
isIntegerGte: () => isIntegerGte,
|
|
718
725
|
isIntegerLt: () => isIntegerLt,
|
|
719
726
|
isIntegerLte: () => isIntegerLte,
|
|
727
|
+
isIntegerOrUndefined: () => isIntegerOrUndefined,
|
|
728
|
+
isNaNValue: () => isNaNValue,
|
|
729
|
+
isNegInfinity: () => isNegInfinity,
|
|
730
|
+
isNonEmptyArray: () => isNonEmptyArray,
|
|
731
|
+
isNonEmptyArrayOrUndefined: () => isNonEmptyArrayOrUndefined,
|
|
732
|
+
isNonEmptyString: () => isNonEmptyString,
|
|
733
|
+
isNonEmptyStringOrUndefined: () => isNonEmptyStringOrUndefined,
|
|
720
734
|
isNull: () => isNull,
|
|
735
|
+
isNullish: () => isNullish,
|
|
721
736
|
isNumber: () => isNumber,
|
|
722
737
|
isNumberOrUndefined: () => isNumberOrUndefined,
|
|
723
738
|
isObject: () => isObject,
|
|
724
739
|
isObjectOrUndefined: () => isObjectOrUndefined,
|
|
740
|
+
isPosInfinity: () => isPosInfinity,
|
|
725
741
|
isString: () => isString,
|
|
726
742
|
isStringOrUndefined: () => isStringOrUndefined,
|
|
727
743
|
isUndefined: () => isUndefined
|
|
@@ -732,6 +748,9 @@ function isUndefined(value) {
|
|
|
732
748
|
function isNull(value) {
|
|
733
749
|
return value === null;
|
|
734
750
|
}
|
|
751
|
+
function isNullish(value) {
|
|
752
|
+
return value === void 0 || value === null;
|
|
753
|
+
}
|
|
735
754
|
function isObject(value) {
|
|
736
755
|
return typeof value === "object" && value !== null && !isArray2(value);
|
|
737
756
|
}
|
|
@@ -744,12 +763,36 @@ function isArray2(a) {
|
|
|
744
763
|
function isArrayOrUndefined(value) {
|
|
745
764
|
return value === void 0 || isArray2(value);
|
|
746
765
|
}
|
|
766
|
+
function isEmptyArray(a) {
|
|
767
|
+
return isArray2(a) && a.length === 0;
|
|
768
|
+
}
|
|
769
|
+
function isNonEmptyArray(a) {
|
|
770
|
+
return isArray2(a) && a.length > 0;
|
|
771
|
+
}
|
|
772
|
+
function isEmptyArrayOrUndefined(a) {
|
|
773
|
+
return isArray2(a) && a.length === 0 || a === void 0;
|
|
774
|
+
}
|
|
775
|
+
function isNonEmptyArrayOrUndefined(a) {
|
|
776
|
+
return isArray2(a) && a.length > 0 || a === void 0;
|
|
777
|
+
}
|
|
747
778
|
function isString(value) {
|
|
748
779
|
return typeof value === "string";
|
|
749
780
|
}
|
|
781
|
+
function isEmptyString(value) {
|
|
782
|
+
return typeof value === "string" && value.length === 0;
|
|
783
|
+
}
|
|
784
|
+
function isNonEmptyString(value) {
|
|
785
|
+
return typeof value === "string" && value.length > 0;
|
|
786
|
+
}
|
|
750
787
|
function isStringOrUndefined(value) {
|
|
751
788
|
return value === void 0 || typeof value === "string";
|
|
752
789
|
}
|
|
790
|
+
function isEmptyStringOrUndefined(value) {
|
|
791
|
+
return typeof value === "string" && value.length === 0 || value === void 0;
|
|
792
|
+
}
|
|
793
|
+
function isNonEmptyStringOrUndefined(value) {
|
|
794
|
+
return typeof value === "string" && value.length > 0 || value === void 0;
|
|
795
|
+
}
|
|
753
796
|
function isBoolean(value) {
|
|
754
797
|
return typeof value === "boolean";
|
|
755
798
|
}
|
|
@@ -762,20 +805,26 @@ function isFunction(value) {
|
|
|
762
805
|
function isFunctionOrUndefined(value) {
|
|
763
806
|
return value === void 0 || typeof value === "function";
|
|
764
807
|
}
|
|
765
|
-
function isNumber(value) {
|
|
766
|
-
return typeof value === "number";
|
|
767
|
-
}
|
|
768
|
-
function isNumberOrUndefined(value) {
|
|
769
|
-
return value === void 0 || typeof value === "number";
|
|
770
|
-
}
|
|
771
808
|
function isEnumValue(value, enumObj, name = "value") {
|
|
772
809
|
return getEnumValues(enumObj).some((v) => v === value);
|
|
773
810
|
}
|
|
774
811
|
function isEnumValueOrUndefined(value, enumObj, name = "value") {
|
|
775
812
|
return value === void 0 || getEnumValues(enumObj).some((v) => v === value);
|
|
776
813
|
}
|
|
814
|
+
function isNumber(value) {
|
|
815
|
+
return typeof value === "number";
|
|
816
|
+
}
|
|
817
|
+
function isNumberOrUndefined(value) {
|
|
818
|
+
return typeof value === "number" || value === void 0;
|
|
819
|
+
}
|
|
820
|
+
function isFinite2(value) {
|
|
821
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
822
|
+
}
|
|
777
823
|
function isInteger2(n) {
|
|
778
|
-
return typeof n === "number" &&
|
|
824
|
+
return typeof n === "number" && isFinite2(n) && n === Math.trunc(n);
|
|
825
|
+
}
|
|
826
|
+
function isIntegerOrUndefined(n) {
|
|
827
|
+
return typeof n === "number" && isFinite2(n) && n === Math.trunc(n) || n === void 0;
|
|
779
828
|
}
|
|
780
829
|
function isIntegerEq(value, compareTo) {
|
|
781
830
|
return isInteger2(value) && value === compareTo;
|
|
@@ -792,6 +841,21 @@ function isIntegerLt(value, compareTo) {
|
|
|
792
841
|
function isIntegerLte(value, compareTo) {
|
|
793
842
|
return isInteger2(value) && value <= compareTo;
|
|
794
843
|
}
|
|
844
|
+
function isIntegerBetween(value, min, max) {
|
|
845
|
+
return isInteger2(value) && value >= min && value <= max;
|
|
846
|
+
}
|
|
847
|
+
function isNaNValue(value) {
|
|
848
|
+
return typeof value === "number" && Number.isNaN(value);
|
|
849
|
+
}
|
|
850
|
+
function isInfinity(value) {
|
|
851
|
+
return typeof value === "number" && Math.abs(value) === Infinity;
|
|
852
|
+
}
|
|
853
|
+
function isPosInfinity(value) {
|
|
854
|
+
return typeof value === "number" && value === Infinity;
|
|
855
|
+
}
|
|
856
|
+
function isNegInfinity(value) {
|
|
857
|
+
return typeof value === "number" && value === -Infinity;
|
|
858
|
+
}
|
|
795
859
|
|
|
796
860
|
// src/utils/map/index.ts
|
|
797
861
|
var map_exports = {};
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* TsUtilsLib v1.
|
|
1
|
+
/* TsUtilsLib v1.6.0 | (c) 2023 PahkaSoft | Licensed under the MIT License */
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __export = (target, all) => {
|
|
@@ -680,21 +680,37 @@ __export(is_exports, {
|
|
|
680
680
|
isArrayOrUndefined: () => isArrayOrUndefined,
|
|
681
681
|
isBoolean: () => isBoolean,
|
|
682
682
|
isBooleanOrUndefined: () => isBooleanOrUndefined,
|
|
683
|
+
isEmptyArray: () => isEmptyArray,
|
|
684
|
+
isEmptyArrayOrUndefined: () => isEmptyArrayOrUndefined,
|
|
685
|
+
isEmptyString: () => isEmptyString,
|
|
686
|
+
isEmptyStringOrUndefined: () => isEmptyStringOrUndefined,
|
|
683
687
|
isEnumValue: () => isEnumValue,
|
|
684
688
|
isEnumValueOrUndefined: () => isEnumValueOrUndefined,
|
|
689
|
+
isFinite: () => isFinite2,
|
|
685
690
|
isFunction: () => isFunction,
|
|
686
691
|
isFunctionOrUndefined: () => isFunctionOrUndefined,
|
|
692
|
+
isInfinity: () => isInfinity,
|
|
687
693
|
isInteger: () => isInteger2,
|
|
694
|
+
isIntegerBetween: () => isIntegerBetween,
|
|
688
695
|
isIntegerEq: () => isIntegerEq,
|
|
689
696
|
isIntegerGt: () => isIntegerGt,
|
|
690
697
|
isIntegerGte: () => isIntegerGte,
|
|
691
698
|
isIntegerLt: () => isIntegerLt,
|
|
692
699
|
isIntegerLte: () => isIntegerLte,
|
|
700
|
+
isIntegerOrUndefined: () => isIntegerOrUndefined,
|
|
701
|
+
isNaNValue: () => isNaNValue,
|
|
702
|
+
isNegInfinity: () => isNegInfinity,
|
|
703
|
+
isNonEmptyArray: () => isNonEmptyArray,
|
|
704
|
+
isNonEmptyArrayOrUndefined: () => isNonEmptyArrayOrUndefined,
|
|
705
|
+
isNonEmptyString: () => isNonEmptyString,
|
|
706
|
+
isNonEmptyStringOrUndefined: () => isNonEmptyStringOrUndefined,
|
|
693
707
|
isNull: () => isNull,
|
|
708
|
+
isNullish: () => isNullish,
|
|
694
709
|
isNumber: () => isNumber,
|
|
695
710
|
isNumberOrUndefined: () => isNumberOrUndefined,
|
|
696
711
|
isObject: () => isObject,
|
|
697
712
|
isObjectOrUndefined: () => isObjectOrUndefined,
|
|
713
|
+
isPosInfinity: () => isPosInfinity,
|
|
698
714
|
isString: () => isString,
|
|
699
715
|
isStringOrUndefined: () => isStringOrUndefined,
|
|
700
716
|
isUndefined: () => isUndefined
|
|
@@ -705,6 +721,9 @@ function isUndefined(value) {
|
|
|
705
721
|
function isNull(value) {
|
|
706
722
|
return value === null;
|
|
707
723
|
}
|
|
724
|
+
function isNullish(value) {
|
|
725
|
+
return value === void 0 || value === null;
|
|
726
|
+
}
|
|
708
727
|
function isObject(value) {
|
|
709
728
|
return typeof value === "object" && value !== null && !isArray2(value);
|
|
710
729
|
}
|
|
@@ -717,12 +736,36 @@ function isArray2(a) {
|
|
|
717
736
|
function isArrayOrUndefined(value) {
|
|
718
737
|
return value === void 0 || isArray2(value);
|
|
719
738
|
}
|
|
739
|
+
function isEmptyArray(a) {
|
|
740
|
+
return isArray2(a) && a.length === 0;
|
|
741
|
+
}
|
|
742
|
+
function isNonEmptyArray(a) {
|
|
743
|
+
return isArray2(a) && a.length > 0;
|
|
744
|
+
}
|
|
745
|
+
function isEmptyArrayOrUndefined(a) {
|
|
746
|
+
return isArray2(a) && a.length === 0 || a === void 0;
|
|
747
|
+
}
|
|
748
|
+
function isNonEmptyArrayOrUndefined(a) {
|
|
749
|
+
return isArray2(a) && a.length > 0 || a === void 0;
|
|
750
|
+
}
|
|
720
751
|
function isString(value) {
|
|
721
752
|
return typeof value === "string";
|
|
722
753
|
}
|
|
754
|
+
function isEmptyString(value) {
|
|
755
|
+
return typeof value === "string" && value.length === 0;
|
|
756
|
+
}
|
|
757
|
+
function isNonEmptyString(value) {
|
|
758
|
+
return typeof value === "string" && value.length > 0;
|
|
759
|
+
}
|
|
723
760
|
function isStringOrUndefined(value) {
|
|
724
761
|
return value === void 0 || typeof value === "string";
|
|
725
762
|
}
|
|
763
|
+
function isEmptyStringOrUndefined(value) {
|
|
764
|
+
return typeof value === "string" && value.length === 0 || value === void 0;
|
|
765
|
+
}
|
|
766
|
+
function isNonEmptyStringOrUndefined(value) {
|
|
767
|
+
return typeof value === "string" && value.length > 0 || value === void 0;
|
|
768
|
+
}
|
|
726
769
|
function isBoolean(value) {
|
|
727
770
|
return typeof value === "boolean";
|
|
728
771
|
}
|
|
@@ -735,20 +778,26 @@ function isFunction(value) {
|
|
|
735
778
|
function isFunctionOrUndefined(value) {
|
|
736
779
|
return value === void 0 || typeof value === "function";
|
|
737
780
|
}
|
|
738
|
-
function isNumber(value) {
|
|
739
|
-
return typeof value === "number";
|
|
740
|
-
}
|
|
741
|
-
function isNumberOrUndefined(value) {
|
|
742
|
-
return value === void 0 || typeof value === "number";
|
|
743
|
-
}
|
|
744
781
|
function isEnumValue(value, enumObj, name = "value") {
|
|
745
782
|
return getEnumValues(enumObj).some((v) => v === value);
|
|
746
783
|
}
|
|
747
784
|
function isEnumValueOrUndefined(value, enumObj, name = "value") {
|
|
748
785
|
return value === void 0 || getEnumValues(enumObj).some((v) => v === value);
|
|
749
786
|
}
|
|
787
|
+
function isNumber(value) {
|
|
788
|
+
return typeof value === "number";
|
|
789
|
+
}
|
|
790
|
+
function isNumberOrUndefined(value) {
|
|
791
|
+
return typeof value === "number" || value === void 0;
|
|
792
|
+
}
|
|
793
|
+
function isFinite2(value) {
|
|
794
|
+
return typeof value === "number" && Number.isFinite(value);
|
|
795
|
+
}
|
|
750
796
|
function isInteger2(n) {
|
|
751
|
-
return typeof n === "number" &&
|
|
797
|
+
return typeof n === "number" && isFinite2(n) && n === Math.trunc(n);
|
|
798
|
+
}
|
|
799
|
+
function isIntegerOrUndefined(n) {
|
|
800
|
+
return typeof n === "number" && isFinite2(n) && n === Math.trunc(n) || n === void 0;
|
|
752
801
|
}
|
|
753
802
|
function isIntegerEq(value, compareTo) {
|
|
754
803
|
return isInteger2(value) && value === compareTo;
|
|
@@ -765,6 +814,21 @@ function isIntegerLt(value, compareTo) {
|
|
|
765
814
|
function isIntegerLte(value, compareTo) {
|
|
766
815
|
return isInteger2(value) && value <= compareTo;
|
|
767
816
|
}
|
|
817
|
+
function isIntegerBetween(value, min, max) {
|
|
818
|
+
return isInteger2(value) && value >= min && value <= max;
|
|
819
|
+
}
|
|
820
|
+
function isNaNValue(value) {
|
|
821
|
+
return typeof value === "number" && Number.isNaN(value);
|
|
822
|
+
}
|
|
823
|
+
function isInfinity(value) {
|
|
824
|
+
return typeof value === "number" && Math.abs(value) === Infinity;
|
|
825
|
+
}
|
|
826
|
+
function isPosInfinity(value) {
|
|
827
|
+
return typeof value === "number" && value === Infinity;
|
|
828
|
+
}
|
|
829
|
+
function isNegInfinity(value) {
|
|
830
|
+
return typeof value === "number" && value === -Infinity;
|
|
831
|
+
}
|
|
768
832
|
|
|
769
833
|
// src/utils/map/index.ts
|
|
770
834
|
var map_exports = {};
|