cynx-lib 1.3.117 → 1.3.119

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.117",
3
+ "version": "1.3.119",
4
4
  "type": "module",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
@@ -121,6 +121,9 @@ 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
+ if (prefix === "" || prefix === null || prefix === false) {
125
+ return uid(size, alphabet);
126
+ }
124
127
  const p = String(prefix || "id").replace(/_+$/, "");
125
128
  return `${p}_${uid(size, alphabet)}`;
126
129
  }
@@ -161,6 +161,9 @@ export function shortId(size = 8) {
161
161
  * @returns {string}
162
162
  */
163
163
  export function prefixedId(prefix = 'id', size = 12, alphabet = ALPHABETS.alphanumeric) {
164
+ if (prefix === '' || prefix === null || prefix === false) {
165
+ return uid(size, alphabet);
166
+ }
164
167
  const p = String(prefix || 'id').replace(/_+$/, '');
165
168
  return `${p}_${uid(size, alphabet)}`;
166
169
  }