soonjs 0.0.22 → 0.0.23
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/deps/{acorn-tklbyr11e.js → acorn-1oc5bnxht.js} +10 -10
- package/dist/deps/acorn-8dcdyq2ew.js +2895 -0
- package/dist/deps/angular-46ezrk1u4.js +1 -0
- package/dist/deps/angular-s1xz11ikt.js +1448 -0
- package/dist/deps/babel-0wg32lzwx.js +6844 -0
- package/dist/deps/{babel-48ei1aig4.js → babel-ukpqzojf5.js} +10 -10
- package/dist/deps/estree-kdvyujfa4.js +4265 -0
- package/dist/deps/{estree-4o5bj9gvd.js → estree-keanyt70z.js} +23 -23
- package/dist/deps/flow-0bur80d37.js +26221 -0
- package/dist/deps/{flow-xlruu7boa.js → flow-ugrhj6801.js} +15 -15
- package/dist/deps/glimmer-fj2j8ttlo.js +2756 -0
- package/dist/deps/{glimmer-kyfivr6g7.js → glimmer-g89edvgvf.js} +18 -18
- package/dist/deps/{graphql-xojtytb2p.js → graphql-amtjbpo5r.js} +12 -12
- package/dist/deps/graphql-y9qq36k5p.js +1212 -0
- package/dist/deps/html-2g2e1kuqu.js +2623 -0
- package/dist/deps/{html-jal5w2b1p.js → html-flg3eek30.js} +17 -17
- package/dist/deps/markdown-4jfu7be9n.js +3058 -0
- package/dist/deps/{markdown-qhqqns7vp.js → markdown-7x2u7akwf.js} +40 -40
- package/dist/deps/meriyah-3gk7mqup6.js +2320 -0
- package/dist/deps/meriyah-6mdlkd9e4.js +4 -0
- package/dist/deps/{postcss-vq400h6ym.js → postcss-2wa48tg1s.js} +21 -21
- package/dist/deps/postcss-zmmc2gk0l.js +4664 -0
- package/dist/deps/soon-id-4bhrd5e6a.js +30 -0
- package/dist/deps/soon-id-exfiforio.js +1 -0
- package/dist/deps/typescript-bgdn0fi0y.js +12794 -0
- package/dist/deps/{typescript-jihynpl9y.js → typescript-q1t5ixgyo.js} +11 -11
- package/dist/deps/yaml-ajia8oazz.js +4088 -0
- package/dist/deps/{yaml-auqgv4vnk.js → yaml-wpxyjc78l.js} +26 -26
- package/dist/index.cjs +15 -0
- package/dist/index.js +2217 -9
- package/dist/vite-plugin-soon-client.cjs +249 -0
- package/dist/vite-plugin-soon-client.js +48725 -152
- package/dist/vite-plugin-soon-server.cjs +272 -0
- package/dist/vite-plugin-soon-server.d.ts +1 -0
- package/dist/vite-plugin-soon-server.js +3276 -19
- package/package.json +18 -1
- package/dist/deps/angular-m17t0gdsi.js +0 -1
- package/dist/deps/meriyah-sl495y757.js +0 -4
- package/dist/deps/soon-id-gmzr57ufv.js +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const f=require("crypto");var p=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function w(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function g({workerId:t=0,timeLen:r,workerLen:o,randomLen:a}){return{timestampStr:Date.now().toString(36).padStart(r,"0"),workerIdStr:t.toString(36).padStart(o,"0"),randomStr:f.randomInt(36**a-1).toString(36).padStart(a,"0")}}function L({workerId:t,isFixedLength:r=!1,prefix:o=""}={}){const c=t??f.randomInt(46655),m=36**4-1;let s=0,i="",u="",S="",d="",e=0;function l(){const n=g({workerId:c,timeLen:9,workerLen:3,randomLen:4});s=n.timestampStr===i?Math.min(36**1-1,s+1):0,i=n.timestampStr,u=n.workerIdStr,S=n.randomStr,d=`${o}${i}${u}${S}${s.toString(36).padStart(1,"0")}`,e=0}return l(),r?function(){return e>m&&l(),d+(e++).toString(36).padStart(4,"0")}:function(){return e>m&&l(),d+(e++).toString(36)}}exports.commonjsGlobal=p;exports.getDefaultExportFromCjs=w;exports.useSoonIdGen=L;
|