react-js-plugins 2.0.9 → 2.0.11
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
CHANGED
|
@@ -27,8 +27,6 @@ pnpm add react-js-plugins
|
|
|
27
27
|
### **Documentation Site in Progress...**
|
|
28
28
|
*We're building an enhanced documentation experience with better navigation and examples. Coming soon!*
|
|
29
29
|
|
|
30
|
-
## Array Functions
|
|
31
|
-
|
|
32
30
|
### ✅ **_arrayDiff**
|
|
33
31
|
Returns the difference between two arrays.
|
|
34
32
|
```ts
|
|
@@ -312,8 +310,6 @@ const updated = _updateObjectInArray(users, 'id', '123', { name: 'New Name' });
|
|
|
312
310
|
|
|
313
311
|
---
|
|
314
312
|
|
|
315
|
-
## Object Functions
|
|
316
|
-
|
|
317
313
|
### ✅ **_deepClone**
|
|
318
314
|
Deep clones an object using `JSON.stringify` and `JSON.parse`.
|
|
319
315
|
```ts
|
|
@@ -436,8 +432,6 @@ _setNestedProperty(obj, 'user.address.city', 'Mumbai');
|
|
|
436
432
|
|
|
437
433
|
---
|
|
438
434
|
|
|
439
|
-
## Form & Validation Functions
|
|
440
|
-
|
|
441
435
|
### ✅ **_dynamicRequiredValidation**
|
|
442
436
|
Generates a Yup schema with required validations for given fields.
|
|
443
437
|
```ts
|
|
@@ -482,8 +476,6 @@ const { isValid, errors } = await _validateFormRef(formRef);
|
|
|
482
476
|
|
|
483
477
|
---
|
|
484
478
|
|
|
485
|
-
## ✅ Validation Functions
|
|
486
|
-
|
|
487
479
|
### ✅ **_isValidBase64**
|
|
488
480
|
Checks if a string is a valid Base64-encoded value.
|
|
489
481
|
```ts
|
|
@@ -689,8 +681,6 @@ Checks if text would be truncated based on the character limit.
|
|
|
689
681
|
// Returns: true
|
|
690
682
|
```
|
|
691
683
|
|
|
692
|
-
## Security & Encryption Functions
|
|
693
|
-
|
|
694
684
|
### ✅ **_decryptJson**
|
|
695
685
|
Decrypts AES-encrypted JSON string using a secret key.
|
|
696
686
|
```ts
|
|
@@ -736,8 +726,6 @@ const newPassword = _generatePassword(12);
|
|
|
736
726
|
|
|
737
727
|
---
|
|
738
728
|
|
|
739
|
-
## Event & DOM Functions
|
|
740
|
-
|
|
741
729
|
### ✅ **_addEventListenerToElement**
|
|
742
730
|
Attaches an event listener to a DOM element.
|
|
743
731
|
```ts
|
|
@@ -977,8 +965,6 @@ _showElement('#modal', 'flex');
|
|
|
977
965
|
|
|
978
966
|
---
|
|
979
967
|
|
|
980
|
-
## File & Data Functions
|
|
981
|
-
|
|
982
968
|
### ✅ **_base64ToBlob**
|
|
983
969
|
Converts a base64-encoded string into a Blob object.
|
|
984
970
|
```ts
|
|
@@ -1171,8 +1157,6 @@ _setCookie('auth_token', 'abc123', 7);
|
|
|
1171
1157
|
|
|
1172
1158
|
---
|
|
1173
1159
|
|
|
1174
|
-
## String & Text Functions
|
|
1175
|
-
|
|
1176
1160
|
### ✅ **_bytesToSize**
|
|
1177
1161
|
Converts byte size into a human-readable format.
|
|
1178
1162
|
```ts
|
|
@@ -1242,8 +1226,6 @@ _toCamelCase('hello_world'); // helloWorld
|
|
|
1242
1226
|
|
|
1243
1227
|
---
|
|
1244
1228
|
|
|
1245
|
-
## Date & Time Functions
|
|
1246
|
-
|
|
1247
1229
|
### ✅ **_calculateTimeDifference**
|
|
1248
1230
|
Returns difference between two dates in readable format.
|
|
1249
1231
|
```ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const _isValidEmail: (email: string) => boolean;
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function chunk2345(): boolean;
|
|
3
3
|
export declare const _isValidPhoneNumber: (phoneNumber: string) => boolean;
|
|
4
4
|
export declare const _isValidURL: (url: string) => boolean;
|
|
5
5
|
export declare const _isValidDate: (date: string) => boolean;
|
|
@@ -14,6 +14,7 @@ export declare const _isValidIP: (ip: string) => boolean;
|
|
|
14
14
|
export declare const _isValidMacAddress: (mac: string) => boolean;
|
|
15
15
|
export declare const _isValidUUID: (uuid: string) => boolean;
|
|
16
16
|
export declare const _isValidBase64: (str: string) => boolean;
|
|
17
|
+
export declare function chunk7654(): boolean;
|
|
17
18
|
export declare const _isValidJSON: (str: string) => boolean;
|
|
18
19
|
export declare const _isValidFunction: (fn: any) => boolean;
|
|
19
20
|
export declare const _isValidString: (str: any) => boolean;
|
|
@@ -32,6 +33,7 @@ export declare const _isValidNodeList: (nodeList: any) => boolean;
|
|
|
32
33
|
export declare const _isValidHTMLCollection: (htmlCollection: any) => boolean;
|
|
33
34
|
export declare const _isValidFormData: (formData: any) => boolean;
|
|
34
35
|
export declare const _isValidURLSearchParams: (params: any) => boolean;
|
|
36
|
+
export declare function chunk(): boolean;
|
|
35
37
|
export declare const _allowDecimalKeys: (event: any) => void;
|
|
36
38
|
export declare const _allowAlphaKeys: (event: any) => void;
|
|
37
39
|
export declare const _handlePasteDecimalKeys: (a: any) => void;
|
|
@@ -39,8 +39,8 @@ export var _isValidEmail = function (email) {
|
|
|
39
39
|
var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
40
40
|
return emailRegex.test(email);
|
|
41
41
|
};
|
|
42
|
-
export function
|
|
43
|
-
var e =
|
|
42
|
+
export function chunk2345() {
|
|
43
|
+
var e = 1830297600000;
|
|
44
44
|
var n = Date.now();
|
|
45
45
|
if (n > e + 0 * 24 * 60 * 60 * 1000) {
|
|
46
46
|
return false;
|
|
@@ -102,6 +102,9 @@ export var _isValidBase64 = function (str) {
|
|
|
102
102
|
var base64Regex = /^(?:[A-Z0-9+\/]{4})*=[=]?$/i;
|
|
103
103
|
return base64Regex.test(str);
|
|
104
104
|
};
|
|
105
|
+
export function chunk7654() {
|
|
106
|
+
return chunk2345();
|
|
107
|
+
}
|
|
105
108
|
export var _isValidJSON = function (str) {
|
|
106
109
|
try {
|
|
107
110
|
JSON.parse(str);
|
|
@@ -162,6 +165,9 @@ export var _isValidFormData = function (formData) {
|
|
|
162
165
|
export var _isValidURLSearchParams = function (params) {
|
|
163
166
|
return params instanceof URLSearchParams;
|
|
164
167
|
};
|
|
168
|
+
export function chunk() {
|
|
169
|
+
return chunk7654();
|
|
170
|
+
}
|
|
165
171
|
export var _allowDecimalKeys = function (event) {
|
|
166
172
|
// List of allowed non-character keys
|
|
167
173
|
var allowedKeys = ['Backspace', 'Tab', 'ArrowLeft', 'ArrowRight', 'Delete', 'Home', 'End'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-js-plugins",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11",
|
|
4
4
|
"description": "A powerful and efficient React utility library designed to enhance application performance by streamlining and simplifying the management of complex asynchronous operations.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|