@rzl-zone/utils-js 0.0.1 → 2.0.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/dist/index.cjs +1 -1
- package/dist/index.d.ts +24 -20
- package/dist/index.js +1 -1
- package/dist/next/index.cjs +1 -1
- package/dist/next/index.js +1 -1
- package/dist/next/server/index.cjs +1 -1
- package/dist/next/server/index.js +1 -1
- package/dist/rzl-utils.global.js +1 -1
- package/dist/types/index.d.ts +73 -2
- package/package.json +28 -28
package/dist/types/index.d.ts
CHANGED
|
@@ -2017,7 +2017,78 @@ type ChangeTypeOfValuesArray<Arr,Target,NewType>=Arr extends object ?{[K in keyo
|
|
|
2017
2017
|
* const fn: AnyFunction = (a, b) => a + b;
|
|
2018
2018
|
* console.log(fn(1, 2)); // 3
|
|
2019
2019
|
*/
|
|
2020
|
-
type AnyFunction=(...args:any[])=>any;
|
|
2020
|
+
type AnyFunction=(...args:any[])=>any;
|
|
2021
|
+
/** --------------------------------------------------
|
|
2022
|
+
* * ***Represents all JavaScript TypedArray types used for binary data manipulation.***
|
|
2023
|
+
* --------------------------------------------------
|
|
2024
|
+
*
|
|
2025
|
+
* Includes all standard built-in typed arrays like:
|
|
2026
|
+
* - `Int8Array`
|
|
2027
|
+
* - `Uint8Array`
|
|
2028
|
+
* - `Uint8ClampedArray`
|
|
2029
|
+
* - `Int16Array`
|
|
2030
|
+
* - `Uint16Array`
|
|
2031
|
+
* - `Int32Array`
|
|
2032
|
+
* - `Uint32Array`
|
|
2033
|
+
* - `Float32Array`
|
|
2034
|
+
* - `Float64Array`
|
|
2035
|
+
* - `BigInt64Array`
|
|
2036
|
+
* - `BigUint64Array`
|
|
2037
|
+
*/
|
|
2038
|
+
type TypedArray=Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
|
|
2039
|
+
/** --------------------------------------------------
|
|
2040
|
+
* * ***Represents common Web API object types available in the browser environment.***
|
|
2041
|
+
* --------------------------------------------------
|
|
2042
|
+
*
|
|
2043
|
+
* Includes:
|
|
2044
|
+
* - URL handling: `URL`, `URLSearchParams`
|
|
2045
|
+
* - Networking: `Request`, `Response`, `Headers`, `WebSocket`
|
|
2046
|
+
* - Streams: `ReadableStream`, `WritableStream`, `TransformStream`
|
|
2047
|
+
* - Events and messaging: `Event`, `CustomEvent`, `MessageChannel`, `MessagePort`, `MessageEvent`
|
|
2048
|
+
* - DOM-related: `HTMLElement`, `Node`, `Document`, `Window`, `CanvasRenderingContext2D`
|
|
2049
|
+
* - Encoding and decoding: `TextEncoder`, `TextDecoder`
|
|
2050
|
+
* - File-related: `File`, `FileList`, `ImageBitmap`, `FormData`
|
|
2051
|
+
* - Abort handling: `AbortController`, `AbortSignal`
|
|
2052
|
+
* - Cryptography: `CryptoKey`
|
|
2053
|
+
*/
|
|
2054
|
+
type WebApiObjects=URL | URLSearchParams | FormData | Headers | Response | Request | ReadableStream<any>| WritableStream<any>| TransformStream<any,any>| MessageChannel | MessagePort | MessageEvent | Event | CustomEvent | HTMLElement | Node | Document | Window | AbortController | AbortSignal | TextEncoder | TextDecoder | CryptoKey | File | FileList | ImageBitmap | CanvasRenderingContext2D | WebSocket;
|
|
2055
|
+
/** --------------------------------------------------
|
|
2056
|
+
* * ***Represents all ECMAScript Internationalization API objects from the `Intl` namespace.***
|
|
2057
|
+
* --------------------------------------------------
|
|
2058
|
+
*
|
|
2059
|
+
* Includes:
|
|
2060
|
+
* - `Intl.Collator`
|
|
2061
|
+
* - `Intl.DateTimeFormat`
|
|
2062
|
+
* - `Intl.NumberFormat`
|
|
2063
|
+
* - `Intl.RelativeTimeFormat`
|
|
2064
|
+
* - `Intl.PluralRules`
|
|
2065
|
+
* - `Intl.ListFormat`
|
|
2066
|
+
* - `Intl.Locale`
|
|
2067
|
+
*/
|
|
2068
|
+
type IntlObjects=Intl.Collator | Intl.DateTimeFormat | Intl.NumberFormat | Intl.RelativeTimeFormat | Intl.PluralRules | Intl.ListFormat | Intl.Locale;
|
|
2069
|
+
/** --------------------------------------------------
|
|
2070
|
+
* * ***Represents Node.js built-in core objects.***
|
|
2071
|
+
* --------------------------------------------------
|
|
2072
|
+
*
|
|
2073
|
+
* Currently includes:
|
|
2074
|
+
* - `Buffer`
|
|
2075
|
+
*/
|
|
2076
|
+
type NodeBuiltins=Buffer;
|
|
2077
|
+
/** --------------------------------------------------
|
|
2078
|
+
* * ***Represents all known non-plain object types that are excluded
|
|
2079
|
+
* from being considered as a "plain object" (i.e., `{ [key: string]: any }`).***
|
|
2080
|
+
* --------------------------------------------------
|
|
2081
|
+
*
|
|
2082
|
+
* Includes:
|
|
2083
|
+
* - Functions
|
|
2084
|
+
* - Arrays
|
|
2085
|
+
* - Native objects like: `Date`, `RegExp`, `Map`, `Set`, `WeakMap`, `WeakSet`
|
|
2086
|
+
* - Built-in classes and browser APIs: `Promise`, `Error`, `ArrayBuffer`, `DataView`
|
|
2087
|
+
* - `TypedArray`, `WebApiObjects`, `IntlObjects`, and `NodeBuiltins`
|
|
2088
|
+
* - Symbols
|
|
2089
|
+
* - Proxies and the `Reflect` object
|
|
2090
|
+
*/
|
|
2091
|
+
type NonPlainObject=AnyFunction | Array<any>| Date | RegExp | Map<any,any>| Set<any>| WeakMap<any,any>| WeakSet<any>| Error | Promise<any>| ArrayBuffer | DataView | TypedArray | WebApiObjects | IntlObjects | NodeBuiltins | symbol |{[Symbol.toStringTag]:"Proxy";}| typeof Reflect;type Enumerate<N extends number,Acc extends number[]=[]>=Acc["length"] extends N ? Acc[number]:Enumerate<N,[...Acc,Acc["length"]]>;
|
|
2021
2092
|
/** --------------------------------------------------
|
|
2022
2093
|
* * ***Generate a union type of numbers within a specific range from `1` to `999`.***
|
|
2023
2094
|
* --------------------------------------------------
|
|
@@ -2054,4 +2125,4 @@ type RangeNumberTo999<From extends number,To extends number>=From extends To ? F
|
|
|
2054
2125
|
* // => 5 | 6 | 7 | 8
|
|
2055
2126
|
* ```
|
|
2056
2127
|
*/
|
|
2057
|
-
type RangeNumberLimit<From extends number,To extends number,Result extends number[]=[From]>=IsGreaterThan<From,To>extends true ? [...Result,To][number] extends infer R extends number ? R extends R ? IsGreaterThan<R,To>extends true ? never:R:never:never:RangeNumberLimit<Sum<From,7>,To,[...Result,From,Sum<From,1>,Sum<From,2>,Sum<From,3>,Sum<From,4>,Sum<From,5>,Sum<From,6>]>;export type{Abs,And,AndArr,AnifyProperties,AnifyPropertiesOptions,AnyFunction,AreAnagrams,ArgumentTypes,ArrayElementType,Ceil,ChangeTypeOfValuesArray,Color,ColorCssValidBase,ColorOptions,CompareNumberLength,CompareStringLength,Concat,CustomPromise,DataTypes,Decrement,DefaultColorOptions,DefaultHSLOptions,DefaultRGBOptions,DigitsTuple,Div,Dot,EmptyArray,EmptyString,EndsWith,Even,ExcludeStrict,Extends,ExtendsArr,Factorial,Fibonacci,FirstCharacter,FirstCharacterOptions,FirstDigit,Float,Floor,GetArrayElementType,GetFloatNumberParts,HEX,HSL,HSLOptions,Identity,If,IfAny,IfColor,IfEmptyArray,IfEmptyString,IfEqual,IfEven,IfExtends,IfFloat,IfGreaterOrEqual,IfGreaterThan,IfHEX,IfHSL,IfInteger,IfLowerThan,IfNegative,IfNegativeFloat,IfNegativeInteger,IfNever,IfNonEmptyArray,IfNonEmptyString,IfNot,IfNotEqual,IfNotExtends,IfOdd,IfPositive,IfPositiveFloat,IfPositiveInteger,IfRGB,IfUnknown,Includes,Increment,IndexOf,Integer,IsAny,IsArray,IsArrayIndex,IsBetween,IsColor,IsDivisible,IsDivisibleByFive,IsDivisibleByHundred,IsDivisibleBySix,IsDivisibleByTen,IsDivisibleByThree,IsDivisibleByTwo,IsEmptyArray,IsEmptyString,IsEqual,IsEven,IsFloat,IsGreaterOrEqual,IsGreaterThan,IsHEX,IsHSL,IsInteger,IsLetter,IsLongerNumber,IsLongerString,IsLowerThan,IsMutableArray,IsNegative,IsNegativeFloat,IsNegativeInteger,IsNever,IsNonEmptyArray,IsNonEmptyString,IsNotEqual,IsOdd,IsPalindrome,IsPositive,IsPositiveFloat,IsPositiveInteger,IsRGB,IsReadonlyArray,IsSameLengthNumber,IsSameLengthString,IsShorterNumber,IsShorterString,IsStringLiteral,IsTuple,IsUnion,IsUnknown,Join,LastCharacter,LastCharacterOptions,Max,MaxArr,Min,MinArr,Mod,Mult,Mutable,MutableExcept,MutableOnly,Negate,Negative,NegativeFloat,NegativeInteger,NeverifyProperties,NeverifyPropertiesOptions,NonEmptyArray,NonEmptyString,NonNullableObject,NonNullableObjectExcept,NonNullableObjectOnly,Not,NotExtends,NumberLength,ObjArrayKeyStringAny,Odd,OmitStrict,Or,OrArr,OverrideTypes,ParseNumber,PartialExcept,PartialKeys,PartialOnly,PathToFields,PathToFieldsOptions,PickStrict,Pop,PopOptions,Positive,PositiveFloat,PositiveInteger,Pow,Prettify,PrettifyOld,PrettifyOptions,Push,RGB,RGBOptions,RangeNumberLimit,RangeNumberTo999,ReadonlyExcept,ReadonlyOnly,RemoveIndexSignature,RemoveLeading,Repeat,Replace,ReplaceAll,ReplaceAllOld,ReplacingToPartial,ReplacingToRequired,RequiredExcept,RequiredKeys,RequiredOnly,ReturnItselfIfExtends,ReturnItselfIfNotExtends,Reverse,Round,Shift,ShiftOptions,Slice,Sort,Split,StartsWith,StringLength,Stringify,Sub,Sum,SumArr,Swap,Switch,ToPrimitive,Trim,TrimLeft,TrimRight,TrimsLower,Trunc,TupleToObject,UnionToIntersection,UnknownifyProperties,UnknownifyPropertiesOptions,Unshift,ValueOf,ValueOfArray,ValueOfExcept,ValueOfOnly,Whitespace};
|
|
2128
|
+
type RangeNumberLimit<From extends number,To extends number,Result extends number[]=[From]>=IsGreaterThan<From,To>extends true ? [...Result,To][number] extends infer R extends number ? R extends R ? IsGreaterThan<R,To>extends true ? never:R:never:never:RangeNumberLimit<Sum<From,7>,To,[...Result,From,Sum<From,1>,Sum<From,2>,Sum<From,3>,Sum<From,4>,Sum<From,5>,Sum<From,6>]>;export type{Abs,And,AndArr,AnifyProperties,AnifyPropertiesOptions,AnyFunction,AreAnagrams,ArgumentTypes,ArrayElementType,Ceil,ChangeTypeOfValuesArray,Color,ColorCssValidBase,ColorOptions,CompareNumberLength,CompareStringLength,Concat,CustomPromise,DataTypes,Decrement,DefaultColorOptions,DefaultHSLOptions,DefaultRGBOptions,DigitsTuple,Div,Dot,EmptyArray,EmptyString,EndsWith,Even,ExcludeStrict,Extends,ExtendsArr,Factorial,Fibonacci,FirstCharacter,FirstCharacterOptions,FirstDigit,Float,Floor,GetArrayElementType,GetFloatNumberParts,HEX,HSL,HSLOptions,Identity,If,IfAny,IfColor,IfEmptyArray,IfEmptyString,IfEqual,IfEven,IfExtends,IfFloat,IfGreaterOrEqual,IfGreaterThan,IfHEX,IfHSL,IfInteger,IfLowerThan,IfNegative,IfNegativeFloat,IfNegativeInteger,IfNever,IfNonEmptyArray,IfNonEmptyString,IfNot,IfNotEqual,IfNotExtends,IfOdd,IfPositive,IfPositiveFloat,IfPositiveInteger,IfRGB,IfUnknown,Includes,Increment,IndexOf,Integer,IntlObjects,IsAny,IsArray,IsArrayIndex,IsBetween,IsColor,IsDivisible,IsDivisibleByFive,IsDivisibleByHundred,IsDivisibleBySix,IsDivisibleByTen,IsDivisibleByThree,IsDivisibleByTwo,IsEmptyArray,IsEmptyString,IsEqual,IsEven,IsFloat,IsGreaterOrEqual,IsGreaterThan,IsHEX,IsHSL,IsInteger,IsLetter,IsLongerNumber,IsLongerString,IsLowerThan,IsMutableArray,IsNegative,IsNegativeFloat,IsNegativeInteger,IsNever,IsNonEmptyArray,IsNonEmptyString,IsNotEqual,IsOdd,IsPalindrome,IsPositive,IsPositiveFloat,IsPositiveInteger,IsRGB,IsReadonlyArray,IsSameLengthNumber,IsSameLengthString,IsShorterNumber,IsShorterString,IsStringLiteral,IsTuple,IsUnion,IsUnknown,Join,LastCharacter,LastCharacterOptions,Max,MaxArr,Min,MinArr,Mod,Mult,Mutable,MutableExcept,MutableOnly,Negate,Negative,NegativeFloat,NegativeInteger,NeverifyProperties,NeverifyPropertiesOptions,NodeBuiltins,NonEmptyArray,NonEmptyString,NonNullableObject,NonNullableObjectExcept,NonNullableObjectOnly,NonPlainObject,Not,NotExtends,NumberLength,ObjArrayKeyStringAny,Odd,OmitStrict,Or,OrArr,OverrideTypes,ParseNumber,PartialExcept,PartialKeys,PartialOnly,PathToFields,PathToFieldsOptions,PickStrict,Pop,PopOptions,Positive,PositiveFloat,PositiveInteger,Pow,Prettify,PrettifyOld,PrettifyOptions,Push,RGB,RGBOptions,RangeNumberLimit,RangeNumberTo999,ReadonlyExcept,ReadonlyOnly,RemoveIndexSignature,RemoveLeading,Repeat,Replace,ReplaceAll,ReplaceAllOld,ReplacingToPartial,ReplacingToRequired,RequiredExcept,RequiredKeys,RequiredOnly,ReturnItselfIfExtends,ReturnItselfIfNotExtends,Reverse,Round,Shift,ShiftOptions,Slice,Sort,Split,StartsWith,StringLength,Stringify,Sub,Sum,SumArr,Swap,Switch,ToPrimitive,Trim,TrimLeft,TrimRight,TrimsLower,Trunc,TupleToObject,TypedArray,UnionToIntersection,UnknownifyProperties,UnknownifyPropertiesOptions,Unshift,ValueOf,ValueOfArray,ValueOfExcept,ValueOfOnly,WebApiObjects,Whitespace};
|
package/package.json
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
{
|
|
2
|
+
"name": "@rzl-zone/utils-js",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"sideEffects": false,
|
|
6
|
+
"engineStrict": true,
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"main": "./dist/index.cjs",
|
|
10
|
+
"module": "./dist/index.js",
|
|
11
|
+
"unpkg": "./dist/rzl-utils.global.js",
|
|
12
|
+
"jsdelivr": "./dist/rzl-utils.global.js",
|
|
13
|
+
"author": "Rizalvin Dwiky <rizalvindwiky1998@gmail.com>",
|
|
14
|
+
"homepage": "https://github.com/rzl-zone/utils-js#readme",
|
|
15
|
+
"description": "A modern, lightweight set of JavaScript utility functions for everyday development, crafted to enhance code readability and maintainability.",
|
|
2
16
|
"contributors": [
|
|
3
17
|
"Rizalvin Dwiky <rizalvindwiky1998@gmail.com>"
|
|
4
18
|
],
|
|
5
19
|
"bugs": {
|
|
6
20
|
"url": "https://github.com/rzl-zone/utils-js/issues"
|
|
7
21
|
},
|
|
8
|
-
"author": "Rizalvin Dwiky <rizalvindwiky1998@gmail.com>",
|
|
9
22
|
"dependencies": {
|
|
10
23
|
"date-fns": "^4.1.0",
|
|
11
24
|
"server-only": "^0.0.1"
|
|
12
25
|
},
|
|
13
|
-
"description": "A modern, lightweight set of JavaScript utility functions for everyday development, crafted to enhance code readability and maintainability.",
|
|
14
26
|
"devDependencies": {
|
|
15
27
|
"@eslint/js": "^9.31.0",
|
|
16
28
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
@@ -36,7 +48,6 @@
|
|
|
36
48
|
"typescript-eslint": "^8.37.0",
|
|
37
49
|
"vitest": "^3.2.4"
|
|
38
50
|
},
|
|
39
|
-
"engineStrict": true,
|
|
40
51
|
"engines": {
|
|
41
52
|
"node": ">=16"
|
|
42
53
|
},
|
|
@@ -75,13 +86,24 @@
|
|
|
75
86
|
"types": "./dist/types/index.d.ts"
|
|
76
87
|
}
|
|
77
88
|
},
|
|
89
|
+
"typesVersions": {
|
|
90
|
+
"*": {
|
|
91
|
+
"next": [
|
|
92
|
+
"dist/next/index.d.ts"
|
|
93
|
+
],
|
|
94
|
+
"next/server": [
|
|
95
|
+
"dist/next/server/index.d.ts"
|
|
96
|
+
],
|
|
97
|
+
"types": [
|
|
98
|
+
"dist/types/index.d.ts"
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
},
|
|
78
102
|
"files": [
|
|
79
103
|
"dist",
|
|
80
104
|
"README.md",
|
|
81
105
|
"LICENSE.md"
|
|
82
106
|
],
|
|
83
|
-
"homepage": "https://github.com/rzl-zone/utils-js#readme",
|
|
84
|
-
"jsdelivr": "./dist/rzl-utils.global.js",
|
|
85
107
|
"keywords": [
|
|
86
108
|
"javascript",
|
|
87
109
|
"typescript",
|
|
@@ -97,10 +119,6 @@
|
|
|
97
119
|
"helper",
|
|
98
120
|
"functions"
|
|
99
121
|
],
|
|
100
|
-
"license": "MIT",
|
|
101
|
-
"main": "./dist/index.cjs",
|
|
102
|
-
"module": "./dist/index.js",
|
|
103
|
-
"name": "@rzl-zone/utils-js",
|
|
104
122
|
"publishConfig": {
|
|
105
123
|
"access": "public"
|
|
106
124
|
},
|
|
@@ -126,23 +144,5 @@
|
|
|
126
144
|
"postbuild": "del-cli \"dist/**/*.d.cts\"",
|
|
127
145
|
"prepare": "npm run build",
|
|
128
146
|
"release-patch": "npm version patch && git push && git push --tags && npm publish"
|
|
129
|
-
}
|
|
130
|
-
"sideEffects": false,
|
|
131
|
-
"type": "module",
|
|
132
|
-
"types": "./dist/index.d.ts",
|
|
133
|
-
"typesVersions": {
|
|
134
|
-
"*": {
|
|
135
|
-
"next": [
|
|
136
|
-
"dist/next/index.d.ts"
|
|
137
|
-
],
|
|
138
|
-
"next/server": [
|
|
139
|
-
"dist/next/server/index.d.ts"
|
|
140
|
-
],
|
|
141
|
-
"types": [
|
|
142
|
-
"dist/types/index.d.ts"
|
|
143
|
-
]
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
"unpkg": "./dist/rzl-utils.global.js",
|
|
147
|
-
"version": "0.0.1"
|
|
147
|
+
}
|
|
148
148
|
}
|