soonjs 0.0.28 → 0.0.29
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/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/vite-plugin-soon-client.cjs +2 -2
- package/dist/vite-plugin-soon-client.js +14 -14
- package/dist/vite-plugin-soon-server.cjs +1 -1
- package/dist/vite-plugin-soon-server.js +1 -1
- package/package.json +2 -2
- package/dist/deps/acorn-4wexbyzuw.js +0 -2895
- package/dist/deps/angular-xfi4e19sg.js +0 -1448
- package/dist/deps/babel-wotymuimo.js +0 -6844
- package/dist/deps/estree-w8aqfmnru.js +0 -4265
- package/dist/deps/flow-5zpe1wzhk.js +0 -26221
- package/dist/deps/glimmer-pnwlsj9ka.js +0 -2756
- package/dist/deps/graphql-rd46v28zh.js +0 -1212
- package/dist/deps/html-xp09o8rqi.js +0 -2623
- package/dist/deps/markdown-bnfknn2ni.js +0 -3058
- package/dist/deps/meriyah-s7tpf27fe.js +0 -2320
- package/dist/deps/postcss-bc3q8dofl.js +0 -4664
- package/dist/deps/soon-id-jwjk4327p.js +0 -30
- package/dist/deps/typescript-icql3mp9b.js +0 -12794
- package/dist/deps/yaml-sx1aya8o8.js +0 -4088
- /package/dist/deps/{acorn-4t935rp91.js → acorn-Ff8MVRmodX.js} +0 -0
- /package/dist/deps/{angular-q6i1sy3lp.js → angular-LqdjJ4Yaq2.js} +0 -0
- /package/dist/deps/{babel-282anq5m4.js → babel-32vqD9oEys.js} +0 -0
- /package/dist/deps/{estree-35km1xdcr.js → estree-IMJs86TDC0.js} +0 -0
- /package/dist/deps/{flow-nsownrvze.js → flow-zRn8VfVm5J.js} +0 -0
- /package/dist/deps/{glimmer-lr7v7jyip.js → glimmer-_ODPKtzJ7S.js} +0 -0
- /package/dist/deps/{graphql-yeio05lym.js → graphql-q8vjor01qx.js} +0 -0
- /package/dist/deps/{html-ru6d9i9yp.js → html-TSaii5iYiA.js} +0 -0
- /package/dist/deps/{markdown-lx93e2vjh.js → markdown-M6N0BeoGFG.js} +0 -0
- /package/dist/deps/{meriyah-t4wz91nre.js → meriyah-XGfSapNsj5.js} +0 -0
- /package/dist/deps/{postcss-6t5bq84rl.js → postcss-Urbkvv7NC7.js} +0 -0
- /package/dist/deps/{soon-id-yegik52z1.js → soon-id-LxpwEdKJEZ.js} +0 -0
- /package/dist/deps/{typescript-xwuz67p85.js → typescript-rVkPWM4hUZ.js} +0 -0
- /package/dist/deps/{yaml-oo2p8lgav.js → yaml-ySEu0nw36-.js} +0 -0
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { randomInt as f } from "crypto";
|
|
2
|
-
var k = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3
|
-
function I(t) {
|
|
4
|
-
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
5
|
-
}
|
|
6
|
-
function p({ workerId: t = 0, timeLen: r, workerLen: o, randomLen: a }) {
|
|
7
|
-
return {
|
|
8
|
-
timestampStr: Date.now().toString(36).padStart(r, "0"),
|
|
9
|
-
workerIdStr: t.toString(36).padStart(o, "0"),
|
|
10
|
-
randomStr: f(36 ** a - 1).toString(36).padStart(a, "0")
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
function y({ workerId: t, isFixedLength: r = !1, prefix: o = "" } = {}) {
|
|
14
|
-
const c = t ?? f(46655), l = 36 ** 4 - 1;
|
|
15
|
-
let i = 0, s = "", u = "", S = "", d = "", e = 0;
|
|
16
|
-
function m() {
|
|
17
|
-
const n = p({ workerId: c, timeLen: 9, workerLen: 3, randomLen: 4 });
|
|
18
|
-
i = n.timestampStr === s ? Math.min(36 ** 1 - 1, i + 1) : 0, s = n.timestampStr, u = n.workerIdStr, S = n.randomStr, d = `${o}${s}${u}${S}${i.toString(36).padStart(1, "0")}`, e = 0;
|
|
19
|
-
}
|
|
20
|
-
return m(), r ? function() {
|
|
21
|
-
return e > l && m(), d + (e++).toString(36).padStart(4, "0");
|
|
22
|
-
} : function() {
|
|
23
|
-
return e > l && m(), d + (e++).toString(36);
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
export {
|
|
27
|
-
k as c,
|
|
28
|
-
I as g,
|
|
29
|
-
y as u
|
|
30
|
-
};
|