@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 CHANGED
@@ -5,9 +5,9 @@
5
5
 
6
6
  [![npm version][npm-version-src]][npm-version-href]
7
7
  [![npm downloads][npm-downloads-src]][npm-downloads-href]
8
- [![Coverage][coverage-src]][coverage-href]
8
+ [![Stars][stars-src]][stars-href]
9
9
  [![License][license-src]][license-href]
10
- [![Sponsors][sponsors-src]][sponsors-href]
10
+ [![Node][node-src]][node-href]
11
11
 
12
12
  <h4>
13
13
  <a href="https://kubb.dev" target="_blank">Documentation</a>
@@ -149,13 +149,13 @@ Kubb is an open source project, and its development is funded entirely by sponso
149
149
 
150
150
  <!-- Badges -->
151
151
 
152
- [npm-version-src]: https://img.shields.io/npm/v/@kubb/ast?flat&colorA=18181B&colorB=f58517
153
- [npm-version-href]: https://npmjs.com/package/@kubb/ast
154
- [npm-downloads-src]: https://img.shields.io/npm/dm/@kubb/ast?flat&colorA=18181B&colorB=f58517
155
- [npm-downloads-href]: https://npmjs.com/package/@kubb/ast
156
- [license-src]: https://img.shields.io/github/license/kubb-labs/kubb.svg?flat&colorA=18181B&colorB=f58517
152
+ [npm-version-src]: https://shieldcn.dev/npm/v/@kubb/ast.svg?variant=secondary&size=xs&theme=zinc&mode=dark
153
+ [npm-version-href]: https://npmx.dev/package/@kubb/ast
154
+ [npm-downloads-src]: https://shieldcn.dev/npm/dm/@kubb/ast.svg?variant=secondary&size=xs&theme=zinc&mode=dark
155
+ [npm-downloads-href]: https://npmx.dev/package/@kubb/ast
156
+ [stars-src]: https://shieldcn.dev/github/stars/kubb-labs/kubb.svg?variant=secondary&size=xs&theme=zinc&mode=dark
157
+ [stars-href]: https://github.com/kubb-labs/kubb
158
+ [license-src]: https://shieldcn.dev/npm/license/@kubb/ast.svg?variant=secondary&size=xs&theme=zinc
157
159
  [license-href]: https://github.com/kubb-labs/kubb/blob/main/LICENSE
158
- [coverage-src]: https://img.shields.io/codecov/c/github/kubb-labs/kubb?style=flat&colorA=18181B&colorB=f58517
159
- [coverage-href]: https://www.npmjs.com/package/@kubb/ast
160
- [sponsors-src]: https://img.shields.io/github/sponsors/stijnvanhulle?style=flat&colorA=18181B&colorB=f58517
161
- [sponsors-href]: https://github.com/sponsors/stijnvanhulle/
160
+ [node-src]: https://shieldcn.dev/npm/node/@kubb/ast.svg?variant=secondary&size=xs&theme=zinc&mode=dark
161
+ [node-href]: https://npmx.dev/package/@kubb/ast
package/dist/index.cjs CHANGED
@@ -1053,7 +1053,7 @@ function sortKey(node) {
1053
1053
  const isArray = Array.isArray(node.name) ? "1" : "0";
1054
1054
  const typeOnly = node.isTypeOnly ? "0" : "1";
1055
1055
  const hasName = node.name != null ? "1" : "0";
1056
- const name = Array.isArray(node.name) ? [...node.name].sort().join("\0") : node.name ?? "";
1056
+ const name = Array.isArray(node.name) ? node.name.toSorted().join("\0") : node.name ?? "";
1057
1057
  return `${isArray}:${typeOnly}:${node.path}:${hasName}:${name}`;
1058
1058
  }
1059
1059
  /**
@@ -1844,7 +1844,7 @@ function createFile(input) {
1844
1844
  return {
1845
1845
  kind: "File",
1846
1846
  ...input,
1847
- id: (0, node_crypto.createHash)("sha256").update(input.path).digest("hex"),
1847
+ id: (0, node_crypto.hash)("sha256", input.path, "hex"),
1848
1848
  name: trimExtName(input.baseName),
1849
1849
  extname,
1850
1850
  imports: resolvedImports,
@@ -2289,7 +2289,7 @@ const signatureCache = /* @__PURE__ */ new WeakMap();
2289
2289
  function signatureOf(node) {
2290
2290
  const cached = signatureCache.get(node);
2291
2291
  if (cached !== void 0) return cached;
2292
- const signature = (0, node_crypto.createHash)("sha256").update(describeShape(node)).digest("hex");
2292
+ const signature = (0, node_crypto.hash)("sha256", describeShape(node), "hex");
2293
2293
  signatureCache.set(node, signature);
2294
2294
  return signature;
2295
2295
  }