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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cynx-lib",
3
- "version": "1.3.87",
3
+ "version": "1.3.88",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -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
- return `${prefix}_${uid(size, alphabet)}`;
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;
@@ -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
- return `${prefix}_${uid(size, alphabet)}`;
164
+ const p = String(prefix || 'id').replace(/_+$/, '');
165
+ return `${p}_${uid(size, alphabet)}`;
165
166
  }
166
167
 
167
168
  /**