ts-graphviz 3.0.8 → 3.0.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # ts-graphviz
2
2
 
3
+ ## 3.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1763](https://github.com/ts-graphviz/ts-graphviz/pull/1763) [`24cc46e`](https://github.com/ts-graphviz/ts-graphviz/commit/24cc46ebf0078440fa498f89b21e7224725c16b6) Thanks [@kamiazya](https://github.com/kamiazya)! - Options are read from their own properties only, and values are always written as DOT text:
8
+
9
+ - `toStream` / `toFile`, `parse`, `stringify`, `fromModel` / `toModel`, `fromDot` and `toDot` read only the options their caller set. `toStream` / `toFile` also pass Node.js only the options and environment they set.
10
+ - Attribute keys and values, IDs, ports, compass points and comments are written so that DOT reads them back as the same text. A string of the form `<…>` is written as an HTML-like label only when it is well-formed; otherwise it is written as a quoted string.
11
+ - Writing attribute values and reading block comments are faster on large inputs.
12
+
13
+ - Updated dependencies [[`24cc46e`](https://github.com/ts-graphviz/ts-graphviz/commit/24cc46ebf0078440fa498f89b21e7224725c16b6)]:
14
+ - @ts-graphviz/adapter@3.0.8
15
+ - @ts-graphviz/ast@3.0.8
16
+ - @ts-graphviz/core@3.0.9
17
+
3
18
  ## 3.0.8
4
19
 
5
20
  ### Patch Changes
package/README.md CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  [![GitHub](https://img.shields.io/badge/-GitHub-181717?logo=GitHub&style=flat)](https://github.com/ts-graphviz/ts-graphviz)
24
24
  [![npm](https://img.shields.io/badge/-npm-CB3837?logo=npm&style=flat)](https://www.npmjs.com/package/ts-graphviz)
25
- [![Reference](https://img.shields.io/badge/-API_Reference-3178C6?logo=TypeScript&style=flat&logoColor=fff)](https://ts-graphviz.github.io/ts-graphviz/)
25
+ [![Reference](https://img.shields.io/badge/-API_Reference-3178C6?logo=TypeScript&style=flat&logoColor=fff)](https://ts-graphviz.github.io/api/)
26
26
  [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/ts-graphviz/ts-graphviz)
27
27
 
28
28
  [![Sponsor](https://img.shields.io/badge/-GitHub%20Sponsor-fff?logo=GitHub%20Sponsors&style=flat)](https://github.com/sponsors/ts-graphviz)
@@ -84,7 +84,7 @@ import { toDot } from 'npm:ts-graphviz';
84
84
 
85
85
  This section provides an overview of the package.
86
86
 
87
- For more detailed API specifications, please refer to the comments in the TypeScript type definitions and the [document](https://ts-graphviz.github.io/ts-graphviz/) automatically generated based on them.
87
+ For more detailed API specifications, please refer to the comments in the TypeScript type definitions and the [document](https://ts-graphviz.github.io/api/) automatically generated based on them.
88
88
 
89
89
  ### `ts-graphviz` Module 🚩
90
90
 
@@ -667,6 +667,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
667
667
  <td align="center" valign="top" width="14.28%"><a href="http://www.walterra.dev"><img src="https://avatars.githubusercontent.com/u/230104?v=4?s=100" width="100px;" alt="Walter Rafelsberger"/><br /><sub><b>Walter Rafelsberger</b></sub></a><br /><a href="#question-walterra" title="Answering Questions">💬</a></td>
668
668
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/grsjst"><img src="https://avatars.githubusercontent.com/u/4739018?v=4?s=100" width="100px;" alt="grsjst"/><br /><sub><b>grsjst</b></sub></a><br /><a href="https://github.com/ts-graphviz/ts-graphviz/issues?q=author%3Agrsjst" title="Bug reports">🐛</a></td>
669
669
  <td align="center" valign="top" width="14.28%"><a href="https://github.com/stephenirven"><img src="https://avatars.githubusercontent.com/u/4293560?v=4?s=100" width="100px;" alt="Steve"/><br /><sub><b>Steve</b></sub></a><br /><a href="https://github.com/ts-graphviz/ts-graphviz/issues?q=author%3Astephenirven" title="Bug reports">🐛</a></td>
670
+ <td align="center" valign="top" width="14.28%"><a href="https://github.com/btomaj"><img src="https://avatars.githubusercontent.com/u/2638986?v=4?s=100" width="100px;" alt="poetry by"/><br /><sub><b>poetry by</b></sub></a><br /><a href="https://github.com/ts-graphviz/ts-graphviz/issues?q=author%3Abtomaj" title="Bug reports">🐛</a></td>
670
671
  </tr>
671
672
  </tbody>
672
673
  </table>
@@ -0,0 +1 @@
1
+ export declare function ownOptions<T extends object>(options: T | undefined): T;
@@ -1,55 +1,66 @@
1
- import { registerDefault as l } from "@ts-graphviz/core";
1
+ import { registerDefault as d } from "@ts-graphviz/core";
2
2
  export * from "@ts-graphviz/core";
3
- import { RootModelsContext as d, createModelsContext as y } from "@ts-graphviz/common";
3
+ import { RootModelsContext as y, createModelsContext as h } from "@ts-graphviz/common";
4
4
  export * from "@ts-graphviz/common";
5
- import { parse as h, toModel as m, fromModel as g, stringify as b } from "@ts-graphviz/ast";
6
- const j = new Proxy(
5
+ import { parse as g, toModel as m, fromModel as b, stringify as w } from "@ts-graphviz/ast";
6
+ const M = new Proxy(
7
7
  Object.freeze({}),
8
8
  {
9
- get: (r, t) => t
9
+ get: (e, t) => t
10
10
  }
11
11
  );
12
- function A(r, t) {
13
- const e = h(r, t?.parse);
14
- if (Array.isArray(e) || e.type === "Attribute" || e.type === "AttributeList" || e.type === "Comment" || e.type === "NodeRef" || e.type === "NodeRefGroup" || e.type === "Literal")
12
+ function p(e) {
13
+ const t = /* @__PURE__ */ Object.create(null);
14
+ if (e != null) {
15
+ const o = Object.getOwnPropertyDescriptors(e);
16
+ for (const r of Object.getOwnPropertyNames(o)) {
17
+ const n = o[r];
18
+ t[r] = "value" in n ? n.value : n.get?.call(e);
19
+ }
20
+ }
21
+ return t;
22
+ }
23
+ function D(e, t) {
24
+ const o = p(t), r = g(e, o.parse);
25
+ if (Array.isArray(r) || r.type === "Attribute" || r.type === "AttributeList" || r.type === "Comment" || r.type === "NodeRef" || r.type === "NodeRefGroup" || r.type === "Literal")
15
26
  throw new Error();
16
- return m(e, t?.convert);
27
+ return m(r, o.convert);
17
28
  }
18
- function f(r, t) {
19
- return (...e) => {
20
- const a = r ? this.Digraph : this.Graph, p = e.find((o) => typeof o == "string"), u = e.find(
21
- (o) => typeof o == "object"
22
- ), c = e.find(
23
- (o) => typeof o == "function"
24
- ), i = new a(p, t, u);
25
- return i.with(this), typeof c == "function" && c(i), i;
29
+ function a(e, t) {
30
+ return (...o) => {
31
+ const r = e ? this.Digraph : this.Graph, n = o.find((c) => typeof c == "string"), l = o.find(
32
+ (c) => typeof c == "object"
33
+ ), f = o.find(
34
+ (c) => typeof c == "function"
35
+ ), s = new r(n, t, l);
36
+ return s.with(this), typeof f == "function" && f(s), s;
26
37
  };
27
38
  }
28
- function n(r, t = d) {
39
+ function i(e, t = y) {
29
40
  return Object.freeze({
30
- digraph: f.call(t, !0, r),
31
- graph: f.call(t, !1, r)
41
+ digraph: a.call(t, !0, e),
42
+ graph: a.call(t, !1, e)
32
43
  });
33
44
  }
34
- const s = n(!1), C = s.digraph, D = s.graph, z = n(!0);
35
- function G(r) {
36
- const t = y(r);
45
+ const u = i(!1), v = u.digraph, A = u.graph, C = i(!0);
46
+ function z(e) {
47
+ const t = h(e);
37
48
  return Object.freeze({
38
- ...n(!1, t),
39
- strict: n(!0, t)
49
+ ...i(!1, t),
50
+ strict: i(!0, t)
40
51
  });
41
52
  }
42
- function O(r, t) {
43
- const e = g(r, t?.convert);
44
- return b(e, t?.print);
53
+ function G(e, t) {
54
+ const { convert: o, print: r } = p(t), n = b(e, o);
55
+ return w(n, r);
45
56
  }
46
- l();
57
+ d();
47
58
  export {
48
- j as attribute,
49
- C as digraph,
50
- A as fromDot,
51
- D as graph,
52
- z as strict,
53
- O as toDot,
54
- G as withContext
59
+ M as attribute,
60
+ v as digraph,
61
+ D as fromDot,
62
+ A as graph,
63
+ C as strict,
64
+ G as toDot,
65
+ z as withContext
55
66
  };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "ts-graphviz",
3
- "version": "3.0.8",
3
+ "version": "3.0.9",
4
4
  "description": "Graphviz library for TypeScript",
5
5
  "keywords": [
6
6
  "graphviz",
7
7
  "dot"
8
8
  ],
9
- "homepage": "https://ts-graphviz.github.io/ts-graphviz/",
9
+ "homepage": "https://ts-graphviz.github.io/api/",
10
10
  "bugs": {
11
11
  "url": "https://github.com/ts-graphviz/ts-graphviz/issues"
12
12
  },
@@ -45,10 +45,10 @@
45
45
  "./package.json": "./package.json"
46
46
  },
47
47
  "dependencies": {
48
- "@ts-graphviz/adapter": "^3.0.7",
49
- "@ts-graphviz/ast": "^3.0.7",
48
+ "@ts-graphviz/adapter": "^3.0.8",
49
+ "@ts-graphviz/ast": "^3.0.8",
50
50
  "@ts-graphviz/common": "^3.0.5",
51
- "@ts-graphviz/core": "^3.0.8"
51
+ "@ts-graphviz/core": "^3.0.9"
52
52
  },
53
53
  "devDependencies": {
54
54
  "typescript": "^5.8.2",