@cocreate/utils 1.26.0 → 1.26.1
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/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/index.js +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.26.1](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.26.0...v1.26.1) (2023-10-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* initialize counter with a random number from 1000 - 5000 ([0d82bf2](https://github.com/CoCreate-app/CoCreate-utils/commit/0d82bf289743a5db7ab431261b3ff343f9cc6c19))
|
|
7
|
+
|
|
1
8
|
# [1.26.0](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.25.4...v1.26.0) (2023-10-22)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -61,7 +61,12 @@
|
|
|
61
61
|
// Generate a new custom ObjectId
|
|
62
62
|
const timestampHex = Math.floor(Date.now() / 1000).toString(16).padStart(8, '0');
|
|
63
63
|
const processIdHex = Math.floor(Math.random() * 0x100000000000).toString(16).padStart(12, '0');
|
|
64
|
+
|
|
64
65
|
counter = (counter + 1) % 10000;
|
|
66
|
+
if (counter < 2) {
|
|
67
|
+
counter = Math.floor(Math.random() * (5000 - 100 + 1)) + 100;
|
|
68
|
+
}
|
|
69
|
+
|
|
65
70
|
const counterHex = counter.toString(16).padStart(4, '0');
|
|
66
71
|
|
|
67
72
|
// Return the custom ObjectId object with a toString() method
|