@astrolimit/fc-utils 26.1.3 → 26.1.15

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -318,22 +318,22 @@ function parseJson(json, mode) {
318
318
 
319
319
  //#endregion
320
320
  //#region src/unique.ts
321
- var NumIdSingleton = class NumIdSingleton {
322
- static _value = 36;
323
- get value() {
324
- NumIdSingleton._value = NumIdSingleton._value + 1;
325
- if (NumIdSingleton._value > 1200) NumIdSingleton._value = 36;
326
- return NumIdSingleton._value.toString(36);
321
+ const counterProxy = {
322
+ _value: 370,
323
+ get len() {
324
+ return `${this._value}`.length;
325
+ },
326
+ get id() {
327
+ this._value = this._value + 1;
328
+ if (this.len > 10) this._value = 370;
329
+ return this._value;
327
330
  }
328
331
  };
329
- const numId = new NumIdSingleton();
330
- let id = 0;
331
332
  function uniqueId() {
332
- const num = 370 + ++id;
333
- return "F" + Math.random().toString(36).substr(3, 3) + Number(`${Date.now()}`).toString(36) + num.toString(36) + "c";
333
+ return "F" + Math.random().toString(36).slice(3, 6) + Date.now().toString(36) + counterProxy.id.toString(36) + "c";
334
334
  }
335
335
  function shortKey() {
336
- return Number(`${dayjs().diff(dayjs("2025-01-01"), "millisecond")}`).toString(36) + numId.value;
336
+ return dayjs().diff(dayjs("2025-01-01"), "millisecond").toString(36) + uniqueId().slice(3, 6);
337
337
  }
338
338
 
339
339
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrolimit/fc-utils",
3
- "version": "26.01.003",
3
+ "version": "26.01.015",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "license": "SFR",