@agogte/utilynx 1.0.7 → 1.0.8
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 +57 -170
- package/dist/collection.d.ts +31 -0
- package/dist/math.d.ts +20 -0
- package/dist-obf/collection.js +1 -1
- package/dist-obf/datetime.js +1 -1
- package/dist-obf/extensions.js +1 -1
- package/dist-obf/index.js +1 -1
- package/dist-obf/math.js +1 -1
- package/dist-obf/string.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,206 +1,93 @@
|
|
1
|
-
# utilynx
|
1
|
+
# 🌟 utilynx
|
2
2
|
|
3
|
-
High-level utility functions for working with arrays, math, strings, and more — bringing expressive language features to JavaScript and TypeScript.
|
3
|
+
High-level utility functions for working with arrays, math, strings, and more — bringing expressive language features to JavaScript and TypeScript.
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
```bash
|
8
|
-
npm install utilynx
|
9
|
-
```
|
10
|
-
|
11
|
-
## Usage
|
12
|
-
|
13
|
-
Import the package in your TypeScript or JavaScript project:
|
14
|
-
|
15
|
-
```typescript
|
16
|
-
import * as utilynx from 'utilynx';
|
17
|
-
// or import specific utilities:
|
18
|
-
import { groupBy, round } from 'utilynx';
|
19
|
-
```
|
20
|
-
|
21
|
-
Some utilities extend built-in prototypes (like `Number`, `Array`, `String`, `Object`, and `Date`).
|
22
|
-
To use these, simply import the package once at the top of your entry file:
|
23
|
-
|
24
|
-
```typescript
|
25
|
-
import 'utilynx';
|
26
|
-
```
|
5
|
+
This project extends the native JavaScript/TypeScript objects (`Array`, `Date`, `Number`, `Object`, and `String`) with powerful utility methods to simplify common programming patterns. Inspired by LINQ (C#) and modern functional programming, these extensions make your code more expressive, readable, and efficient.
|
27
6
|
|
28
7
|
---
|
29
8
|
|
30
|
-
##
|
31
|
-
|
32
|
-
### Math Utilities (`math.ts`)
|
33
|
-
|
34
|
-
These methods extend the `Number` prototype.
|
35
|
-
**Import the package once to enable them:**
|
36
|
-
|
37
|
-
```typescript
|
38
|
-
import 'utilynx';
|
9
|
+
## 📦 Installation
|
39
10
|
|
40
|
-
|
11
|
+
Simply include the module in your TypeScript project:
|
41
12
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
(4).isEven(); // true
|
46
|
-
(5).isOdd(); // true
|
13
|
+
```ts
|
14
|
+
import '@agogte/utilynx';
|
47
15
|
```
|
48
16
|
|
49
|
-
|
50
|
-
Returns the square root of the number.
|
51
|
-
|
52
|
-
#### `Number.prototype.round(precision?: number): number`
|
53
|
-
Rounds the number to a specified number of decimal places.
|
54
|
-
|
55
|
-
#### `Number.prototype.isEven(): boolean`
|
56
|
-
Checks if the number is even.
|
57
|
-
|
58
|
-
#### `Number.prototype.isOdd(): boolean`
|
59
|
-
Checks if the number is odd.
|
60
|
-
|
61
|
-
---
|
62
|
-
|
63
|
-
### Collection Utilities (`collection.ts`)
|
64
|
-
|
65
|
-
These methods extend the `Array` prototype.
|
66
|
-
**Import the package once to enable them:**
|
67
|
-
|
68
|
-
```typescript
|
69
|
-
import 'utilynx';
|
70
|
-
|
71
|
-
[1, 2, 3].firstOrDefault(); // 1
|
72
|
-
[1, 2, 3].firstOrDefault(x => x > 1); // 2
|
73
|
-
|
74
|
-
const grouped = [
|
75
|
-
{ type: 'fruit', name: 'apple' },
|
76
|
-
{ type: 'vegetable', name: 'carrot' },
|
77
|
-
{ type: 'fruit', name: 'banana' }
|
78
|
-
].groupBy(item => item.type);
|
79
|
-
// grouped = { fruit: [...], vegetable: [...] }
|
80
|
-
|
81
|
-
[1, 2, 3].sum(); // 6
|
82
|
-
[2, 4, 6].average(); // 4
|
83
|
-
```
|
17
|
+
Or if you've bundled it as a package:
|
84
18
|
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
#### `Array.prototype.groupBy(keySelector: (item: T) => K): Record<K, T[]>`
|
89
|
-
Groups array elements by a key.
|
90
|
-
|
91
|
-
#### `Array.prototype.sum(): number | undefined`
|
92
|
-
Returns the sum of an array of numbers, or `undefined` if the array is empty.
|
93
|
-
|
94
|
-
#### `Array.prototype.average(): number | undefined`
|
95
|
-
Returns the average of an array of numbers, or `undefined` if the array is empty.
|
96
|
-
|
97
|
-
---
|
98
|
-
|
99
|
-
### String Utilities (`string.ts`)
|
100
|
-
|
101
|
-
These methods extend the `String` prototype.
|
102
|
-
**Import the package once to enable them:**
|
103
|
-
|
104
|
-
```typescript
|
105
|
-
import 'utilynx';
|
106
|
-
|
107
|
-
''.isNullOrEmpty(); // true
|
108
|
-
'abc'.isNullOrEmpty(); // false
|
109
|
-
|
110
|
-
'abc'.padLeft(5, '0'); // '00abc'
|
111
|
-
'abc'.padRight(5, '0'); // 'abc00'
|
19
|
+
```bash
|
20
|
+
npm install @agogte/utilynx
|
112
21
|
```
|
113
22
|
|
114
|
-
#### `String.prototype.isNullOrEmpty(): boolean`
|
115
|
-
Checks if a string is empty.
|
116
|
-
|
117
|
-
#### `String.prototype.padLeft(totalLength: number, padChar: string): string`
|
118
|
-
Pads the string on the left to the specified length.
|
119
|
-
|
120
|
-
#### `String.prototype.padRight(totalLength: number, padChar: string): string`
|
121
|
-
Pads the string on the right to the specified length.
|
122
|
-
|
123
23
|
---
|
124
24
|
|
125
|
-
|
126
|
-
|
127
|
-
These methods extend the `Date` prototype.
|
128
|
-
**Import the package once to enable them:**
|
129
|
-
|
130
|
-
```typescript
|
131
|
-
import 'utilynx';
|
25
|
+
## 🔧 Extended Interfaces
|
132
26
|
|
133
|
-
|
134
|
-
d.addDays(1); // 2020-01-02
|
27
|
+
### 🧩 `Array<T>` Extensions
|
135
28
|
|
136
|
-
|
29
|
+
| Method | Description |
|
30
|
+
|--------|-------------|
|
31
|
+
| `firstOrDefault(predicate?)` | Returns the first element that matches the predicate, or `undefined` if none found. |
|
32
|
+
| `groupBy(keySelector)` | Groups elements by the result of `keySelector`, returns a dictionary of arrays. |
|
33
|
+
| `sum()` | Returns the sum of numeric values in the array. |
|
34
|
+
| `average()` | Returns the average of numeric values in the array. |
|
137
35
|
|
138
|
-
|
36
|
+
### 🗓️ `Date` Extensions
|
139
37
|
|
140
|
-
|
141
|
-
|
142
|
-
|
38
|
+
| Method | Description |
|
39
|
+
|--------|-------------|
|
40
|
+
| `addDays(days)` | Returns a new `Date` with the specified number of days added. |
|
41
|
+
| `addHours(hours)` | Returns a new `Date` with the specified number of hours added. |
|
42
|
+
| `addMinutes(minutes)` | Returns a new `Date` with the specified number of minutes added. |
|
43
|
+
| `isWeekend()` | Returns `true` if the date falls on a weekend. |
|
44
|
+
| `toShortDateString()` | Returns a string in `YYYY-MM-DD` format. |
|
45
|
+
| `diffDays(otherDate)` | Returns the number of full days between two dates. |
|
143
46
|
|
144
|
-
|
145
|
-
new Date('2020-01-01T00:00:00Z').addMinutes(30); // 2020-01-01T00:30:00Z
|
146
|
-
```
|
147
|
-
|
148
|
-
#### `Date.prototype.addDays(days: number): Date`
|
149
|
-
Returns a new `Date` with the specified number of days added.
|
47
|
+
### 🔢 `Number` Extensions
|
150
48
|
|
151
|
-
|
152
|
-
|
49
|
+
| Method | Description |
|
50
|
+
|--------|-------------|
|
51
|
+
| `isEven()` | Returns `true` if the number is even. |
|
52
|
+
| `isOdd()` | Returns `true` if the number is odd. |
|
53
|
+
| `sqrt()` | Returns the square root of the number. |
|
54
|
+
| `round(precision?)` | Rounds the number to a specified number of decimal places (default: 0). |
|
153
55
|
|
154
|
-
|
155
|
-
Returns the date as a string in `YYYY-MM-DD` format.
|
56
|
+
### 📦 `Object` Extensions
|
156
57
|
|
157
|
-
|
158
|
-
|
58
|
+
| Method | Description |
|
59
|
+
|--------|-------------|
|
60
|
+
| `hasValue()` | Returns `true` if the object is not `null`, `undefined`, or empty. |
|
61
|
+
| `isEmpty()` | Returns `true` if the object has no enumerable properties. |
|
62
|
+
| `isNumeric()` | Returns `true` if the object represents a numeric value. |
|
159
63
|
|
160
|
-
|
161
|
-
Returns a new `Date` with the specified number of hours added.
|
64
|
+
### 🧵 `String` Extensions
|
162
65
|
|
163
|
-
|
164
|
-
|
66
|
+
| Method | Description |
|
67
|
+
|--------|-------------|
|
68
|
+
| `isNullOrEmpty()` | Returns `true` if the string is `null`, `undefined`, or empty. |
|
69
|
+
| `padLeft(totalLength, padChar)` | Pads the string on the left to the desired total length. |
|
70
|
+
| `padRight(totalLength, padChar)` | Pads the string on the right to the desired total length. |
|
165
71
|
|
166
72
|
---
|
167
73
|
|
168
|
-
|
169
|
-
|
170
|
-
These methods extend the `Object` prototype.
|
171
|
-
**Import the package once to enable them:**
|
74
|
+
## 🚨 Disclaimer
|
172
75
|
|
173
|
-
|
174
|
-
import 'utilynx';
|
76
|
+
These extensions modify native prototypes, which can cause conflicts with other libraries or unexpected behavior. Use with caution, preferably in controlled or internal environments.
|
175
77
|
|
176
|
-
|
177
|
-
(null as any)?.hasValue?.(); // false
|
78
|
+
To keep things safe and modular, consider wrapping these in utility functions instead of modifying prototypes globally if working on public or shared projects.
|
178
79
|
|
179
|
-
|
180
|
-
({ a: 1 }.isEmpty()); // false
|
181
|
-
''.isEmpty(); // true
|
182
|
-
[1].isEmpty(); // false
|
183
|
-
|
184
|
-
('123'.isNumeric()); // true
|
185
|
-
('abc'.isNumeric()); // false
|
186
|
-
(123 as any).isNumeric(); // true
|
187
|
-
(NaN as any).isNumeric(); // false
|
188
|
-
```
|
189
|
-
|
190
|
-
#### `Object.prototype.hasValue(): boolean`
|
191
|
-
Checks if the object is not `null` or `undefined`.
|
80
|
+
---
|
192
81
|
|
193
|
-
|
194
|
-
Checks if the object, array, or string is empty.
|
82
|
+
## 📄 License
|
195
83
|
|
196
|
-
|
197
|
-
|
84
|
+
This software is <b>NOT</b> open source.
|
85
|
+
You must obtain explicit written permission from the author to use, copy, modify, or distribute this package.
|
86
|
+
Commercial or non-commercial use requires a paid license.
|
87
|
+
Contact the author for licensing terms and pricing.
|
198
88
|
|
199
89
|
---
|
200
90
|
|
201
|
-
##
|
91
|
+
## 📣 Shoutout
|
202
92
|
|
203
|
-
|
204
|
-
You must obtain explicit written permission from the author to use, copy, modify, or distribute this package.
|
205
|
-
Commercial or non-commercial use requires a paid license.
|
206
|
-
Contact the author for licensing terms and pricing.
|
93
|
+
Inspired by the elegance of C# LINQ and the power of functional programming. Happy coding! 🚀
|
package/dist/collection.d.ts
CHANGED
@@ -1,3 +1,34 @@
|
|
1
|
+
/**
|
2
|
+
* Extends the global `Date` interface with additional utility methods.
|
3
|
+
*
|
4
|
+
* @method addDays
|
5
|
+
* Adds the specified number of days to the current date instance and returns a new `Date` object.
|
6
|
+
* @param days - The number of days to add (can be negative).
|
7
|
+
* @returns A new `Date` object with the days added.
|
8
|
+
*
|
9
|
+
* @method isWeekend
|
10
|
+
* Determines whether the current date instance falls on a weekend (Saturday or Sunday).
|
11
|
+
* @returns `true` if the date is a weekend, otherwise `false`.
|
12
|
+
*
|
13
|
+
* @method toShortDateString
|
14
|
+
* Returns a string representation of the date in ISO format "YYYY-MM-DD".
|
15
|
+
* @returns A short date string.
|
16
|
+
*
|
17
|
+
* @method diffDays
|
18
|
+
* Calculates the difference in whole days between the current date instance and another date.
|
19
|
+
* @param otherDate - The date to compare with.
|
20
|
+
* @returns The number of days difference as an integer.
|
21
|
+
*
|
22
|
+
* @method addHours
|
23
|
+
* Adds the specified number of hours to the current date instance and returns a new `Date` object.
|
24
|
+
* @param hours - The number of hours to add (can be negative).
|
25
|
+
* @returns A new `Date` object with the hours added.
|
26
|
+
*
|
27
|
+
* @method addMinutes
|
28
|
+
* Adds the specified number of minutes to the current date instance and returns a new `Date` object.
|
29
|
+
* @param minutes - The number of minutes to add (can be negative).
|
30
|
+
* @returns A new `Date` object with the minutes added.
|
31
|
+
*/
|
1
32
|
export {};
|
2
33
|
declare global {
|
3
34
|
interface Array<T> {
|
package/dist/math.d.ts
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
/**
|
2
|
+
* Extends the global `Number` interface with additional utility methods.
|
3
|
+
*
|
4
|
+
* @method isEven
|
5
|
+
* Determines whether the current number is even.
|
6
|
+
* @returns `true` if the number is even, otherwise `false`.
|
7
|
+
*
|
8
|
+
* @method isOdd
|
9
|
+
* Determines whether the current number is odd.
|
10
|
+
* @returns `true` if the number is odd, otherwise `false`.
|
11
|
+
*
|
12
|
+
* @method sqrt
|
13
|
+
* Returns the square root of the current number.
|
14
|
+
* @returns The square root as a number.
|
15
|
+
*
|
16
|
+
* @method round
|
17
|
+
* Rounds the current number to the specified number of decimal places.
|
18
|
+
* @param precision - The number of decimal places to round to (default is 0).
|
19
|
+
* @returns The rounded number.
|
20
|
+
*/
|
1
21
|
export {};
|
2
22
|
declare global {
|
3
23
|
interface Number {
|
package/dist-obf/collection.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
const
|
1
|
+
const a0_0xc573c7=a0_0x2f78;(function(_0x36fbd3,_0x59781d){const _0xd5b183=a0_0x2f78,_0x469f36=_0x36fbd3();while(!![]){try{const _0x5e1fad=parseInt(_0xd5b183(0x165))/0x1+parseInt(_0xd5b183(0x15b))/0x2*(parseInt(_0xd5b183(0x162))/0x3)+-parseInt(_0xd5b183(0x15d))/0x4*(-parseInt(_0xd5b183(0x15a))/0x5)+-parseInt(_0xd5b183(0x157))/0x6*(parseInt(_0xd5b183(0x167))/0x7)+parseInt(_0xd5b183(0x158))/0x8+-parseInt(_0xd5b183(0x15c))/0x9+-parseInt(_0xd5b183(0x159))/0xa*(parseInt(_0xd5b183(0x15f))/0xb);if(_0x5e1fad===_0x59781d)break;else _0x469f36['push'](_0x469f36['shift']());}catch(_0x4ce339){_0x469f36['push'](_0x469f36['shift']());}}}(a0_0x5a8b,0x46639));function a0_0x5a8b(){const _0x4e2eaf=['51254DAxyjZ','prototype','222SjkWjG','4143400HNOZGo','1708890YLnyhr','523990RcEsKT','566362WjvjpM','1515636xshObD','8gwYiGc','length','55enDCbQ','average','create','3YWGDYf','find','push','571374bRtBNH','sum'];a0_0x5a8b=function(){return _0x4e2eaf;};return a0_0x5a8b();}!Array['prototype']['firstOrDefault']&&(Array[a0_0xc573c7(0x156)]['firstOrDefault']=function(_0xd21364){const _0x4782b1=a0_0xc573c7;if(!Array['isArray'](this))return undefined;return _0xd21364?this[_0x4782b1(0x163)](_0xd21364):this[0x0];});!Array[a0_0xc573c7(0x156)]['groupBy']&&(Array['prototype']['groupBy']=function(_0x2619c8){const _0xc5c100=a0_0xc573c7,_0x2eed3b=Object[_0xc5c100(0x161)](null);for(let _0x5ee3d8=0x0,_0x4ab500=this['length'];_0x5ee3d8<_0x4ab500;++_0x5ee3d8){const _0xd0577e=this[_0x5ee3d8],_0x529e2b=_0x2619c8(_0xd0577e);!_0x2eed3b[_0x529e2b]?_0x2eed3b[_0x529e2b]=[_0xd0577e]:_0x2eed3b[_0x529e2b][_0xc5c100(0x164)](_0xd0577e);}return _0x2eed3b;});function a0_0x2f78(_0x25546e,_0x27cd52){const _0x5a8bd4=a0_0x5a8b();return a0_0x2f78=function(_0x2f78c1,_0x5227f3){_0x2f78c1=_0x2f78c1-0x156;let _0x248732=_0x5a8bd4[_0x2f78c1];return _0x248732;},a0_0x2f78(_0x25546e,_0x27cd52);}!Array[a0_0xc573c7(0x156)][a0_0xc573c7(0x166)]&&(Array[a0_0xc573c7(0x156)]['sum']=function(){const _0x3760ba=a0_0xc573c7;if(!Array['isArray'](this)||this['length']===0x0)return undefined;let _0x4396a3=0x0;for(let _0x54954a=0x0,_0x23ddac=this[_0x3760ba(0x15e)];_0x54954a<_0x23ddac;++_0x54954a){_0x4396a3+=this[_0x54954a];}return _0x4396a3;});!Array[a0_0xc573c7(0x156)][a0_0xc573c7(0x160)]&&(Array['prototype']['average']=function(){const _0xd2a54e=a0_0xc573c7;if(!Array['isArray'](this)||this[_0xd2a54e(0x15e)]===0x0)return undefined;let _0x5c351e=0x0;for(let _0x2d7840=0x0,_0x25097f=this[_0xd2a54e(0x15e)];_0x2d7840<_0x25097f;++_0x2d7840){_0x5c351e+=this[_0x2d7840];}return _0x5c351e/this['length'];});export{};
|
package/dist-obf/datetime.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
const a1_0x205f08=a1_0x453c;(function(_0x5f3d8f,_0x9aa666){const _0x5982e8=a1_0x453c,_0x45943e=_0x5f3d8f();while(!![]){try{const _0x3f5360=-parseInt(_0x5982e8(0xf8))/0x1+-parseInt(_0x5982e8(0xfd))/0x2*(parseInt(_0x5982e8(0xf9))/0x3)+parseInt(_0x5982e8(0xed))/0x4+-parseInt(_0x5982e8(0x105))/0x5*(parseInt(_0x5982e8(0x103))/0x6)+-parseInt(_0x5982e8(0x104))/0x7*(parseInt(_0x5982e8(0x100))/0x8)+parseInt(_0x5982e8(0xfb))/0x9*(-parseInt(_0x5982e8(0xf6))/0xa)+parseInt(_0x5982e8(0xfc))/0xb;if(_0x3f5360===_0x9aa666)break;else _0x45943e['push'](_0x45943e['shift']());}catch(_0x101b5f){_0x45943e['push'](_0x45943e['shift']());}}}(a1_0xc2cd,0x67a85));!Date['prototype'][a1_0x205f08(0xf7)]&&Object[a1_0x205f08(0xfa)](Date['prototype'],a1_0x205f08(0xf7),{'value':function(_0x3ded48){const _0x48b2a1=a1_0x205f08,_0x5784df=new Date(this['valueOf']());return _0x5784df['setDate'](_0x5784df[_0x48b2a1(0xfe)]()+_0x3ded48),_0x5784df;},'enumerable':![]});function a1_0xc2cd(){const _0x214488=['UTC','3019744KfXMFz','getDay','slice','addMinutes','floor','toISOString','diffDays','toShortDateString','getTime','93260hCmDkR','addDays','288049kzcVOz','33YabCUq','defineProperty','423etdkSx','23714218Mjxlzr','92534ExupSO','getDate','isWeekend','128UARpvk','getMonth','addHours','6BVJSRq','308483ItCRbo','2728905HeiMeT','getFullYear','prototype'];a1_0xc2cd=function(){return _0x214488;};return a1_0xc2cd();}function a1_0x453c(_0x129bd2,_0x3b6933){const _0xc2cd7f=a1_0xc2cd();return a1_0x453c=function(_0x453cef,_0x370b4f){_0x453cef=_0x453cef-0xeb;let _0x498e1f=_0xc2cd7f[_0x453cef];return _0x498e1f;},a1_0x453c(_0x129bd2,_0x3b6933);}!Date['prototype']['isWeekend']&&Object['defineProperty'](Date['prototype'],a1_0x205f08(0xff),{'value':function(){const _0x3a404a=a1_0x205f08,_0x496aa3=this[_0x3a404a(0xee)]();return _0x496aa3===0x0||_0x496aa3===0x6;},'enumerable':![]});!Date[a1_0x205f08(0xeb)]['toShortDateString']&&Object[a1_0x205f08(0xfa)](Date[a1_0x205f08(0xeb)],a1_0x205f08(0xf4),{'value':function(){const _0x491e37=a1_0x205f08;return this[_0x491e37(0xf2)]()[_0x491e37(0xef)](0x0,0xa);},'enumerable':![]});Date['prototype'][a1_0x205f08(0xf3)]=function(_0x8e5bd7){const _0x13d9fc=a1_0x205f08,_0x413237=Date[_0x13d9fc(0xec)](this[_0x13d9fc(0x106)](),this[_0x13d9fc(0x101)](),this[_0x13d9fc(0xfe)]()),_0x557d36=Date[_0x13d9fc(0xec)](_0x8e5bd7[_0x13d9fc(0x106)](),_0x8e5bd7['getMonth'](),_0x8e5bd7[_0x13d9fc(0xfe)]());return Math[_0x13d9fc(0xf1)]((_0x557d36-_0x413237)/0x5265c00);},Date[a1_0x205f08(0xeb)][a1_0x205f08(0x102)]=function(_0x36225a){return new Date(this['getTime']()+_0x36225a*0x36ee80);},Date[a1_0x205f08(0xeb)][a1_0x205f08(0xf0)]=function(_0x42ecef){const _0xf92900=a1_0x205f08;return new Date(this[_0xf92900(0xf5)]()+_0x42ecef*0xea60);};export{};
|
package/dist-obf/extensions.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
const
|
1
|
+
const a2_0x12806d=a2_0x5705;(function(_0x515dd9,_0x1ef8b8){const _0xc7a0f8=a2_0x5705,_0x8a7981=_0x515dd9();while(!![]){try{const _0x581dab=-parseInt(_0xc7a0f8(0x123))/0x1+-parseInt(_0xc7a0f8(0x12b))/0x2+parseInt(_0xc7a0f8(0x120))/0x3+-parseInt(_0xc7a0f8(0x121))/0x4*(parseInt(_0xc7a0f8(0x11c))/0x5)+-parseInt(_0xc7a0f8(0x12c))/0x6+-parseInt(_0xc7a0f8(0x124))/0x7*(-parseInt(_0xc7a0f8(0x11e))/0x8)+parseInt(_0xc7a0f8(0x129))/0x9;if(_0x581dab===_0x1ef8b8)break;else _0x8a7981['push'](_0x8a7981['shift']());}catch(_0x1a9474){_0x8a7981['push'](_0x8a7981['shift']());}}}(a2_0x4891,0xcf55e));!Object['prototype'][a2_0x12806d(0x125)]&&Object[a2_0x12806d(0x127)](Object[a2_0x12806d(0x12a)],'hasValue',{'value':function(){return this!=null;},'enumerable':![]});function a2_0x5705(_0x2b4841,_0x993b12){const _0x489191=a2_0x4891();return a2_0x5705=function(_0x5705db,_0x50e96b){_0x5705db=_0x5705db-0x11c;let _0x2e7913=_0x489191[_0x5705db];return _0x2e7913;},a2_0x5705(_0x2b4841,_0x993b12);}function a2_0x4891(){const _0x52a0af=['588514CjfeEo','3741864uhjPTV','10rZbnpX','isNumeric','3459344phJROe','isEmpty','1283520Hyuavh','1366300QRAEju','length','964168sfUCyn','7WrLiCw','hasValue','string','defineProperty','keys','22987863sSDLdC','prototype'];a2_0x4891=function(){return _0x52a0af;};return a2_0x4891();}!Object['prototype'][a2_0x12806d(0x11f)]&&Object['defineProperty'](Object['prototype'],'isEmpty',{'value':function(){const _0x3478bb=a2_0x12806d;if(this==null)return!![];if(typeof this===_0x3478bb(0x126)||Array['isArray'](this))return this['length']===0x0;if(typeof this==='object')return Object[_0x3478bb(0x128)](this)[_0x3478bb(0x122)]===0x0;return![];},'enumerable':![]});!Object['prototype'][a2_0x12806d(0x11d)]&&Object[a2_0x12806d(0x127)](Object['prototype'],a2_0x12806d(0x11d),{'value':function(){const _0x288400=+this;return typeof _0x288400==='number'&&!isNaN(_0x288400)&&isFinite(_0x288400);},'enumerable':![]});export{};
|
package/dist-obf/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
(function(
|
1
|
+
(function(_0x5d0832,_0x44bd6a){var _0x38b25a=a3_0x2890,_0x35e7bd=_0x5d0832();while(!![]){try{var _0x5aef60=parseInt(_0x38b25a(0x189))/0x1*(-parseInt(_0x38b25a(0x18c))/0x2)+-parseInt(_0x38b25a(0x18d))/0x3+parseInt(_0x38b25a(0x190))/0x4+parseInt(_0x38b25a(0x18b))/0x5+-parseInt(_0x38b25a(0x18e))/0x6+parseInt(_0x38b25a(0x188))/0x7+-parseInt(_0x38b25a(0x18a))/0x8*(-parseInt(_0x38b25a(0x18f))/0x9);if(_0x5aef60===_0x44bd6a)break;else _0x35e7bd['push'](_0x35e7bd['shift']());}catch(_0x48e7cc){_0x35e7bd['push'](_0x35e7bd['shift']());}}}(a3_0x4996,0x33535));import'./extensions';function a3_0x4996(){var _0x58abab=['31648NGlHFC','558635HLBQCf','31WvqPxg','56136quTggO','1049025itFAtu','886JaDZns','666498vfmntU','1339770wJQaKz','477SOjCAn'];a3_0x4996=function(){return _0x58abab;};return a3_0x4996();}function a3_0x2890(_0x354082,_0x1dcd2d){var _0x49965f=a3_0x4996();return a3_0x2890=function(_0x28902d,_0x3b16ba){_0x28902d=_0x28902d-0x188;var _0x1c4a13=_0x49965f[_0x28902d];return _0x1c4a13;},a3_0x2890(_0x354082,_0x1dcd2d);}export*from'./math';export*from'./collection';export*from'./string';export*from'./datetime';
|
package/dist-obf/math.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
const
|
1
|
+
const a4_0x5218dd=a4_0x18ba;function a4_0x1ced(){const _0x2e434e=['8595104evJkdi','sqrt','29470bkjUdC','EPSILON','isOdd','585815bfvCyP','68yrQuAx','round','1656412CoNIju','prototype','198831Hpctew','1687836stiBml','isEven','4068750BuREUf','valueOf'];a4_0x1ced=function(){return _0x2e434e;};return a4_0x1ced();}(function(_0x4235d8,_0x25479f){const _0x35241d=a4_0x18ba,_0x178764=_0x4235d8();while(!![]){try{const _0x174cbf=-parseInt(_0x35241d(0xce))/0x1+parseInt(_0x35241d(0xc2))/0x2+parseInt(_0x35241d(0xc4))/0x3*(parseInt(_0x35241d(0xc0))/0x4)+-parseInt(_0x35241d(0xcb))/0x5+-parseInt(_0x35241d(0xc5))/0x6+parseInt(_0x35241d(0xc7))/0x7+-parseInt(_0x35241d(0xc9))/0x8;if(_0x174cbf===_0x25479f)break;else _0x178764['push'](_0x178764['shift']());}catch(_0x176d20){_0x178764['push'](_0x178764['shift']());}}}(a4_0x1ced,0x8fbda));!Number['prototype']['isEven']&&(Number[a4_0x5218dd(0xc3)][a4_0x5218dd(0xc6)]=function(){return(this['valueOf']()&0x1)===0x0;});!Number[a4_0x5218dd(0xc3)][a4_0x5218dd(0xcd)]&&(Number['prototype'][a4_0x5218dd(0xcd)]=function(){return(this['valueOf']()&0x1)===0x1;});!Number[a4_0x5218dd(0xc3)]['sqrt']&&(Number['prototype'][a4_0x5218dd(0xca)]=function(){const _0x47c8f6=a4_0x5218dd;return Math['sqrt'](this[_0x47c8f6(0xc8)]());});function a4_0x18ba(_0xada248,_0x3f2e12){const _0x1ced70=a4_0x1ced();return a4_0x18ba=function(_0x18bae8,_0x276d3c){_0x18bae8=_0x18bae8-0xc0;let _0x1709c6=_0x1ced70[_0x18bae8];return _0x1709c6;},a4_0x18ba(_0xada248,_0x3f2e12);}!Number[a4_0x5218dd(0xc3)]['round']&&(Number[a4_0x5218dd(0xc3)][a4_0x5218dd(0xc1)]=function(_0x371bfd=0x0){const _0x376522=a4_0x5218dd,_0x53a452=Math['pow'](0xa,_0x371bfd);return Math[_0x376522(0xc1)]((this['valueOf']()+Number[_0x376522(0xcc)])*_0x53a452)/_0x53a452;});export{};
|
package/dist-obf/string.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
const
|
1
|
+
const a5_0x3a44e2=a5_0x51b0;function a5_0x5a41(){const _0x587a68=['477646tPEVeg','2403216KWlyym','2862NzhkXn','12640HfHWAF','join','50132JBiZiy','4364196XSfSak','21126IXveoj','1118504zqflzK','155NWDXDl','length','1888pPoWIK','prototype'];a5_0x5a41=function(){return _0x587a68;};return a5_0x5a41();}(function(_0x3a235f,_0x4d6aa7){const _0x2e5129=a5_0x51b0,_0x15dfc8=_0x3a235f();while(!![]){try{const _0x566d95=-parseInt(_0x2e5129(0xa8))/0x1+-parseInt(_0x2e5129(0xb0))/0x2+parseInt(_0x2e5129(0xa9))/0x3+-parseInt(_0x2e5129(0xad))/0x4*(parseInt(_0x2e5129(0xa4))/0x5)+parseInt(_0x2e5129(0xae))/0x6+parseInt(_0x2e5129(0xaf))/0x7*(parseInt(_0x2e5129(0xa6))/0x8)+parseInt(_0x2e5129(0xaa))/0x9*(-parseInt(_0x2e5129(0xab))/0xa);if(_0x566d95===_0x4d6aa7)break;else _0x15dfc8['push'](_0x15dfc8['shift']());}catch(_0x4297bf){_0x15dfc8['push'](_0x15dfc8['shift']());}}}(a5_0x5a41,0x64e81),String[a5_0x3a44e2(0xa7)]['isNullOrEmpty']=function(){const _0x51f3e0=a5_0x3a44e2;return this[_0x51f3e0(0xa5)]===0x0;},String[a5_0x3a44e2(0xa7)]['padLeft']=function(_0x39ba53,_0x853750){const _0x1cc440=a5_0x3a44e2,_0x2419a1=String(this),_0x36ca3f=_0x39ba53-_0x2419a1['length'];if(_0x36ca3f<=0x0)return _0x2419a1;if(!_0x853750||_0x853750[_0x1cc440(0xa5)]===0x0)_0x853750='\x20';let _0x48d522='';if(_0x853750['length']===0x1)_0x48d522=new Array(_0x36ca3f+0x1)[_0x1cc440(0xac)](_0x853750);else{while(_0x48d522['length']<_0x36ca3f){_0x48d522+=_0x853750;}_0x48d522=_0x48d522['slice'](0x0,_0x36ca3f);}return _0x48d522+_0x2419a1;},String['prototype']['padRight']=function(_0x135d0e,_0x197760){const _0x3415e0=a5_0x3a44e2,_0x2a8bb3=String(this),_0x50a4fb=_0x135d0e-_0x2a8bb3[_0x3415e0(0xa5)];if(_0x50a4fb<=0x0)return _0x2a8bb3;if(!_0x197760||_0x197760[_0x3415e0(0xa5)]===0x0)_0x197760='\x20';let _0x176f1c='';if(_0x197760[_0x3415e0(0xa5)]===0x1)_0x176f1c=new Array(_0x50a4fb+0x1)['join'](_0x197760);else{while(_0x176f1c['length']<_0x50a4fb){_0x176f1c+=_0x197760;}_0x176f1c=_0x176f1c['slice'](0x0,_0x50a4fb);}return _0x2a8bb3+_0x176f1c;});function a5_0x51b0(_0xf442d4,_0x4287de){const _0x5a4105=a5_0x5a41();return a5_0x51b0=function(_0x51b0a0,_0x50876e){_0x51b0a0=_0x51b0a0-0xa4;let _0x2095e7=_0x5a4105[_0x51b0a0];return _0x2095e7;},a5_0x51b0(_0xf442d4,_0x4287de);}export{};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@agogte/utilynx",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.8",
|
4
4
|
"type": "module",
|
5
5
|
"description": "High-level utility functions for working with arrays, math, strings, and more — bringing expressive language features to JavaScript and TypeScript.",
|
6
6
|
"main": "dist-obf/index.js",
|