@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/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./chunk-C0LytTxp.js";
2
- import { createHash } from "node:crypto";
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) ? [...node.name].sort().join("\0") : 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: createHash("sha256").update(input.path).digest("hex"),
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 = createHash("sha256").update(describeShape(node)).digest("hex");
2269
+ const signature = hash("sha256", describeShape(node), "hex");
2270
2270
  signatureCache.set(node, signature);
2271
2271
  return signature;
2272
2272
  }