cynx-lib 1.3.87 → 1.3.88
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/package.json +1 -1
- package/utils/utils/uid.cjs +2 -1
- package/utils/utils/uid.js +2 -1
package/package.json
CHANGED
package/utils/utils/uid.cjs
CHANGED
|
@@ -121,7 +121,8 @@ function shortId(size = 8) {
|
|
|
121
121
|
return uid(size, ALPHABETS.alphanumeric);
|
|
122
122
|
}
|
|
123
123
|
function prefixedId(prefix = "id", size = 12, alphabet = ALPHABETS.alphanumeric) {
|
|
124
|
-
|
|
124
|
+
const p = String(prefix || "id").replace(/_+$/, "");
|
|
125
|
+
return `${p}_${uid(size, alphabet)}`;
|
|
125
126
|
}
|
|
126
127
|
function createSequence(prefix = "cynx") {
|
|
127
128
|
let counter = 0;
|
package/utils/utils/uid.js
CHANGED
|
@@ -161,7 +161,8 @@ export function shortId(size = 8) {
|
|
|
161
161
|
* @returns {string}
|
|
162
162
|
*/
|
|
163
163
|
export function prefixedId(prefix = 'id', size = 12, alphabet = ALPHABETS.alphanumeric) {
|
|
164
|
-
|
|
164
|
+
const p = String(prefix || 'id').replace(/_+$/, '');
|
|
165
|
+
return `${p}_${uid(size, alphabet)}`;
|
|
165
166
|
}
|
|
166
167
|
|
|
167
168
|
/**
|