react-js-plugins 1.3.12 → 1.4.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 +9 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -24,9 +24,8 @@ pnpm add react-js-plugins
|
|
|
24
24
|
| ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
25
25
|
| Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ | Latest ✔ |
|
|
26
26
|
|
|
27
|
-
# Utility Functions Documentation
|
|
28
27
|
|
|
29
|
-
##
|
|
28
|
+
## Array Functions
|
|
30
29
|
|
|
31
30
|
### ✅ **_arrayDiff**
|
|
32
31
|
Returns the difference between two arrays.
|
|
@@ -305,7 +304,7 @@ const updated = _updateObjectInArray(users, 'id', '123', { name: 'New Name' });
|
|
|
305
304
|
|
|
306
305
|
---
|
|
307
306
|
|
|
308
|
-
##
|
|
307
|
+
## Object Functions
|
|
309
308
|
|
|
310
309
|
### ✅ **_deepClone**
|
|
311
310
|
Deep clones an object using `JSON.stringify` and `JSON.parse`.
|
|
@@ -429,7 +428,7 @@ _setNestedProperty(obj, 'user.address.city', 'Mumbai');
|
|
|
429
428
|
|
|
430
429
|
---
|
|
431
430
|
|
|
432
|
-
##
|
|
431
|
+
## Form & Validation Functions
|
|
433
432
|
|
|
434
433
|
### ✅ **_dynamicRequiredValidation**
|
|
435
434
|
Generates a Yup schema with required validations for given fields.
|
|
@@ -677,7 +676,7 @@ const isValid = _isValidUUID('550e8400-e29b-41d4-a716-446655440000');
|
|
|
677
676
|
|
|
678
677
|
---
|
|
679
678
|
|
|
680
|
-
##
|
|
679
|
+
## Security & Encryption Functions
|
|
681
680
|
|
|
682
681
|
### ✅ **_decryptJson**
|
|
683
682
|
Decrypts AES-encrypted JSON string using a secret key.
|
|
@@ -724,7 +723,7 @@ const newPassword = _generatePassword(12);
|
|
|
724
723
|
|
|
725
724
|
---
|
|
726
725
|
|
|
727
|
-
##
|
|
726
|
+
## Event & DOM Functions
|
|
728
727
|
|
|
729
728
|
### ✅ **_addEventListenerToElement**
|
|
730
729
|
Attaches an event listener to a DOM element.
|
|
@@ -965,7 +964,7 @@ _showElement('#modal', 'flex');
|
|
|
965
964
|
|
|
966
965
|
---
|
|
967
966
|
|
|
968
|
-
##
|
|
967
|
+
## File & Data Functions
|
|
969
968
|
|
|
970
969
|
### ✅ **_base64ToBlob**
|
|
971
970
|
Converts a base64-encoded string into a Blob object.
|
|
@@ -1037,7 +1036,7 @@ const handleChangeFile = async (file) => {
|
|
|
1037
1036
|
|
|
1038
1037
|
---
|
|
1039
1038
|
|
|
1040
|
-
##
|
|
1039
|
+
## Browser & Storage Functions
|
|
1041
1040
|
|
|
1042
1041
|
### ✅ **_clearRouteState**
|
|
1043
1042
|
Removes the route state from the browser's history without reloading the page, keeping the current path intact.
|
|
@@ -1102,7 +1101,7 @@ _setCookie('auth_token', 'abc123', 7);
|
|
|
1102
1101
|
|
|
1103
1102
|
---
|
|
1104
1103
|
|
|
1105
|
-
##
|
|
1104
|
+
## String & Text Functions
|
|
1106
1105
|
|
|
1107
1106
|
### ✅ **_bytesToSize**
|
|
1108
1107
|
Converts byte size into a human-readable format.
|
|
@@ -1166,7 +1165,7 @@ _toCamelCase('hello_world'); // helloWorld
|
|
|
1166
1165
|
|
|
1167
1166
|
---
|
|
1168
1167
|
|
|
1169
|
-
##
|
|
1168
|
+
## Date & Time Functions
|
|
1170
1169
|
|
|
1171
1170
|
### ✅ **_calculateTimeDifference**
|
|
1172
1171
|
Returns difference between two dates in readable format.
|
|
@@ -1244,7 +1243,6 @@ const weekend = _isWeekend(new Date('2025-06-08')); // true (Sunday)
|
|
|
1244
1243
|
|
|
1245
1244
|
---
|
|
1246
1245
|
|
|
1247
|
-
## 🧮 Math & Calculation Functions
|
|
1248
1246
|
|
|
1249
1247
|
### ✅ **_calPercentage**
|
|
1250
1248
|
Calculates the percentage of a value relative to total.
|
|
@@ -1272,8 +1270,6 @@ const formatted = _thousandSeparator(1234567.89);
|
|
|
1272
1270
|
|
|
1273
1271
|
---
|
|
1274
1272
|
|
|
1275
|
-
## 🔧 Utility & Helper Functions
|
|
1276
|
-
|
|
1277
1273
|
### ✅ **_alert**
|
|
1278
1274
|
Shows a customizable alert modal.
|
|
1279
1275
|
```ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-js-plugins",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
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",
|