@rzl-zone/utils-js 3.7.1 → 3.8.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 +23 -0
- package/dist/assertions/index.cjs +1 -1
- package/dist/assertions/index.d.ts +8 -8
- package/dist/assertions/index.js +1 -1
- package/dist/chunk-2VO2CBTU.js +1 -1
- package/dist/{chunk-KTQLDIIT.cjs → chunk-3JD53UUH.cjs} +15 -5
- package/dist/chunk-3KTD3QDI.js +1 -1
- package/dist/chunk-4ACKNPL5.js +1 -1
- package/dist/chunk-4ZOXSUXB.js +1 -1
- package/dist/{chunk-6PKW4WCT.js → chunk-5IKZ3JDV.js} +20 -8
- package/dist/chunk-5NN4ZDE2.cjs +1 -1
- package/dist/{chunk-OS5OT5JA.cjs → chunk-5PF7KRCP.cjs} +25 -9
- package/dist/{chunk-66WLOZOD.cjs → chunk-6NORJBI6.cjs} +7 -5
- package/dist/chunk-6RFNZ2ZZ.cjs +1 -1
- package/dist/{chunk-TDPYR5JY.js → chunk-6VA4F6VR.js} +15 -5
- package/dist/chunk-6WMB5AJR.js +1 -1
- package/dist/chunk-7QQV66RX.cjs +1 -1
- package/dist/chunk-7WBMA2VE.cjs +1 -1
- package/dist/chunk-7ZNEUWYP.js +1 -1
- package/dist/chunk-A3YI6Y2P.js +1 -1
- package/dist/{chunk-RMJC3B5P.cjs → chunk-A4H7474O.cjs} +7 -4
- package/dist/chunk-AKKM6MOX.cjs +1 -1
- package/dist/chunk-ATLFMKAF.cjs +1 -1
- package/dist/chunk-B4SDEBN7.cjs +1 -1
- package/dist/chunk-B6UIKBHR.cjs +1 -1
- package/dist/chunk-BAV5T2E3.cjs +1 -1
- package/dist/chunk-BYUT376O.cjs +1 -1
- package/dist/chunk-CKUEZF4R.cjs +1 -1
- package/dist/chunk-DPLL67OT.js +1 -1
- package/dist/chunk-DVMHRLKP.cjs +1 -1
- package/dist/chunk-EK7FSI7F.cjs +1 -1
- package/dist/chunk-F3WBQKRI.cjs +1 -1
- package/dist/chunk-FI76UZRF.js +1 -1
- package/dist/chunk-GAJBF6DR.js +1 -1
- package/dist/{chunk-K3SONK25.cjs → chunk-HKJZ7K2K.cjs} +165 -14
- package/dist/{chunk-QUITZ3GP.js → chunk-I3IXLEEG.js} +25 -9
- package/dist/{chunk-VNADVWSJ.js → chunk-JIROTDOU.js} +4 -2
- package/dist/chunk-JY4HLZ4W.js +1 -1
- package/dist/chunk-K63WO3XA.cjs +1 -1
- package/dist/chunk-KHO2SBNA.cjs +1 -1
- package/dist/chunk-KPCDDYTZ.js +1 -1
- package/dist/{chunk-XFTUHS4Y.js → chunk-KVZ3HL2B.js} +7 -5
- package/dist/chunk-L5RDAVVH.js +1 -1
- package/dist/chunk-LEX4TQW2.js +1 -1
- package/dist/chunk-LIU4S3JA.cjs +1 -1
- package/dist/{chunk-R3PBF6F7.cjs → chunk-LVFTN6DK.cjs} +29 -17
- package/dist/chunk-NREACG6M.cjs +1 -1
- package/dist/chunk-OFBFGFVH.js +1 -1
- package/dist/chunk-ONZFBJVW.js +1 -1
- package/dist/{chunk-D53CE4BT.js → chunk-P3ST4UZA.js} +6 -3
- package/dist/{chunk-WNO3EPYT.js → chunk-PW2VMJLT.js} +4 -2
- package/dist/chunk-PZQC3FZY.js +1 -1
- package/dist/chunk-QAPYHLHC.cjs +1 -1
- package/dist/chunk-QNKGP5DY.js +1 -1
- package/dist/{chunk-2CQI36UD.cjs → chunk-RJYWBVGD.cjs} +4 -2
- package/dist/{chunk-3LEWQV3R.js → chunk-RRJIRXHS.js} +5 -5
- package/dist/{chunk-BG3AS5BU.cjs → chunk-SGCN4ED4.cjs} +4 -2
- package/dist/chunk-SLP24LUV.js +302 -0
- package/dist/chunk-SZJ7OI4S.js +1 -1
- package/dist/chunk-TDYGYHSH.js +1 -1
- package/dist/chunk-TFDXRT6D.cjs +1 -1
- package/dist/chunk-U5VR4TJN.js +1 -1
- package/dist/chunk-UDA26MCU.cjs +1 -1
- package/dist/chunk-UKAUXY2U.cjs +1 -1
- package/dist/chunk-VCVND6CH.js +1 -1
- package/dist/chunk-VJDDGRIK.cjs +1 -1
- package/dist/chunk-VJVCXEH7.cjs +1 -1
- package/dist/chunk-WVSPXFTY.js +1 -1
- package/dist/chunk-YC7AK3KX.cjs +1 -1
- package/dist/chunk-YGB2BQPB.cjs +1 -1
- package/dist/chunk-YS27V6LS.js +1 -1
- package/dist/chunk-YWHHVDT4.js +1 -1
- package/dist/chunk-ZN53RM3R.js +1 -1
- package/dist/{chunk-KIYALQQF.cjs → chunk-ZW3VYES4.cjs} +5 -5
- package/dist/conversions/index.cjs +18 -18
- package/dist/conversions/index.d.ts +10 -12
- package/dist/conversions/index.js +3 -3
- package/dist/events/index.cjs +1 -1
- package/dist/events/index.d.ts +9 -9
- package/dist/events/index.js +1 -1
- package/dist/formatters/index.cjs +12 -12
- package/dist/formatters/index.d.ts +19 -24
- package/dist/formatters/index.js +2 -2
- package/dist/generators/index.cjs +10 -6
- package/dist/generators/index.d.ts +155 -26
- package/dist/generators/index.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/{isPlainObject-FWmcJF6k.d.ts → isPlainObject-BTPjv6zB.d.ts} +2 -2
- package/dist/next/index.cjs +11 -9
- package/dist/next/index.d.ts +11 -11
- package/dist/next/index.js +5 -3
- package/dist/next/server/index.cjs +1 -1
- package/dist/next/server/index.d.ts +4 -4
- package/dist/next/server/index.js +1 -1
- package/dist/operations/index.cjs +6 -6
- package/dist/operations/index.d.ts +8 -9
- package/dist/operations/index.js +3 -3
- package/dist/parsers/index.cjs +1 -1
- package/dist/parsers/index.d.ts +1 -1
- package/dist/parsers/index.js +1 -1
- package/dist/predicates/index.cjs +1 -1
- package/dist/predicates/index.d.ts +15 -28
- package/dist/predicates/index.js +1 -1
- package/dist/promises/index.cjs +4 -4
- package/dist/promises/index.d.ts +6 -7
- package/dist/promises/index.js +2 -2
- package/dist/rzl-utils.global.js +2 -2
- package/dist/strings/index.cjs +1 -1
- package/dist/strings/index.d.ts +1 -1
- package/dist/strings/index.js +1 -1
- package/dist/tailwind/index.cjs +10 -10
- package/dist/tailwind/index.d.ts +18 -18
- package/dist/tailwind/index.js +2 -2
- package/dist/urls/index.cjs +9 -9
- package/dist/urls/index.d.ts +9 -10
- package/dist/urls/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-ABA2ZSBQ.js +0 -152
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.8.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
|
-
import{NumberRangeUnion,Prettify,IsPositive,ParseNumber,Extends,IsStringLiteral,CharAt,AnyString,AnyFunction,IsEmptyString,Trim,IsAny,
|
|
10
|
+
import{NumberRangeUnion,Prettify,IsPositive,ParseNumber,Extends,IsStringLiteral,CharAt,AnyString,AnyFunction,IsEmptyString,Trim,IsAny,AnObjectNonArray,IsArray,OrArr,IsNever,TypedArray}from'@rzl-zone/ts-types-plus';import{a as IsPlainObjectResult,c as IsHasKeysObject}from'../isPlainObject-BTPjv6zB.js';export{G as GetPreciseTypeOptions,I as IsNumberOptions,g as getPreciseType,i as isNumber,b as isPlainObject}from'../isPlainObject-BTPjv6zB.js';
|
|
11
11
|
/** ----------------------------------------------------------
|
|
12
12
|
* * ***Predicate: `areArraysEqual`.***
|
|
13
13
|
* ----------------------------------------------------------
|
|
@@ -23,8 +23,7 @@ import{NumberRangeUnion,Prettify,IsPositive,ParseNumber,Extends,IsStringLiteral,
|
|
|
23
23
|
* - If `true`, will sort both arrays recursively before comparing, default is `false`.
|
|
24
24
|
* @returns {boolean}
|
|
25
25
|
* Returns `true` if both arrays are deeply equal, otherwise `false`.
|
|
26
|
-
* @throws {TypeError}
|
|
27
|
-
* Throws if `array1` or `array2` are not arrays, or if `ignoreOrder` is not a boolean.
|
|
26
|
+
* @throws **{@link TypeError | `TypeError`}** if `array1` or `array2` are not arrays, or if `ignoreOrder` is not a boolean.
|
|
28
27
|
* @example
|
|
29
28
|
* ```ts
|
|
30
29
|
* areArraysEqual([1, 2, 3], [1, 2, 3]);
|
|
@@ -578,8 +577,6 @@ declare function hasOwnProp<Obj>(obj:IsAny<Obj>extends true?Obj:never,key:Proper
|
|
|
578
577
|
* // ➔ false
|
|
579
578
|
*/
|
|
580
579
|
declare const isArguments:(value:unknown)=>value is IArguments;
|
|
581
|
-
/** @deprecated bugs */
|
|
582
|
-
type IsArrayResult<T>=IsUnknown<T>extends true?unknown[] & T:IsNever<T>extends true?[]:IsReadonlyArray<T>extends true?T:IsArray<T>extends true?T:unknown[];
|
|
583
580
|
/** ----------------------------------------------------------
|
|
584
581
|
* * ***Type guard: `isArray`.***
|
|
585
582
|
* ----------------------------------------------------------
|
|
@@ -642,7 +639,7 @@ declare function isArrayLike<T extends{__anyHack:unknown;}>(value:T):boolean;dec
|
|
|
642
639
|
/** ----------------------------------------------------
|
|
643
640
|
* * ***Type guard: `isArrayLikeObject`.***
|
|
644
641
|
* ----------------------------------------------------
|
|
645
|
-
* **This method is like
|
|
642
|
+
* **This method is like ***`isArrayLike` utility function*** except that
|
|
646
643
|
* it also checks if `value` is an object.**
|
|
647
644
|
* @template T - The type of the value being checked.
|
|
648
645
|
* @param {*} value The value to check.
|
|
@@ -731,7 +728,7 @@ declare const isBuffer:(value:unknown)=>value is Buffer;
|
|
|
731
728
|
* * ***Predicate: `isCurrencyLike`.***
|
|
732
729
|
* -----------------------------------------------------------
|
|
733
730
|
* **Determines if the given `input` can be interpreted as a currency-like number,
|
|
734
|
-
* using the same **multi-locale parsing logic** as
|
|
731
|
+
* using the same **multi-locale parsing logic** as ***`parseCurrencyString`***.**
|
|
735
732
|
* - **Highlights:**
|
|
736
733
|
* - *Supports strings or numbers like:*
|
|
737
734
|
* - `"15.000,10"` ***(European)***.
|
|
@@ -742,7 +739,7 @@ declare const isBuffer:(value:unknown)=>value is Buffer;
|
|
|
742
739
|
* - Also accepts simple numbers (`15300.95`).
|
|
743
740
|
* - **ℹ️ Note:**
|
|
744
741
|
* - Uses the same core logic as
|
|
745
|
-
*
|
|
742
|
+
* ***`parseCurrencyString`*** but
|
|
746
743
|
* just checks if a final parsed float is sensible.
|
|
747
744
|
* @param {*} input - The input value to check.
|
|
748
745
|
* @returns {boolean} Return `true` if it can be reasonably parsed into a currency-like number, `false` otherwise.
|
|
@@ -952,7 +949,7 @@ type List<T>=ArrayLike<T>;
|
|
|
952
949
|
* - **Functions** are considered empty if they have no own enumerable keys.
|
|
953
950
|
* - **ℹ️ Note:**
|
|
954
951
|
* - For more `Strict`, you can use
|
|
955
|
-
*
|
|
952
|
+
* ***`isEmptyValue` utility function*** instead.
|
|
956
953
|
* @template T - The type of the value being checked.
|
|
957
954
|
* @param {*} value The value to check.
|
|
958
955
|
* @returns {boolean} Returns `true` if `value` is empty, else `false`.
|
|
@@ -1267,7 +1264,7 @@ stack:unknown)=>boolean|undefined;
|
|
|
1267
1264
|
* **Performs a deep comparison between two values with support for a
|
|
1268
1265
|
* customizer function.**
|
|
1269
1266
|
* @description
|
|
1270
|
-
* This method is like
|
|
1267
|
+
* This method is like ***`isEqual` utility function*** except that it
|
|
1271
1268
|
* accepts a `customizer` which is invoked to compare values.
|
|
1272
1269
|
* - **Behavior:**
|
|
1273
1270
|
* - If `customizer` returns `undefined`, the comparison is handled by
|
|
@@ -1641,7 +1638,7 @@ declare function isNative(value:unknown):value is AnyFunction;
|
|
|
1641
1638
|
/** ----------------------------------------------------
|
|
1642
1639
|
* * ***Type guard: `isNil`.***
|
|
1643
1640
|
* ----------------------------------------------------------
|
|
1644
|
-
* **Checks if a value is `null` or `undefined
|
|
1641
|
+
* **Checks if a value is **[`null`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/null)** or **[`undefined`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined)**.**
|
|
1645
1642
|
* - **Behavior:**
|
|
1646
1643
|
* - Narrows type to `null` or `undefined` when true.
|
|
1647
1644
|
* @param {*} value - The value to check.
|
|
@@ -1686,7 +1683,7 @@ trim?:boolean;};
|
|
|
1686
1683
|
* @description
|
|
1687
1684
|
* Determines whether the given `value` is a string containing at least one non-whitespace character, with optional trimming behavior.
|
|
1688
1685
|
* - **Behavior:**
|
|
1689
|
-
* - Ensures the value is a string using
|
|
1686
|
+
* - Ensures the value is a string using ***`isString` utility function***.
|
|
1690
1687
|
* - Optionally trims whitespace before checking (`trim` defaults to `true`).
|
|
1691
1688
|
* - Narrows type to `string` when true.
|
|
1692
1689
|
* @param {*} value - The value to test.
|
|
@@ -1830,8 +1827,8 @@ declare function isNumberObject(value:unknown):value is Number;type IsObject<T>=
|
|
|
1830
1827
|
* - Boxed primitives: `new String()`, `new Number()`, `new Boolean()`
|
|
1831
1828
|
* - `undefined` (including `NaN`, which is a primitive number)
|
|
1832
1829
|
* - **ℹ️ Note:**
|
|
1833
|
-
* - If you specifically need to check for ***plain-objects*** only, use
|
|
1834
|
-
* - If you specifically need to check for ***object***, ***plain-objects***, and include ***array***, use
|
|
1830
|
+
* - If you specifically need to check for ***plain-objects*** only, use ***`isPlainObject` utility function*** instead.
|
|
1831
|
+
* - If you specifically need to check for ***object***, ***plain-objects***, and include ***array***, use ***`isObjectOrArray` utility function*** instead.
|
|
1835
1832
|
* @template T - The type of the value being checked.
|
|
1836
1833
|
* @param {*} value - The value to check.
|
|
1837
1834
|
* @returns {boolean} Returns `true` if the value is a ***plain-objects***, otherwise `false`.
|
|
@@ -1853,7 +1850,7 @@ declare function isObject<T extends object>(value:T):value is IsObject<T>;declar
|
|
|
1853
1850
|
* * ***Type guard: `isObjectLoose`.***
|
|
1854
1851
|
* ----------------------------------------------------------
|
|
1855
1852
|
* **Checks if a value is the
|
|
1856
|
-
* [ECMAScript language type
|
|
1853
|
+
* [ECMAScript language type ***Object***](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types).**
|
|
1857
1854
|
* - **✅ Returns `true` for:**
|
|
1858
1855
|
* - Plain objects (`{}`)
|
|
1859
1856
|
* - Arrays (`[]`)
|
|
@@ -1873,7 +1870,7 @@ declare function isObject<T extends object>(value:T):value is IsObject<T>;declar
|
|
|
1873
1870
|
* - `symbol`
|
|
1874
1871
|
* - `bigint`
|
|
1875
1872
|
* - **ℹ️ Note:**
|
|
1876
|
-
* - **For More Strict Object Use
|
|
1873
|
+
* - **For More Strict Object Use ***`isObject`*** or ***`isPlainObject` utility function*** instead.**
|
|
1877
1874
|
* @template T - The type of the value being checked.
|
|
1878
1875
|
* @param {*} value The value to check.
|
|
1879
1876
|
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
@@ -2239,34 +2236,24 @@ allowProtocol?:boolean;};
|
|
|
2239
2236
|
* @example
|
|
2240
2237
|
* isValidDomain("google.com");
|
|
2241
2238
|
* // ➔ true
|
|
2242
|
-
*
|
|
2243
2239
|
* isValidDomain("пример.рф", { allowUnicode: true });
|
|
2244
2240
|
* // ➔ true
|
|
2245
|
-
*
|
|
2246
2241
|
* isValidDomain("sub.example.com", { subdomain: false });
|
|
2247
2242
|
* // ➔ false
|
|
2248
|
-
*
|
|
2249
2243
|
* isValidDomain("*.example.com", { wildcard: true });
|
|
2250
2244
|
* // ➔ true
|
|
2251
|
-
*
|
|
2252
2245
|
* isValidDomain("com", { topLevel: true });
|
|
2253
2246
|
* // ➔ false (common TLD rejected because it's part of SLD)
|
|
2254
|
-
*
|
|
2255
2247
|
* isValidDomain("ai.", { topLevel: true });
|
|
2256
2248
|
* // ➔ true (country-code TLD accepted)
|
|
2257
|
-
*
|
|
2258
2249
|
* isValidDomain("localhost", { allowLocalhost: true });
|
|
2259
2250
|
* // ➔ true
|
|
2260
|
-
*
|
|
2261
2251
|
* isValidDomain("localhost:3000", { allowLocalhost: true, allowPort: true });
|
|
2262
2252
|
* // ➔ true
|
|
2263
|
-
*
|
|
2264
2253
|
* isValidDomain("example.com:8080", { allowPort: true });
|
|
2265
2254
|
* // ➔ true
|
|
2266
|
-
*
|
|
2267
2255
|
* isValidDomain("https://example.com/foo/bar", { allowProtocol: true });
|
|
2268
2256
|
* // ➔ true (protocol stripped and hostname validated)
|
|
2269
|
-
*
|
|
2270
2257
|
* isValidDomain("invalid_domain.com");
|
|
2271
2258
|
* // ➔ false
|
|
2272
2259
|
*/
|
|
@@ -2309,4 +2296,4 @@ declare const isValidURL:(url:unknown)=>boolean;
|
|
|
2309
2296
|
* isWeakMap(new Map);
|
|
2310
2297
|
* // ➔ false
|
|
2311
2298
|
*/
|
|
2312
|
-
declare function isWeakMap<K extends object=object,V=unknown>(value:unknown):value is WeakMap<K,V>;export{
|
|
2299
|
+
declare function isWeakMap<K extends object=object,V=unknown>(value:unknown):value is WeakMap<K,V>;export{IsPlainObjectResult,areArraysEqual,areObjectsEqual,areURLsEqualPath,areURLsIdentical,arrayHasAnyMatch,doesKeyExist,hasOwnProp,isArguments,isArray,isArrayBuffer,isArrayLike,isArrayLikeObject,isBigInt,isBoolean,isBooleanObject,isBuffer,isCurrencyLike,isDate,isDeepEqual,isElement,isEmpty,isEmptyArray,isEmptyDeep,isEmptyObject,isEmptyString,isEmptyValue,isEqual,isEqualWith,isError,isFinite,isFunction,isInfinityNumber,isInteger,isLength,isMap,isMatch,isMatchWith,isNaN,isNative,isNil,isNonEmptyArray,isNonEmptyString,isNonEmptyValue,isNull,isNumberObject,isObject,isObjectLoose,isObjectOrArray,isPropertyKey,isRegExp,isSafeInteger,isServer,isSet,isString,isStringObject,isSymbol,isTypedArray,isURL,isUndefined,isValidDomain,isValidURL,isWeakMap,textContainsAll,textContainsAny};
|
package/dist/predicates/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.8.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
package/dist/promises/index.cjs
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.8.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var chunkRJYWBVGD_cjs = require('../chunk-RJYWBVGD.cjs');
|
|
13
13
|
require('../chunk-DVMHRLKP.cjs');
|
|
14
14
|
require('../chunk-YC7AK3KX.cjs');
|
|
15
15
|
require('../chunk-UDA26MCU.cjs');
|
|
@@ -17,9 +17,9 @@ require('../chunk-F3WBQKRI.cjs');
|
|
|
17
17
|
|
|
18
18
|
Object.defineProperty(exports, "CustomPromise", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkRJYWBVGD_cjs.CustomPromise; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "delay", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkRJYWBVGD_cjs.delay; }
|
|
25
25
|
});
|
package/dist/promises/index.d.ts
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.8.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
|
-
import{CustomPromiseType}from'@rzl-zone/ts-types-plus';
|
|
10
|
+
import{CustomPromiseType}from'@rzl-zone/ts-types-plus';export{CustomPromiseType}from'@rzl-zone/ts-types-plus';
|
|
11
11
|
/** -------------------------------------------------------------
|
|
12
12
|
* * ***Utility Class: `CustomPromise`.***
|
|
13
13
|
* -------------------------------------------------------------
|
|
@@ -30,8 +30,8 @@ import{CustomPromiseType}from'@rzl-zone/ts-types-plus';
|
|
|
30
30
|
* @template Error Type of the rejection reason (default `unknown`).
|
|
31
31
|
* @example
|
|
32
32
|
* ```ts
|
|
33
|
-
* import type { CustomPromiseType } from "@rzl-zone/types";
|
|
34
|
-
* import { CustomPromise } from "@rzl-zone/promises";
|
|
33
|
+
* import type { CustomPromiseType } from "@rzl-zone/ts-types-plus";
|
|
34
|
+
* import { CustomPromise } from "@rzl-zone/utils-js/promises";
|
|
35
35
|
*
|
|
36
36
|
* type User = { id: number; name: string };
|
|
37
37
|
* type ApiError = { message: string };
|
|
@@ -99,11 +99,10 @@ finish(cb:(val?:Success,err?:Error)=>void):this;}
|
|
|
99
99
|
* @returns {Promise<void>}
|
|
100
100
|
* A promise that resolves after the specified delay or
|
|
101
101
|
* rejects with an `AbortError` if aborted.
|
|
102
|
-
* @throws {TypeError}
|
|
102
|
+
* @throws **{@link TypeError | `TypeError`}** while validates `milliSeconds` and `signal`:
|
|
103
103
|
* - If `milliSeconds` **is not a valid** an `integer-number`, `NaN`, `negative-number`, or `≤ 0`.
|
|
104
104
|
* - If `signal` **is not a valid** an`AbortSignal`.
|
|
105
|
-
* @throws {DOMException}
|
|
106
|
-
* If the delay is aborted using the signal, rejects with `"AbortError"`.
|
|
105
|
+
* @throws **{@link DOMException | `DOMException`}** if the delay is aborted using the signal, rejects with `AbortError`.
|
|
107
106
|
* @example
|
|
108
107
|
* // Waits for 2 seconds
|
|
109
108
|
* await delay(2000);
|
package/dist/promises/index.js
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* ====================================================
|
|
3
3
|
* Rzl Utils-JS.
|
|
4
4
|
* ----------------------------------------------------
|
|
5
|
-
* Version: 3.
|
|
5
|
+
* Version: 3.8.0.
|
|
6
6
|
* Author: Rizalvin Dwiky.
|
|
7
7
|
* Repository: https://github.com/rzl-zone/utils-js.
|
|
8
8
|
* ====================================================
|
|
9
9
|
*/
|
|
10
|
-
export { CustomPromise, delay } from '../chunk-
|
|
10
|
+
export { CustomPromise, delay } from '../chunk-JIROTDOU.js';
|
|
11
11
|
import '../chunk-WVSPXFTY.js';
|
|
12
12
|
import '../chunk-2VO2CBTU.js';
|
|
13
13
|
import '../chunk-QNKGP5DY.js';
|