usage-board 3.0.0 → 3.1.1
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.mjs +1 -1
- package/dist/public/_nuxt/{y3weNNd-.js → B6C9KBQ4.js} +2 -2
- package/dist/public/_nuxt/Bv6agYS5.js +119 -0
- package/dist/public/_nuxt/BvRyOET7.js +1 -0
- package/dist/public/_nuxt/CMWftE4h.js +1 -0
- package/dist/public/_nuxt/{Be3rizqy.js → COIbUy5w.js} +1 -1
- package/dist/public/_nuxt/CXLmM1yO.js +25 -0
- package/dist/public/_nuxt/DFqWEFN4.js +1 -0
- package/dist/public/_nuxt/DUoLvn3A.js +6 -0
- package/dist/public/_nuxt/D_W11Quh.js +21 -0
- package/dist/public/_nuxt/DgKrPjze.js +4 -0
- package/dist/public/_nuxt/DkxY2YMp.js +1 -0
- package/dist/public/_nuxt/{7Dy4NLP8.js → DtbPvE6R.js} +24 -24
- package/dist/public/_nuxt/HiqUua3-.js +1 -0
- package/dist/public/_nuxt/builds/latest.json +1 -1
- package/dist/public/_nuxt/builds/meta/6f98f1cb-266c-475e-a249-dad346a55f24.json +1 -0
- package/dist/public/_nuxt/entry.vHfFzkyD.css +1 -0
- package/dist/public/_nuxt/error-404.CFBEg71j.css +1 -0
- package/dist/public/_nuxt/error-500.BqCnH31G.css +1 -0
- package/dist/public/_nuxt/uHQwCIHg.js +1 -0
- package/dist/server/chunks/_/error-500.mjs +2 -20
- package/dist/server/chunks/build/client.precomputed.mjs +1 -1
- package/dist/server/chunks/nitro/nitro.mjs +2303 -3614
- package/dist/server/chunks/routes/api/analysis/agent/session.json.mjs +21 -0
- package/dist/server/chunks/routes/api/analysis/agent/token.json.mjs +24 -0
- package/dist/server/chunks/routes/api/analysis/cache.json.mjs +24 -0
- package/dist/server/chunks/routes/api/analysis/hot-project.json.mjs +24 -0
- package/dist/server/chunks/routes/api/analysis/model.json.mjs +24 -0
- package/dist/server/chunks/routes/api/analysis/overview-cards.json.mjs +24 -0
- package/dist/server/chunks/routes/api/analysis/session.json.mjs +21 -0
- package/dist/server/chunks/routes/api/analysis/token/daily.json.mjs +21 -0
- package/dist/server/chunks/routes/api/analysis/token.json.mjs +24 -0
- package/dist/server/chunks/routes/api/payload.json.mjs +9 -10
- package/dist/server/chunks/routes/api/projects/_project/modules.get.mjs +9 -10
- package/dist/server/chunks/routes/api/projects/catalog.get.mjs +9 -10
- package/dist/server/chunks/routes/renderer.mjs +17 -39183
- package/dist/server/chunks/routes/ws.mjs +9 -10
- package/dist/server/index.mjs +9 -10
- package/dist/server/node_modules/@babel/parser/lib/index.js +14582 -0
- package/dist/server/node_modules/@babel/parser/package.json +50 -0
- package/dist/server/node_modules/@iconify/utils/lib/colors/index.js +292 -0
- package/dist/server/node_modules/@iconify/utils/lib/colors/keywords.js +702 -0
- package/dist/server/node_modules/@iconify/utils/lib/css/common.js +76 -0
- package/dist/server/node_modules/@iconify/utils/lib/css/format.js +40 -0
- package/dist/server/node_modules/@iconify/utils/lib/css/icon.js +52 -0
- package/dist/server/node_modules/@iconify/utils/lib/css/icons.js +133 -0
- package/dist/server/node_modules/@iconify/utils/lib/customisations/bool.js +20 -0
- package/dist/server/node_modules/@iconify/utils/lib/customisations/defaults.js +15 -0
- package/dist/server/node_modules/@iconify/utils/lib/customisations/flip.js +18 -0
- package/dist/server/node_modules/@iconify/utils/lib/customisations/merge.js +18 -0
- package/dist/server/node_modules/@iconify/utils/lib/customisations/rotate.js +31 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/cleanup.js +80 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/convert.js +102 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/data.js +29 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/format.js +60 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/parse.js +50 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/regex/base.js +204 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/regex/create.js +35 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/regex/numbers.js +134 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/regex/similar.js +167 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/regex/tree.js +81 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/replace/find.js +94 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/replace/replace.js +28 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/test/components.js +78 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/test/missing.js +68 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/test/name.js +47 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/test/parse.js +105 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/test/similar.js +38 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/test/tree.js +94 -0
- package/dist/server/node_modules/@iconify/utils/lib/emoji/test/variations.js +64 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon/defaults.js +26 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon/merge.js +18 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon/name.js +58 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon/square.js +34 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon/transformations.js +13 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/convert-info.js +126 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/expand.js +21 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/get-icon.js +27 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/get-icons.js +38 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/minify.js +93 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/parse.js +48 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/tree.js +24 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/validate-basic.js +44 -0
- package/dist/server/node_modules/@iconify/utils/lib/icon-set/validate.js +125 -0
- package/dist/server/node_modules/@iconify/utils/lib/index.js +53 -0
- package/dist/server/node_modules/@iconify/utils/lib/loader/custom.js +32 -0
- package/dist/server/node_modules/@iconify/utils/lib/loader/loader.js +28 -0
- package/dist/server/node_modules/@iconify/utils/lib/loader/modern.js +42 -0
- package/dist/server/node_modules/@iconify/utils/lib/loader/utils.js +63 -0
- package/dist/server/node_modules/@iconify/utils/lib/misc/objects.js +27 -0
- package/dist/server/node_modules/@iconify/utils/lib/misc/strings.js +27 -0
- package/dist/server/node_modules/@iconify/utils/lib/misc/title.js +10 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/build.js +115 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/defs.js +32 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/encode-svg-for-css.js +15 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/html.js +10 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/id.js +42 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/inner-html.js +23 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/parse.js +69 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/pretty.js +55 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/size.js +28 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/trim.js +8 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/url.js +23 -0
- package/dist/server/node_modules/@iconify/utils/lib/svg/viewbox.js +9 -0
- package/dist/server/node_modules/@iconify/utils/package.json +118 -0
- package/dist/server/node_modules/@lonewolfyx/utils/dist/index.mjs +63 -0
- package/dist/server/node_modules/@lonewolfyx/utils/package.json +64 -0
- package/dist/server/node_modules/@vue/compiler-core/dist/compiler-core.cjs.prod.js +6763 -0
- package/dist/server/node_modules/@vue/compiler-core/package.json +58 -0
- package/dist/server/node_modules/@vue/compiler-dom/dist/compiler-dom.cjs.prod.js +689 -0
- package/dist/server/node_modules/@vue/compiler-dom/package.json +57 -0
- package/dist/server/node_modules/@vue/compiler-ssr/dist/compiler-ssr.cjs.js +1413 -0
- package/dist/server/node_modules/@vue/compiler-ssr/package.json +34 -0
- package/dist/server/node_modules/@vue/reactivity/dist/reactivity.cjs.prod.js +1877 -0
- package/dist/server/node_modules/@vue/reactivity/package.json +55 -0
- package/dist/server/node_modules/@vue/runtime-core/dist/runtime-core.cjs.prod.js +6856 -0
- package/dist/server/node_modules/@vue/runtime-core/package.json +52 -0
- package/dist/server/node_modules/@vue/runtime-dom/dist/runtime-dom.cjs.prod.js +1796 -0
- package/dist/server/node_modules/@vue/runtime-dom/package.json +60 -0
- package/dist/server/node_modules/@vue/server-renderer/dist/server-renderer.cjs.prod.js +883 -0
- package/dist/server/node_modules/@vue/server-renderer/package.json +55 -0
- package/dist/server/{chunks/_/shared.cjs.prod.mjs → node_modules/@vue/shared/dist/shared.cjs.prod.js} +76 -81
- package/dist/server/node_modules/@vue/shared/package.json +47 -0
- package/dist/server/node_modules/better-sqlite3/build/Release/better_sqlite3.node +0 -0
- package/dist/server/node_modules/better-sqlite3/lib/database.js +90 -0
- package/dist/server/node_modules/better-sqlite3/lib/index.js +3 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/aggregate.js +43 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/backup.js +67 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/function.js +31 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/inspect.js +7 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/pragma.js +12 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/serialize.js +16 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/table.js +189 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/transaction.js +78 -0
- package/dist/server/node_modules/better-sqlite3/lib/methods/wrappers.js +54 -0
- package/dist/server/node_modules/better-sqlite3/lib/sqlite-error.js +20 -0
- package/dist/server/node_modules/better-sqlite3/lib/util.js +12 -0
- package/dist/server/node_modules/better-sqlite3/package.json +59 -0
- package/dist/server/node_modules/bindings/bindings.js +221 -0
- package/dist/server/node_modules/bindings/package.json +28 -0
- package/dist/server/node_modules/chokidar/handler.js +632 -0
- package/dist/server/node_modules/chokidar/index.js +822 -0
- package/dist/server/node_modules/chokidar/package.json +63 -0
- package/dist/server/{chunks/_ → node_modules/consola/dist/chunks}/prompt.mjs +2 -1
- package/dist/server/node_modules/consola/dist/core.mjs +512 -0
- package/dist/server/node_modules/consola/dist/index.mjs +651 -0
- package/dist/server/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
- package/dist/server/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
- package/dist/server/node_modules/consola/package.json +136 -0
- package/dist/server/node_modules/devalue/index.js +4 -0
- package/dist/server/node_modules/devalue/package.json +40 -0
- package/dist/server/node_modules/devalue/src/base64.js +60 -0
- package/dist/server/node_modules/devalue/src/constants.js +7 -0
- package/dist/server/node_modules/devalue/src/parse.js +268 -0
- package/dist/server/node_modules/devalue/src/stringify.js +335 -0
- package/dist/server/node_modules/devalue/src/uneval.js +552 -0
- package/dist/server/node_modules/devalue/src/utils.js +144 -0
- package/dist/server/node_modules/entities/dist/commonjs/decode-codepoint.js +77 -0
- package/dist/server/node_modules/entities/dist/commonjs/decode.js +568 -0
- package/dist/server/node_modules/entities/dist/commonjs/generated/decode-data-html.js +7 -0
- package/dist/server/node_modules/entities/dist/commonjs/generated/decode-data-xml.js +7 -0
- package/dist/server/node_modules/entities/dist/commonjs/internal/bin-trie-flags.js +21 -0
- package/dist/server/node_modules/entities/dist/commonjs/internal/decode-shared.js +31 -0
- package/dist/server/node_modules/entities/dist/commonjs/package.json +3 -0
- package/dist/server/node_modules/entities/package.json +120 -0
- package/dist/server/node_modules/estree-walker/dist/umd/estree-walker.js +344 -0
- package/dist/server/node_modules/estree-walker/package.json +37 -0
- package/dist/server/node_modules/file-uri-to-path/index.js +66 -0
- package/dist/server/node_modules/file-uri-to-path/package.json +32 -0
- package/dist/server/node_modules/glob/dist/esm/index.min.js +4 -0
- package/dist/server/node_modules/glob/dist/esm/package.json +3 -0
- package/dist/server/node_modules/glob/package.json +98 -0
- package/dist/server/node_modules/hookable/dist/index.mjs +257 -0
- package/dist/server/node_modules/hookable/package.json +53 -0
- package/dist/server/node_modules/md5-typescript/dist/bundles/bundle.umd.js +208 -0
- package/dist/server/node_modules/md5-typescript/package.json +31 -0
- package/dist/server/node_modules/path-type/index.js +42 -0
- package/dist/server/node_modules/path-type/package.json +51 -0
- package/dist/server/node_modules/readdirp/index.js +272 -0
- package/dist/server/node_modules/readdirp/package.json +66 -0
- package/dist/server/node_modules/source-map-js/lib/array-set.js +121 -0
- package/dist/server/node_modules/source-map-js/lib/base64-vlq.js +140 -0
- package/dist/server/node_modules/source-map-js/lib/base64.js +67 -0
- package/dist/server/node_modules/source-map-js/lib/binary-search.js +111 -0
- package/dist/server/node_modules/source-map-js/lib/mapping-list.js +79 -0
- package/dist/server/node_modules/source-map-js/lib/quick-sort.js +132 -0
- package/dist/server/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
- package/dist/server/node_modules/source-map-js/lib/source-map-generator.js +444 -0
- package/dist/server/node_modules/source-map-js/lib/source-node.js +413 -0
- package/dist/server/node_modules/source-map-js/lib/util.js +594 -0
- package/dist/server/node_modules/source-map-js/package.json +71 -0
- package/dist/server/node_modules/source-map-js/source-map.js +8 -0
- package/dist/server/node_modules/ufo/dist/index.mjs +645 -0
- package/dist/server/node_modules/ufo/package.json +48 -0
- package/dist/server/node_modules/unhead/dist/parser.mjs +508 -0
- package/dist/server/node_modules/unhead/dist/plugins.mjs +101 -0
- package/dist/server/node_modules/unhead/dist/server.mjs +180 -0
- package/dist/server/node_modules/unhead/dist/shared/unhead.B5FWS6X0.mjs +207 -0
- package/dist/server/node_modules/unhead/dist/shared/unhead.BYvz9V1x.mjs +43 -0
- package/dist/server/node_modules/unhead/dist/shared/unhead.CbpEuj3y.mjs +71 -0
- package/dist/server/node_modules/unhead/dist/shared/unhead.Ct24BOby.mjs +182 -0
- package/dist/server/node_modules/unhead/dist/shared/unhead.D4vSFytZ.mjs +236 -0
- package/dist/server/node_modules/unhead/dist/shared/unhead.DQc16pHI.mjs +196 -0
- package/dist/server/node_modules/unhead/dist/shared/unhead.TxTMM7cM.mjs +166 -0
- package/dist/server/node_modules/unhead/dist/shared/unhead.yem5I2v_.mjs +38 -0
- package/dist/server/node_modules/unhead/dist/utils.mjs +5 -0
- package/dist/server/node_modules/unhead/package.json +105 -0
- package/dist/server/node_modules/vue/dist/vue.cjs.js +80 -0
- package/dist/server/node_modules/vue/dist/vue.cjs.prod.js +66 -0
- package/dist/server/node_modules/vue/index.js +7 -0
- package/dist/server/node_modules/vue/index.mjs +1 -0
- package/dist/server/node_modules/vue/package.json +112 -0
- package/dist/server/node_modules/vue/server-renderer/index.mjs +1 -0
- package/dist/server/node_modules/vue-bundle-renderer/dist/runtime.mjs +301 -0
- package/dist/server/node_modules/vue-bundle-renderer/package.json +55 -0
- package/dist/server/package.json +37 -0
- package/package.json +3 -1
- package/dist/public/_nuxt/B-VlGWDb.js +0 -21
- package/dist/public/_nuxt/C0azgqnZ.js +0 -1
- package/dist/public/_nuxt/CMNdiQCa.js +0 -1
- package/dist/public/_nuxt/CPuXQJE_.js +0 -1
- package/dist/public/_nuxt/DenksPSi.js +0 -119
- package/dist/public/_nuxt/Dkya5WaL.js +0 -9
- package/dist/public/_nuxt/HN9OZyaQ.js +0 -25
- package/dist/public/_nuxt/JtK-nXxy.js +0 -1
- package/dist/public/_nuxt/builds/meta/37e8bb21-a086-45bf-93dc-47eeeada7299.json +0 -1
- package/dist/public/_nuxt/entry.r-q4oQC0.css +0 -1
- package/dist/public/_nuxt/error-404.B0EXnOcv.css +0 -1
- package/dist/public/_nuxt/error-500.CnSNZoEG.css +0 -1
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
function flatHooks(configHooks, hooks = {}, parentName) {
|
|
2
|
+
for (const key in configHooks) {
|
|
3
|
+
const subHook = configHooks[key];
|
|
4
|
+
const name = parentName ? `${parentName}:${key}` : key;
|
|
5
|
+
if (typeof subHook === "object" && subHook !== null) flatHooks(subHook, hooks, name);
|
|
6
|
+
else if (typeof subHook === "function") hooks[name] = subHook;
|
|
7
|
+
}
|
|
8
|
+
return hooks;
|
|
9
|
+
}
|
|
10
|
+
function mergeHooks(...hooks) {
|
|
11
|
+
const finalHooks = {};
|
|
12
|
+
for (const hook of hooks) {
|
|
13
|
+
const flatenHook = flatHooks(hook);
|
|
14
|
+
for (const key in flatenHook) if (finalHooks[key]) finalHooks[key].push(flatenHook[key]);
|
|
15
|
+
else finalHooks[key] = [flatenHook[key]];
|
|
16
|
+
}
|
|
17
|
+
for (const key in finalHooks) if (finalHooks[key].length > 1) {
|
|
18
|
+
const array = finalHooks[key];
|
|
19
|
+
finalHooks[key] = (...arguments_) => serial(array, (function_) => function_(...arguments_));
|
|
20
|
+
} else finalHooks[key] = finalHooks[key][0];
|
|
21
|
+
return finalHooks;
|
|
22
|
+
}
|
|
23
|
+
function serial(tasks, function_) {
|
|
24
|
+
return tasks.reduce((promise, task) => promise.then(() => function_(task)), Promise.resolve());
|
|
25
|
+
}
|
|
26
|
+
const createTask = /* @__PURE__ */ (() => {
|
|
27
|
+
if (console.createTask) return console.createTask;
|
|
28
|
+
const defaultTask = { run: (fn) => fn() };
|
|
29
|
+
return () => defaultTask;
|
|
30
|
+
})();
|
|
31
|
+
function callHooks(hooks, args, startIndex, task) {
|
|
32
|
+
for (let i = startIndex; i < hooks.length; i += 1) try {
|
|
33
|
+
const result = task ? task.run(() => hooks[i](...args)) : hooks[i](...args);
|
|
34
|
+
if (result && typeof result.then === "function") return Promise.resolve(result).then(() => callHooks(hooks, args, i + 1, task));
|
|
35
|
+
} catch (error) {
|
|
36
|
+
return Promise.reject(error);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function serialTaskCaller(hooks, args, name) {
|
|
40
|
+
if (hooks.length > 0) return callHooks(hooks, args, 0, createTask(name));
|
|
41
|
+
}
|
|
42
|
+
function parallelTaskCaller(hooks, args, name) {
|
|
43
|
+
if (hooks.length > 0) {
|
|
44
|
+
const task = createTask(name);
|
|
45
|
+
return Promise.all(hooks.map((hook) => task.run(() => hook(...args))));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function serialCaller(hooks, arguments_) {
|
|
49
|
+
return hooks.reduce((promise, hookFunction) => promise.then(() => hookFunction(...arguments_ || [])), Promise.resolve());
|
|
50
|
+
}
|
|
51
|
+
function parallelCaller(hooks, args) {
|
|
52
|
+
return Promise.all(hooks.map((hook) => hook(...args || [])));
|
|
53
|
+
}
|
|
54
|
+
function callEachWith(callbacks, arg0) {
|
|
55
|
+
for (const callback of [...callbacks]) callback(arg0);
|
|
56
|
+
}
|
|
57
|
+
var Hookable = class {
|
|
58
|
+
_hooks;
|
|
59
|
+
_before;
|
|
60
|
+
_after;
|
|
61
|
+
_deprecatedHooks;
|
|
62
|
+
_deprecatedMessages;
|
|
63
|
+
constructor() {
|
|
64
|
+
this._hooks = {};
|
|
65
|
+
this._before = void 0;
|
|
66
|
+
this._after = void 0;
|
|
67
|
+
this._deprecatedMessages = void 0;
|
|
68
|
+
this._deprecatedHooks = {};
|
|
69
|
+
this.hook = this.hook.bind(this);
|
|
70
|
+
this.callHook = this.callHook.bind(this);
|
|
71
|
+
this.callHookWith = this.callHookWith.bind(this);
|
|
72
|
+
}
|
|
73
|
+
hook(name, function_, options = {}) {
|
|
74
|
+
if (!name || typeof function_ !== "function") return () => {};
|
|
75
|
+
const originalName = name;
|
|
76
|
+
let dep;
|
|
77
|
+
while (this._deprecatedHooks[name]) {
|
|
78
|
+
dep = this._deprecatedHooks[name];
|
|
79
|
+
name = dep.to;
|
|
80
|
+
}
|
|
81
|
+
if (dep && !options.allowDeprecated) {
|
|
82
|
+
let message = dep.message;
|
|
83
|
+
if (!message) message = `${originalName} hook has been deprecated` + (dep.to ? `, please use ${dep.to}` : "");
|
|
84
|
+
if (!this._deprecatedMessages) this._deprecatedMessages = /* @__PURE__ */ new Set();
|
|
85
|
+
if (!this._deprecatedMessages.has(message)) {
|
|
86
|
+
console.warn(message);
|
|
87
|
+
this._deprecatedMessages.add(message);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (!function_.name) try {
|
|
91
|
+
Object.defineProperty(function_, "name", {
|
|
92
|
+
get: () => "_" + name.replace(/\W+/g, "_") + "_hook_cb",
|
|
93
|
+
configurable: true
|
|
94
|
+
});
|
|
95
|
+
} catch {}
|
|
96
|
+
this._hooks[name] = this._hooks[name] || [];
|
|
97
|
+
this._hooks[name].push(function_);
|
|
98
|
+
return () => {
|
|
99
|
+
if (function_) {
|
|
100
|
+
this.removeHook(name, function_);
|
|
101
|
+
function_ = void 0;
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
hookOnce(name, function_) {
|
|
106
|
+
let _unreg;
|
|
107
|
+
let _function = (...arguments_) => {
|
|
108
|
+
if (typeof _unreg === "function") _unreg();
|
|
109
|
+
_unreg = void 0;
|
|
110
|
+
_function = void 0;
|
|
111
|
+
return function_(...arguments_);
|
|
112
|
+
};
|
|
113
|
+
_unreg = this.hook(name, _function);
|
|
114
|
+
return _unreg;
|
|
115
|
+
}
|
|
116
|
+
removeHook(name, function_) {
|
|
117
|
+
const hooks = this._hooks[name];
|
|
118
|
+
if (hooks) {
|
|
119
|
+
const index = hooks.indexOf(function_);
|
|
120
|
+
if (index !== -1) hooks.splice(index, 1);
|
|
121
|
+
if (hooks.length === 0) this._hooks[name] = void 0;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
clearHook(name) {
|
|
125
|
+
this._hooks[name] = void 0;
|
|
126
|
+
}
|
|
127
|
+
deprecateHook(name, deprecated) {
|
|
128
|
+
this._deprecatedHooks[name] = typeof deprecated === "string" ? { to: deprecated } : deprecated;
|
|
129
|
+
const _hooks = this._hooks[name] || [];
|
|
130
|
+
this._hooks[name] = void 0;
|
|
131
|
+
for (const hook of _hooks) this.hook(name, hook);
|
|
132
|
+
}
|
|
133
|
+
deprecateHooks(deprecatedHooks) {
|
|
134
|
+
for (const name in deprecatedHooks) this.deprecateHook(name, deprecatedHooks[name]);
|
|
135
|
+
}
|
|
136
|
+
addHooks(configHooks) {
|
|
137
|
+
const hooks = flatHooks(configHooks);
|
|
138
|
+
const removeFns = Object.keys(hooks).map((key) => this.hook(key, hooks[key]));
|
|
139
|
+
return () => {
|
|
140
|
+
for (const unreg of removeFns) unreg();
|
|
141
|
+
removeFns.length = 0;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
removeHooks(configHooks) {
|
|
145
|
+
const hooks = flatHooks(configHooks);
|
|
146
|
+
for (const key in hooks) this.removeHook(key, hooks[key]);
|
|
147
|
+
}
|
|
148
|
+
removeAllHooks() {
|
|
149
|
+
this._hooks = {};
|
|
150
|
+
}
|
|
151
|
+
callHook(name, ...args) {
|
|
152
|
+
return this.callHookWith(serialTaskCaller, name, args);
|
|
153
|
+
}
|
|
154
|
+
callHookParallel(name, ...args) {
|
|
155
|
+
return this.callHookWith(parallelTaskCaller, name, args);
|
|
156
|
+
}
|
|
157
|
+
callHookWith(caller, name, args) {
|
|
158
|
+
const event = this._before || this._after ? {
|
|
159
|
+
name,
|
|
160
|
+
args,
|
|
161
|
+
context: {}
|
|
162
|
+
} : void 0;
|
|
163
|
+
if (this._before) callEachWith(this._before, event);
|
|
164
|
+
const result = caller(this._hooks[name] ? [...this._hooks[name]] : [], args, name);
|
|
165
|
+
if (result instanceof Promise) return result.finally(() => {
|
|
166
|
+
if (this._after && event) callEachWith(this._after, event);
|
|
167
|
+
});
|
|
168
|
+
if (this._after && event) callEachWith(this._after, event);
|
|
169
|
+
return result;
|
|
170
|
+
}
|
|
171
|
+
beforeEach(function_) {
|
|
172
|
+
this._before = this._before || [];
|
|
173
|
+
this._before.push(function_);
|
|
174
|
+
return () => {
|
|
175
|
+
if (this._before !== void 0) {
|
|
176
|
+
const index = this._before.indexOf(function_);
|
|
177
|
+
if (index !== -1) this._before.splice(index, 1);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
afterEach(function_) {
|
|
182
|
+
this._after = this._after || [];
|
|
183
|
+
this._after.push(function_);
|
|
184
|
+
return () => {
|
|
185
|
+
if (this._after !== void 0) {
|
|
186
|
+
const index = this._after.indexOf(function_);
|
|
187
|
+
if (index !== -1) this._after.splice(index, 1);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
function createHooks() {
|
|
193
|
+
return new Hookable();
|
|
194
|
+
}
|
|
195
|
+
var HookableCore = class {
|
|
196
|
+
_hooks;
|
|
197
|
+
constructor() {
|
|
198
|
+
this._hooks = {};
|
|
199
|
+
}
|
|
200
|
+
hook(name, fn) {
|
|
201
|
+
if (!name || typeof fn !== "function") return () => {};
|
|
202
|
+
this._hooks[name] = this._hooks[name] || [];
|
|
203
|
+
this._hooks[name].push(fn);
|
|
204
|
+
return () => {
|
|
205
|
+
if (fn) {
|
|
206
|
+
this.removeHook(name, fn);
|
|
207
|
+
fn = void 0;
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
removeHook(name, function_) {
|
|
212
|
+
const hooks = this._hooks[name];
|
|
213
|
+
if (hooks) {
|
|
214
|
+
const index = hooks.indexOf(function_);
|
|
215
|
+
if (index !== -1) hooks.splice(index, 1);
|
|
216
|
+
if (hooks.length === 0) this._hooks[name] = void 0;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
callHook(name, ...args) {
|
|
220
|
+
const hooks = this._hooks[name];
|
|
221
|
+
if (!hooks || hooks.length === 0) return;
|
|
222
|
+
return callHooks(hooks, args, 0);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
const isBrowser = typeof window !== "undefined";
|
|
226
|
+
function createDebugger(hooks, _options = {}) {
|
|
227
|
+
const options = {
|
|
228
|
+
inspect: isBrowser,
|
|
229
|
+
group: isBrowser,
|
|
230
|
+
filter: () => true,
|
|
231
|
+
..._options
|
|
232
|
+
};
|
|
233
|
+
const _filter = options.filter;
|
|
234
|
+
const filter = typeof _filter === "string" ? (name) => name.startsWith(_filter) : _filter;
|
|
235
|
+
const _tag = options.tag ? `[${options.tag}] ` : "";
|
|
236
|
+
const logPrefix = (event) => _tag + event.name + "".padEnd(event._id, "\0");
|
|
237
|
+
const _idCtr = {};
|
|
238
|
+
const unsubscribeBefore = hooks.beforeEach((event) => {
|
|
239
|
+
if (filter !== void 0 && !filter(event.name)) return;
|
|
240
|
+
_idCtr[event.name] = _idCtr[event.name] || 0;
|
|
241
|
+
event._id = _idCtr[event.name]++;
|
|
242
|
+
console.time(logPrefix(event));
|
|
243
|
+
});
|
|
244
|
+
const unsubscribeAfter = hooks.afterEach((event) => {
|
|
245
|
+
if (filter !== void 0 && !filter(event.name)) return;
|
|
246
|
+
if (options.group) console.groupCollapsed(event.name);
|
|
247
|
+
if (options.inspect) console.timeLog(logPrefix(event), event.args);
|
|
248
|
+
else console.timeEnd(logPrefix(event));
|
|
249
|
+
if (options.group) console.groupEnd();
|
|
250
|
+
_idCtr[event.name]--;
|
|
251
|
+
});
|
|
252
|
+
return { close: () => {
|
|
253
|
+
unsubscribeBefore();
|
|
254
|
+
unsubscribeAfter();
|
|
255
|
+
} };
|
|
256
|
+
}
|
|
257
|
+
export { Hookable, HookableCore, createDebugger, createHooks, flatHooks, mergeHooks, parallelCaller, serial, serialCaller };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hookable",
|
|
3
|
+
"version": "6.1.1",
|
|
4
|
+
"description": "Awaitable hook system",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"hook",
|
|
7
|
+
"hookable",
|
|
8
|
+
"plugin",
|
|
9
|
+
"tapable",
|
|
10
|
+
"tappable"
|
|
11
|
+
],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"repository": "unjs/hookable",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"main": "./dist/index.mjs",
|
|
20
|
+
"types": "./dist/index.d.mts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": "./dist/index.mjs"
|
|
23
|
+
},
|
|
24
|
+
"scripts": {
|
|
25
|
+
"bench": "node --expose-gc --allow-natives-syntax test/bench.ts",
|
|
26
|
+
"build": "obuild src/index.ts",
|
|
27
|
+
"dev": "vitest",
|
|
28
|
+
"lint": "oxlint . && oxfmt --check src test",
|
|
29
|
+
"lint:fix": "oxlint . --fix && oxfmt src test",
|
|
30
|
+
"prepublish": "pnpm build",
|
|
31
|
+
"release": "pnpm test && pnpm build && changelogen --release --publish --push",
|
|
32
|
+
"test": "pnpm lint && vitest run --coverage",
|
|
33
|
+
"test:types": "tsgo --noEmit"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/node": "^25.6.0",
|
|
37
|
+
"@typescript/native-preview": "^7.0.0-dev.20260414.1",
|
|
38
|
+
"@vitest/coverage-v8": "^4.1.4",
|
|
39
|
+
"changelogen": "^0.6.2",
|
|
40
|
+
"esbuild": "^0.28.0",
|
|
41
|
+
"eslint-config-unjs": "^0.6.2",
|
|
42
|
+
"expect-type": "^1.3.0",
|
|
43
|
+
"hookable-prev": "npm:hookable@^6.1.0",
|
|
44
|
+
"mitata": "^1.0.34",
|
|
45
|
+
"obuild": "^0.4.33",
|
|
46
|
+
"oxfmt": "^0.45.0",
|
|
47
|
+
"oxlint": "^1.60.0",
|
|
48
|
+
"typescript": "^6.0.2",
|
|
49
|
+
"vite": "^8.0.8",
|
|
50
|
+
"vitest": "^4.1.4"
|
|
51
|
+
},
|
|
52
|
+
"packageManager": "pnpm@10.33.0"
|
|
53
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
4
|
+
(factory((global.bundle = global.bundle || {})));
|
|
5
|
+
}(this, (function (exports) { 'use strict';
|
|
6
|
+
|
|
7
|
+
var Md5 = /** @class */ (function () {
|
|
8
|
+
function Md5() {
|
|
9
|
+
}
|
|
10
|
+
Md5.AddUnsigned = function (lX, lY) {
|
|
11
|
+
var lX4, lY4, lX8, lY8, lResult;
|
|
12
|
+
lX8 = (lX & 0x80000000);
|
|
13
|
+
lY8 = (lY & 0x80000000);
|
|
14
|
+
lX4 = (lX & 0x40000000);
|
|
15
|
+
lY4 = (lY & 0x40000000);
|
|
16
|
+
lResult = (lX & 0x3FFFFFFF) + (lY & 0x3FFFFFFF);
|
|
17
|
+
if (!!(lX4 & lY4)) {
|
|
18
|
+
return (lResult ^ 0x80000000 ^ lX8 ^ lY8);
|
|
19
|
+
}
|
|
20
|
+
if (!!(lX4 | lY4)) {
|
|
21
|
+
if (!!(lResult & 0x40000000)) {
|
|
22
|
+
return (lResult ^ 0xC0000000 ^ lX8 ^ lY8);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
return (lResult ^ 0x40000000 ^ lX8 ^ lY8);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return (lResult ^ lX8 ^ lY8);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
Md5.FF = function (a, b, c, d, x, s, ac) {
|
|
33
|
+
a = this.AddUnsigned(a, this.AddUnsigned(this.AddUnsigned(this.F(b, c, d), x), ac));
|
|
34
|
+
return this.AddUnsigned(this.RotateLeft(a, s), b);
|
|
35
|
+
};
|
|
36
|
+
Md5.GG = function (a, b, c, d, x, s, ac) {
|
|
37
|
+
a = this.AddUnsigned(a, this.AddUnsigned(this.AddUnsigned(this.G(b, c, d), x), ac));
|
|
38
|
+
return this.AddUnsigned(this.RotateLeft(a, s), b);
|
|
39
|
+
};
|
|
40
|
+
Md5.HH = function (a, b, c, d, x, s, ac) {
|
|
41
|
+
a = this.AddUnsigned(a, this.AddUnsigned(this.AddUnsigned(this.H(b, c, d), x), ac));
|
|
42
|
+
return this.AddUnsigned(this.RotateLeft(a, s), b);
|
|
43
|
+
};
|
|
44
|
+
Md5.II = function (a, b, c, d, x, s, ac) {
|
|
45
|
+
a = this.AddUnsigned(a, this.AddUnsigned(this.AddUnsigned(this.I(b, c, d), x), ac));
|
|
46
|
+
return this.AddUnsigned(this.RotateLeft(a, s), b);
|
|
47
|
+
};
|
|
48
|
+
Md5.ConvertToWordArray = function (string) {
|
|
49
|
+
var lWordCount, lMessageLength = string.length, lNumberOfWords_temp1 = lMessageLength + 8, lNumberOfWords_temp2 = (lNumberOfWords_temp1 - (lNumberOfWords_temp1 % 64)) / 64, lNumberOfWords = (lNumberOfWords_temp2 + 1) * 16, lWordArray = Array(lNumberOfWords - 1), lBytePosition = 0, lByteCount = 0;
|
|
50
|
+
while (lByteCount < lMessageLength) {
|
|
51
|
+
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
|
|
52
|
+
lBytePosition = (lByteCount % 4) * 8;
|
|
53
|
+
lWordArray[lWordCount] = (lWordArray[lWordCount] | (string.charCodeAt(lByteCount) << lBytePosition));
|
|
54
|
+
lByteCount++;
|
|
55
|
+
}
|
|
56
|
+
lWordCount = (lByteCount - (lByteCount % 4)) / 4;
|
|
57
|
+
lBytePosition = (lByteCount % 4) * 8;
|
|
58
|
+
lWordArray[lWordCount] = lWordArray[lWordCount] | (0x80 << lBytePosition);
|
|
59
|
+
lWordArray[lNumberOfWords - 2] = lMessageLength << 3;
|
|
60
|
+
lWordArray[lNumberOfWords - 1] = lMessageLength >>> 29;
|
|
61
|
+
return lWordArray;
|
|
62
|
+
};
|
|
63
|
+
Md5.WordToHex = function (lValue) {
|
|
64
|
+
var WordToHexValue = "", WordToHexValue_temp = "", lByte, lCount;
|
|
65
|
+
for (lCount = 0; lCount <= 3; lCount++) {
|
|
66
|
+
lByte = (lValue >>> (lCount * 8)) & 255;
|
|
67
|
+
WordToHexValue_temp = "0" + lByte.toString(16);
|
|
68
|
+
WordToHexValue = WordToHexValue + WordToHexValue_temp.substr(WordToHexValue_temp.length - 2, 2);
|
|
69
|
+
}
|
|
70
|
+
return WordToHexValue;
|
|
71
|
+
};
|
|
72
|
+
Md5.Utf8Encode = function (string) {
|
|
73
|
+
var utftext = "", c;
|
|
74
|
+
string = string.replace(/\r\n/g, "\n");
|
|
75
|
+
for (var n = 0; n < string.length; n++) {
|
|
76
|
+
c = string.charCodeAt(n);
|
|
77
|
+
if (c < 128) {
|
|
78
|
+
utftext += String.fromCharCode(c);
|
|
79
|
+
}
|
|
80
|
+
else if ((c > 127) && (c < 2048)) {
|
|
81
|
+
utftext += String.fromCharCode((c >> 6) | 192);
|
|
82
|
+
utftext += String.fromCharCode((c & 63) | 128);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
utftext += String.fromCharCode((c >> 12) | 224);
|
|
86
|
+
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
|
|
87
|
+
utftext += String.fromCharCode((c & 63) | 128);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return utftext;
|
|
91
|
+
};
|
|
92
|
+
Md5.init = function (string) {
|
|
93
|
+
var temp;
|
|
94
|
+
if (typeof string !== 'string')
|
|
95
|
+
string = JSON.stringify(string);
|
|
96
|
+
this._string = this.Utf8Encode(string);
|
|
97
|
+
this.x = this.ConvertToWordArray(this._string);
|
|
98
|
+
this.a = 0x67452301;
|
|
99
|
+
this.b = 0xEFCDAB89;
|
|
100
|
+
this.c = 0x98BADCFE;
|
|
101
|
+
this.d = 0x10325476;
|
|
102
|
+
for (this.k = 0; this.k < this.x.length; this.k += 16) {
|
|
103
|
+
this.AA = this.a;
|
|
104
|
+
this.BB = this.b;
|
|
105
|
+
this.CC = this.c;
|
|
106
|
+
this.DD = this.d;
|
|
107
|
+
this.a = this.FF(this.a, this.b, this.c, this.d, this.x[this.k], this.S11, 0xD76AA478);
|
|
108
|
+
this.d = this.FF(this.d, this.a, this.b, this.c, this.x[this.k + 1], this.S12, 0xE8C7B756);
|
|
109
|
+
this.c = this.FF(this.c, this.d, this.a, this.b, this.x[this.k + 2], this.S13, 0x242070DB);
|
|
110
|
+
this.b = this.FF(this.b, this.c, this.d, this.a, this.x[this.k + 3], this.S14, 0xC1BDCEEE);
|
|
111
|
+
this.a = this.FF(this.a, this.b, this.c, this.d, this.x[this.k + 4], this.S11, 0xF57C0FAF);
|
|
112
|
+
this.d = this.FF(this.d, this.a, this.b, this.c, this.x[this.k + 5], this.S12, 0x4787C62A);
|
|
113
|
+
this.c = this.FF(this.c, this.d, this.a, this.b, this.x[this.k + 6], this.S13, 0xA8304613);
|
|
114
|
+
this.b = this.FF(this.b, this.c, this.d, this.a, this.x[this.k + 7], this.S14, 0xFD469501);
|
|
115
|
+
this.a = this.FF(this.a, this.b, this.c, this.d, this.x[this.k + 8], this.S11, 0x698098D8);
|
|
116
|
+
this.d = this.FF(this.d, this.a, this.b, this.c, this.x[this.k + 9], this.S12, 0x8B44F7AF);
|
|
117
|
+
this.c = this.FF(this.c, this.d, this.a, this.b, this.x[this.k + 10], this.S13, 0xFFFF5BB1);
|
|
118
|
+
this.b = this.FF(this.b, this.c, this.d, this.a, this.x[this.k + 11], this.S14, 0x895CD7BE);
|
|
119
|
+
this.a = this.FF(this.a, this.b, this.c, this.d, this.x[this.k + 12], this.S11, 0x6B901122);
|
|
120
|
+
this.d = this.FF(this.d, this.a, this.b, this.c, this.x[this.k + 13], this.S12, 0xFD987193);
|
|
121
|
+
this.c = this.FF(this.c, this.d, this.a, this.b, this.x[this.k + 14], this.S13, 0xA679438E);
|
|
122
|
+
this.b = this.FF(this.b, this.c, this.d, this.a, this.x[this.k + 15], this.S14, 0x49B40821);
|
|
123
|
+
this.a = this.GG(this.a, this.b, this.c, this.d, this.x[this.k + 1], this.S21, 0xF61E2562);
|
|
124
|
+
this.d = this.GG(this.d, this.a, this.b, this.c, this.x[this.k + 6], this.S22, 0xC040B340);
|
|
125
|
+
this.c = this.GG(this.c, this.d, this.a, this.b, this.x[this.k + 11], this.S23, 0x265E5A51);
|
|
126
|
+
this.b = this.GG(this.b, this.c, this.d, this.a, this.x[this.k], this.S24, 0xE9B6C7AA);
|
|
127
|
+
this.a = this.GG(this.a, this.b, this.c, this.d, this.x[this.k + 5], this.S21, 0xD62F105D);
|
|
128
|
+
this.d = this.GG(this.d, this.a, this.b, this.c, this.x[this.k + 10], this.S22, 0x2441453);
|
|
129
|
+
this.c = this.GG(this.c, this.d, this.a, this.b, this.x[this.k + 15], this.S23, 0xD8A1E681);
|
|
130
|
+
this.b = this.GG(this.b, this.c, this.d, this.a, this.x[this.k + 4], this.S24, 0xE7D3FBC8);
|
|
131
|
+
this.a = this.GG(this.a, this.b, this.c, this.d, this.x[this.k + 9], this.S21, 0x21E1CDE6);
|
|
132
|
+
this.d = this.GG(this.d, this.a, this.b, this.c, this.x[this.k + 14], this.S22, 0xC33707D6);
|
|
133
|
+
this.c = this.GG(this.c, this.d, this.a, this.b, this.x[this.k + 3], this.S23, 0xF4D50D87);
|
|
134
|
+
this.b = this.GG(this.b, this.c, this.d, this.a, this.x[this.k + 8], this.S24, 0x455A14ED);
|
|
135
|
+
this.a = this.GG(this.a, this.b, this.c, this.d, this.x[this.k + 13], this.S21, 0xA9E3E905);
|
|
136
|
+
this.d = this.GG(this.d, this.a, this.b, this.c, this.x[this.k + 2], this.S22, 0xFCEFA3F8);
|
|
137
|
+
this.c = this.GG(this.c, this.d, this.a, this.b, this.x[this.k + 7], this.S23, 0x676F02D9);
|
|
138
|
+
this.b = this.GG(this.b, this.c, this.d, this.a, this.x[this.k + 12], this.S24, 0x8D2A4C8A);
|
|
139
|
+
this.a = this.HH(this.a, this.b, this.c, this.d, this.x[this.k + 5], this.S31, 0xFFFA3942);
|
|
140
|
+
this.d = this.HH(this.d, this.a, this.b, this.c, this.x[this.k + 8], this.S32, 0x8771F681);
|
|
141
|
+
this.c = this.HH(this.c, this.d, this.a, this.b, this.x[this.k + 11], this.S33, 0x6D9D6122);
|
|
142
|
+
this.b = this.HH(this.b, this.c, this.d, this.a, this.x[this.k + 14], this.S34, 0xFDE5380C);
|
|
143
|
+
this.a = this.HH(this.a, this.b, this.c, this.d, this.x[this.k + 1], this.S31, 0xA4BEEA44);
|
|
144
|
+
this.d = this.HH(this.d, this.a, this.b, this.c, this.x[this.k + 4], this.S32, 0x4BDECFA9);
|
|
145
|
+
this.c = this.HH(this.c, this.d, this.a, this.b, this.x[this.k + 7], this.S33, 0xF6BB4B60);
|
|
146
|
+
this.b = this.HH(this.b, this.c, this.d, this.a, this.x[this.k + 10], this.S34, 0xBEBFBC70);
|
|
147
|
+
this.a = this.HH(this.a, this.b, this.c, this.d, this.x[this.k + 13], this.S31, 0x289B7EC6);
|
|
148
|
+
this.d = this.HH(this.d, this.a, this.b, this.c, this.x[this.k], this.S32, 0xEAA127FA);
|
|
149
|
+
this.c = this.HH(this.c, this.d, this.a, this.b, this.x[this.k + 3], this.S33, 0xD4EF3085);
|
|
150
|
+
this.b = this.HH(this.b, this.c, this.d, this.a, this.x[this.k + 6], this.S34, 0x4881D05);
|
|
151
|
+
this.a = this.HH(this.a, this.b, this.c, this.d, this.x[this.k + 9], this.S31, 0xD9D4D039);
|
|
152
|
+
this.d = this.HH(this.d, this.a, this.b, this.c, this.x[this.k + 12], this.S32, 0xE6DB99E5);
|
|
153
|
+
this.c = this.HH(this.c, this.d, this.a, this.b, this.x[this.k + 15], this.S33, 0x1FA27CF8);
|
|
154
|
+
this.b = this.HH(this.b, this.c, this.d, this.a, this.x[this.k + 2], this.S34, 0xC4AC5665);
|
|
155
|
+
this.a = this.II(this.a, this.b, this.c, this.d, this.x[this.k], this.S41, 0xF4292244);
|
|
156
|
+
this.d = this.II(this.d, this.a, this.b, this.c, this.x[this.k + 7], this.S42, 0x432AFF97);
|
|
157
|
+
this.c = this.II(this.c, this.d, this.a, this.b, this.x[this.k + 14], this.S43, 0xAB9423A7);
|
|
158
|
+
this.b = this.II(this.b, this.c, this.d, this.a, this.x[this.k + 5], this.S44, 0xFC93A039);
|
|
159
|
+
this.a = this.II(this.a, this.b, this.c, this.d, this.x[this.k + 12], this.S41, 0x655B59C3);
|
|
160
|
+
this.d = this.II(this.d, this.a, this.b, this.c, this.x[this.k + 3], this.S42, 0x8F0CCC92);
|
|
161
|
+
this.c = this.II(this.c, this.d, this.a, this.b, this.x[this.k + 10], this.S43, 0xFFEFF47D);
|
|
162
|
+
this.b = this.II(this.b, this.c, this.d, this.a, this.x[this.k + 1], this.S44, 0x85845DD1);
|
|
163
|
+
this.a = this.II(this.a, this.b, this.c, this.d, this.x[this.k + 8], this.S41, 0x6FA87E4F);
|
|
164
|
+
this.d = this.II(this.d, this.a, this.b, this.c, this.x[this.k + 15], this.S42, 0xFE2CE6E0);
|
|
165
|
+
this.c = this.II(this.c, this.d, this.a, this.b, this.x[this.k + 6], this.S43, 0xA3014314);
|
|
166
|
+
this.b = this.II(this.b, this.c, this.d, this.a, this.x[this.k + 13], this.S44, 0x4E0811A1);
|
|
167
|
+
this.a = this.II(this.a, this.b, this.c, this.d, this.x[this.k + 4], this.S41, 0xF7537E82);
|
|
168
|
+
this.d = this.II(this.d, this.a, this.b, this.c, this.x[this.k + 11], this.S42, 0xBD3AF235);
|
|
169
|
+
this.c = this.II(this.c, this.d, this.a, this.b, this.x[this.k + 2], this.S43, 0x2AD7D2BB);
|
|
170
|
+
this.b = this.II(this.b, this.c, this.d, this.a, this.x[this.k + 9], this.S44, 0xEB86D391);
|
|
171
|
+
this.a = this.AddUnsigned(this.a, this.AA);
|
|
172
|
+
this.b = this.AddUnsigned(this.b, this.BB);
|
|
173
|
+
this.c = this.AddUnsigned(this.c, this.CC);
|
|
174
|
+
this.d = this.AddUnsigned(this.d, this.DD);
|
|
175
|
+
}
|
|
176
|
+
temp = this.WordToHex(this.a) + this.WordToHex(this.b) + this.WordToHex(this.c) + this.WordToHex(this.d);
|
|
177
|
+
return temp.toLowerCase();
|
|
178
|
+
};
|
|
179
|
+
Md5.x = Array();
|
|
180
|
+
Md5.S11 = 7;
|
|
181
|
+
Md5.S12 = 12;
|
|
182
|
+
Md5.S13 = 17;
|
|
183
|
+
Md5.S14 = 22;
|
|
184
|
+
Md5.S21 = 5;
|
|
185
|
+
Md5.S22 = 9;
|
|
186
|
+
Md5.S23 = 14;
|
|
187
|
+
Md5.S24 = 20;
|
|
188
|
+
Md5.S31 = 4;
|
|
189
|
+
Md5.S32 = 11;
|
|
190
|
+
Md5.S33 = 16;
|
|
191
|
+
Md5.S34 = 23;
|
|
192
|
+
Md5.S41 = 6;
|
|
193
|
+
Md5.S42 = 10;
|
|
194
|
+
Md5.S43 = 15;
|
|
195
|
+
Md5.S44 = 21;
|
|
196
|
+
Md5.RotateLeft = function (lValue, iShiftBits) { return (lValue << iShiftBits) | (lValue >>> (32 - iShiftBits)); };
|
|
197
|
+
Md5.F = function (x, y, z) { return (x & y) | ((~x) & z); };
|
|
198
|
+
Md5.G = function (x, y, z) { return (x & z) | (y & (~z)); };
|
|
199
|
+
Md5.H = function (x, y, z) { return (x ^ y ^ z); };
|
|
200
|
+
Md5.I = function (x, y, z) { return (y ^ (x | (~z))); };
|
|
201
|
+
return Md5;
|
|
202
|
+
}());
|
|
203
|
+
|
|
204
|
+
exports.Md5 = Md5;
|
|
205
|
+
|
|
206
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
207
|
+
|
|
208
|
+
})));
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "md5-typescript",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "Md5 typescript",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"transpile": "ngc",
|
|
7
|
+
"package": "rollup -c",
|
|
8
|
+
"minify": "uglifyjs dist/bundles/bundle.umd.js --screw-ie8 --compress --mangle --comments --output dist/bundles/bundle.umd.min.js",
|
|
9
|
+
"build": "npm run transpile && npm run package && npm run minify"
|
|
10
|
+
},
|
|
11
|
+
"main": "dist/bundles/bundle.umd.js",
|
|
12
|
+
"typings": "dist/index.d.ts",
|
|
13
|
+
"module": "dist/index.js",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/Hipparch/Md5-typescript.git"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"md5",
|
|
20
|
+
"typescript.angular",
|
|
21
|
+
"angularjs.angular",
|
|
22
|
+
"2",
|
|
23
|
+
"typescript"
|
|
24
|
+
],
|
|
25
|
+
"author": "Hipparchus",
|
|
26
|
+
"license": "ISC",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/Hipparch/Md5-typescript/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/Hipparch/Md5-typescript#readme"
|
|
31
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import fsPromises from 'node:fs/promises';
|
|
3
|
+
|
|
4
|
+
async function isType(fsStatType, statsMethodName, filePath) {
|
|
5
|
+
if (typeof filePath !== 'string') {
|
|
6
|
+
throw new TypeError(`Expected a string, got ${typeof filePath}`);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
const stats = await fsPromises[fsStatType](filePath);
|
|
11
|
+
return stats[statsMethodName]();
|
|
12
|
+
} catch (error) {
|
|
13
|
+
if (error.code === 'ENOENT') {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function isTypeSync(fsStatType, statsMethodName, filePath) {
|
|
22
|
+
if (typeof filePath !== 'string') {
|
|
23
|
+
throw new TypeError(`Expected a string, got ${typeof filePath}`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
try {
|
|
27
|
+
return fs[fsStatType](filePath)[statsMethodName]();
|
|
28
|
+
} catch (error) {
|
|
29
|
+
if (error.code === 'ENOENT') {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const isFile = isType.bind(undefined, 'stat', 'isFile');
|
|
38
|
+
export const isDirectory = isType.bind(undefined, 'stat', 'isDirectory');
|
|
39
|
+
export const isSymlink = isType.bind(undefined, 'lstat', 'isSymbolicLink');
|
|
40
|
+
export const isFileSync = isTypeSync.bind(undefined, 'statSync', 'isFile');
|
|
41
|
+
export const isDirectorySync = isTypeSync.bind(undefined, 'statSync', 'isDirectory');
|
|
42
|
+
export const isSymlinkSync = isTypeSync.bind(undefined, 'lstatSync', 'isSymbolicLink');
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "path-type",
|
|
3
|
+
"version": "6.0.0",
|
|
4
|
+
"description": "Check if a path is a file, directory, or symlink",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "sindresorhus/path-type",
|
|
7
|
+
"funding": "https://github.com/sponsors/sindresorhus",
|
|
8
|
+
"author": {
|
|
9
|
+
"name": "Sindre Sorhus",
|
|
10
|
+
"email": "sindresorhus@gmail.com",
|
|
11
|
+
"url": "https://sindresorhus.com"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"exports": {
|
|
15
|
+
"types": "./index.d.ts",
|
|
16
|
+
"default": "./index.js"
|
|
17
|
+
},
|
|
18
|
+
"sideEffects": false,
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=18"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "xo && nyc ava && tsd"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"index.js",
|
|
27
|
+
"index.d.ts"
|
|
28
|
+
],
|
|
29
|
+
"keywords": [
|
|
30
|
+
"path",
|
|
31
|
+
"fs",
|
|
32
|
+
"type",
|
|
33
|
+
"is",
|
|
34
|
+
"check",
|
|
35
|
+
"directory",
|
|
36
|
+
"file",
|
|
37
|
+
"filepath",
|
|
38
|
+
"symlink",
|
|
39
|
+
"symbolic",
|
|
40
|
+
"link",
|
|
41
|
+
"stat",
|
|
42
|
+
"stats",
|
|
43
|
+
"filesystem"
|
|
44
|
+
],
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"ava": "^6.1.3",
|
|
47
|
+
"nyc": "^17.0.0",
|
|
48
|
+
"tsd": "^0.31.1",
|
|
49
|
+
"xo": "^0.59.2"
|
|
50
|
+
}
|
|
51
|
+
}
|