@kubb/ast 5.0.0-beta.40 → 5.0.0-beta.42
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/README.md +11 -11
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/factory.ts +2 -2
- package/src/signature.ts +2 -2
- package/src/utils.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./chunk-C0LytTxp.js";
|
|
2
|
-
import {
|
|
2
|
+
import { hash } from "node:crypto";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
//#region src/constants.ts
|
|
5
5
|
const visitorDepths = {
|
|
@@ -1030,7 +1030,7 @@ function sortKey(node) {
|
|
|
1030
1030
|
const isArray = Array.isArray(node.name) ? "1" : "0";
|
|
1031
1031
|
const typeOnly = node.isTypeOnly ? "0" : "1";
|
|
1032
1032
|
const hasName = node.name != null ? "1" : "0";
|
|
1033
|
-
const name = Array.isArray(node.name) ?
|
|
1033
|
+
const name = Array.isArray(node.name) ? node.name.toSorted().join("\0") : node.name ?? "";
|
|
1034
1034
|
return `${isArray}:${typeOnly}:${node.path}:${hasName}:${name}`;
|
|
1035
1035
|
}
|
|
1036
1036
|
/**
|
|
@@ -1821,7 +1821,7 @@ function createFile(input) {
|
|
|
1821
1821
|
return {
|
|
1822
1822
|
kind: "File",
|
|
1823
1823
|
...input,
|
|
1824
|
-
id:
|
|
1824
|
+
id: hash("sha256", input.path, "hex"),
|
|
1825
1825
|
name: trimExtName(input.baseName),
|
|
1826
1826
|
extname,
|
|
1827
1827
|
imports: resolvedImports,
|
|
@@ -2266,7 +2266,7 @@ const signatureCache = /* @__PURE__ */ new WeakMap();
|
|
|
2266
2266
|
function signatureOf(node) {
|
|
2267
2267
|
const cached = signatureCache.get(node);
|
|
2268
2268
|
if (cached !== void 0) return cached;
|
|
2269
|
-
const signature =
|
|
2269
|
+
const signature = hash("sha256", describeShape(node), "hex");
|
|
2270
2270
|
signatureCache.set(node, signature);
|
|
2271
2271
|
return signature;
|
|
2272
2272
|
}
|