@likec4/core 0.32.0 → 0.33.0

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.
Files changed (106) hide show
  1. package/dist/colors.d.ts +76 -9
  2. package/dist/colors.js +116 -93
  3. package/dist/colors.mjs +112 -0
  4. package/dist/compute-view/EdgeBuilder.d.ts +0 -1
  5. package/dist/compute-view/EdgeBuilder.js +37 -34
  6. package/dist/compute-view/EdgeBuilder.mjs +31 -0
  7. package/dist/compute-view/compute-ctx.d.ts +0 -1
  8. package/dist/compute-view/compute-ctx.js +33 -24
  9. package/dist/compute-view/compute-ctx.mjs +42 -0
  10. package/dist/compute-view/compute-element-view.d.ts +2 -3
  11. package/dist/compute-view/compute-element-view.js +137 -525
  12. package/dist/compute-view/compute-element-view.mjs +145 -0
  13. package/dist/compute-view/compute-predicates.d.ts +16 -0
  14. package/dist/compute-view/compute-predicates.js +358 -0
  15. package/dist/compute-view/compute-predicates.mjs +324 -0
  16. package/dist/compute-view/compute.d.ts +8 -9
  17. package/dist/compute-view/compute.js +49 -39
  18. package/dist/compute-view/compute.mjs +39 -0
  19. package/dist/compute-view/index.d.ts +1 -1
  20. package/dist/compute-view/index.js +24 -2
  21. package/dist/compute-view/index.mjs +1 -0
  22. package/dist/compute-view/utils/anyPossibleRelations.d.ts +0 -1
  23. package/dist/compute-view/utils/anyPossibleRelations.js +17 -12
  24. package/dist/compute-view/utils/anyPossibleRelations.mjs +12 -0
  25. package/dist/compute-view/utils/applyViewRuleStyles.d.ts +3 -0
  26. package/dist/compute-view/utils/applyViewRuleStyles.js +59 -0
  27. package/dist/compute-view/utils/applyViewRuleStyles.mjs +50 -0
  28. package/dist/compute-view/utils/sortNodes.d.ts +0 -1
  29. package/dist/compute-view/utils/sortNodes.js +47 -42
  30. package/dist/compute-view/utils/sortNodes.mjs +40 -0
  31. package/dist/errors/_base.d.ts +0 -1
  32. package/dist/errors/_base.js +14 -11
  33. package/dist/errors/_base.mjs +4 -0
  34. package/dist/errors/index.d.ts +1 -1
  35. package/dist/errors/index.js +60 -5
  36. package/dist/errors/index.mjs +5 -0
  37. package/dist/errors/invariant.d.ts +0 -2
  38. package/dist/errors/invariant.js +16 -21
  39. package/dist/errors/invariant.mjs +8 -0
  40. package/dist/errors/model-index.d.ts +0 -1
  41. package/dist/errors/model-index.js +16 -14
  42. package/dist/errors/model-index.mjs +8 -0
  43. package/dist/errors/non-nullable.d.ts +2 -0
  44. package/dist/errors/non-nullable.js +16 -0
  45. package/dist/errors/non-nullable.mjs +8 -0
  46. package/dist/errors/nonexhaustive.d.ts +0 -1
  47. package/dist/errors/nonexhaustive.js +13 -6
  48. package/dist/errors/nonexhaustive.mjs +5 -0
  49. package/dist/index.d.ts +6 -3
  50. package/dist/index.js +71 -7
  51. package/dist/index.mjs +6 -0
  52. package/dist/model-index/ModelIndex.d.ts +0 -1
  53. package/dist/model-index/ModelIndex.js +125 -122
  54. package/dist/model-index/ModelIndex.mjs +128 -0
  55. package/dist/model-index/index.d.ts +0 -1
  56. package/dist/model-index/index.js +13 -2
  57. package/dist/model-index/index.mjs +1 -0
  58. package/dist/types/_common.d.ts +0 -1
  59. package/dist/types/_common.js +1 -2
  60. package/dist/types/_common.mjs +0 -0
  61. package/dist/types/computed-view.d.ts +7 -6
  62. package/dist/types/computed-view.js +1 -2
  63. package/dist/types/computed-view.mjs +0 -0
  64. package/dist/types/diagram.d.ts +5 -2
  65. package/dist/types/diagram.js +1 -2
  66. package/dist/types/diagram.mjs +0 -0
  67. package/dist/types/element.d.ts +3 -7
  68. package/dist/types/element.js +13 -5
  69. package/dist/types/element.mjs +5 -0
  70. package/dist/types/expression.d.ts +0 -1
  71. package/dist/types/expression.js +45 -31
  72. package/dist/types/expression.mjs +30 -0
  73. package/dist/types/index.d.ts +1 -1
  74. package/dist/types/index.js +48 -4
  75. package/dist/types/index.mjs +3 -0
  76. package/dist/types/model.d.ts +0 -1
  77. package/dist/types/model.js +1 -2
  78. package/dist/types/model.mjs +0 -0
  79. package/dist/types/opaque.d.ts +0 -1
  80. package/dist/types/opaque.js +1 -2
  81. package/dist/types/opaque.mjs +0 -0
  82. package/dist/types/relation.d.ts +0 -1
  83. package/dist/types/relation.js +1 -2
  84. package/dist/types/relation.mjs +0 -0
  85. package/dist/types/theme.d.ts +22 -0
  86. package/dist/types/theme.js +1 -0
  87. package/dist/types/theme.mjs +0 -0
  88. package/dist/types/view.d.ts +2 -2
  89. package/dist/types/view.js +15 -8
  90. package/dist/types/view.mjs +9 -0
  91. package/dist/utils/compute-node-levels.d.ts +0 -1
  92. package/dist/utils/compute-node-levels.js +45 -29
  93. package/dist/utils/compute-node-levels.mjs +31 -0
  94. package/dist/utils/fqn.d.ts +0 -1
  95. package/dist/utils/fqn.js +71 -71
  96. package/dist/utils/fqn.mjs +66 -0
  97. package/dist/utils/guards.d.ts +0 -1
  98. package/dist/utils/guards.js +19 -12
  99. package/dist/utils/guards.mjs +13 -0
  100. package/dist/utils/index.d.ts +0 -1
  101. package/dist/utils/index.js +49 -5
  102. package/dist/utils/index.mjs +4 -0
  103. package/dist/utils/relations.d.ts +0 -1
  104. package/dist/utils/relations.js +56 -49
  105. package/dist/utils/relations.mjs +42 -0
  106. package/package.json +20 -55
@@ -0,0 +1,50 @@
1
+ import { anyPass, filter, clone, isNil } from "rambdax";
2
+ import { isDefined } from "remeda";
3
+ import * as Expr from "../../types/expression.mjs";
4
+ import { nonexhaustive } from "../../errors/index.mjs";
5
+ export function applyViewRuleStyles(rules, _nodes) {
6
+ if (rules.length === 0) {
7
+ return _nodes;
8
+ }
9
+ const nodes = clone(_nodes);
10
+ for (const rule of rules) {
11
+ const predicates = [];
12
+ if (!rule.style.color && !rule.style.shape) {
13
+ continue;
14
+ }
15
+ for (const target of rule.targets) {
16
+ if (Expr.isWildcard(target)) {
17
+ predicates.push(() => true);
18
+ break;
19
+ }
20
+ if (Expr.isElementKindExpr(target)) {
21
+ predicates.push(
22
+ target.isEqual ? (n) => n.kind === target.elementKind : (n) => n.kind !== target.elementKind
23
+ );
24
+ continue;
25
+ }
26
+ if (Expr.isElementTagExpr(target)) {
27
+ predicates.push(
28
+ target.isEqual ? ({ tags }) => !!tags && tags.includes(target.elementTag) : ({ tags }) => isNil(tags) || !tags.includes(target.elementTag)
29
+ );
30
+ continue;
31
+ }
32
+ if (Expr.isElementRef(target)) {
33
+ const { element, isDescedants } = target;
34
+ predicates.push(
35
+ isDescedants ? (n) => n.id.startsWith(element + ".") : (n) => n.id === element
36
+ );
37
+ continue;
38
+ }
39
+ nonexhaustive(target);
40
+ }
41
+ filter(anyPass(predicates), nodes).forEach((n) => {
42
+ n.shape = rule.style.shape ?? n.shape;
43
+ n.color = rule.style.color ?? n.color;
44
+ if (isDefined.strict(rule.style.icon)) {
45
+ n.icon = rule.style.icon;
46
+ }
47
+ });
48
+ }
49
+ return nodes;
50
+ }
@@ -1,3 +1,2 @@
1
1
  import type { ComputedEdge, ComputedNode, Fqn } from '../../types';
2
2
  export declare function sortNodes(_nodes: Map<Fqn, ComputedNode>, edges: ComputedEdge[]): ComputedNode[];
3
- //# sourceMappingURL=sortNodes.d.ts.map
@@ -1,45 +1,50 @@
1
- import { isSameHierarchy } from '../../utils';
2
- import { Graph, alg } from '@dagrejs/graphlib';
3
- import { nonNullable } from '../../errors/invariant';
4
- export function sortNodes(_nodes, edges) {
5
- const g = new Graph({
6
- compound: true,
7
- directed: true,
8
- multigraph: false
9
- });
10
- for (const nd of _nodes.values()) {
11
- g.setNode(nd.id);
12
- // console.log(`add ${nd.id}`)
13
- if (nd.parent) {
14
- g.setEdge(nd.parent, nd.id);
15
- // console.log(`${nd.parent} -> ${nd.id}`)
16
- }
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.sortNodes = sortNodes;
7
+ var _utils = require("../../utils");
8
+ var _graphlib = _interopRequireDefault(require("@dagrejs/graphlib"));
9
+ var _errors = require("../../errors");
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ const {
12
+ Graph,
13
+ alg
14
+ } = _graphlib.default;
15
+ function sortNodes(_nodes, edges) {
16
+ const g = new Graph({
17
+ compound: true,
18
+ directed: true,
19
+ multigraph: false
20
+ });
21
+ for (const nd of _nodes.values()) {
22
+ g.setNode(nd.id);
23
+ if (nd.parent) {
24
+ g.setEdge(nd.parent, nd.id);
17
25
  }
18
- for (const edge of edges) {
19
- const source = _nodes.get(edge.source);
20
- let target = _nodes.get(edge.target);
21
- while (source && target) {
22
- if (!isSameHierarchy(source, target) && !g.hasEdge(source.id, target.id)) {
23
- g.setEdge(source.id, target.id);
24
- // console.log(`${source.id} -> ${target.id}`)
25
- if (!alg.isAcyclic(g)) {
26
- g.removeEdge(source.id, target.id);
27
- // console.log(`remove ${source.id} -> ${target.id}`)
28
- }
29
- }
30
- if (target.parent && target.parent !== edge.parent) {
31
- target = _nodes.get(target.parent);
32
- }
33
- else {
34
- target = undefined;
35
- }
26
+ }
27
+ for (const edge of edges) {
28
+ const source = _nodes.get(edge.source);
29
+ let target = _nodes.get(edge.target);
30
+ while (source && target) {
31
+ if (!(0, _utils.isSameHierarchy)(source, target) && !g.hasEdge(source.id, target.id)) {
32
+ g.setEdge(source.id, target.id);
33
+ if (!alg.isAcyclic(g)) {
34
+ g.removeEdge(source.id, target.id);
36
35
  }
36
+ }
37
+ if (target.parent && target.parent !== edge.parent) {
38
+ target = _nodes.get(target.parent);
39
+ } else {
40
+ target = void 0;
41
+ }
37
42
  }
38
- const sorted = alg.topsort(g);
39
- const nodes = sorted.map(id => nonNullable(_nodes.get(id)));
40
- for (const node of nodes) {
41
- node.children = nodes.flatMap(n => (n.parent === node.id ? n.id : []));
42
- }
43
- return nodes;
44
- }
45
- //# sourceMappingURL=sortNodes.js.map
43
+ }
44
+ const sorted = alg.topsort(g);
45
+ const nodes = sorted.map(id => (0, _errors.nonNullable)(_nodes.get(id)));
46
+ for (const node of nodes) {
47
+ node.children = nodes.flatMap(n => n.parent === node.id ? n.id : []);
48
+ }
49
+ return nodes;
50
+ }
@@ -0,0 +1,40 @@
1
+ import { isSameHierarchy } from "../../utils/index.mjs";
2
+ import pkg from "@dagrejs/graphlib";
3
+ import { nonNullable } from "../../errors/index.mjs";
4
+ const { Graph, alg } = pkg;
5
+ export function sortNodes(_nodes, edges) {
6
+ const g = new Graph({
7
+ compound: true,
8
+ directed: true,
9
+ multigraph: false
10
+ });
11
+ for (const nd of _nodes.values()) {
12
+ g.setNode(nd.id);
13
+ if (nd.parent) {
14
+ g.setEdge(nd.parent, nd.id);
15
+ }
16
+ }
17
+ for (const edge of edges) {
18
+ const source = _nodes.get(edge.source);
19
+ let target = _nodes.get(edge.target);
20
+ while (source && target) {
21
+ if (!isSameHierarchy(source, target) && !g.hasEdge(source.id, target.id)) {
22
+ g.setEdge(source.id, target.id);
23
+ if (!alg.isAcyclic(g)) {
24
+ g.removeEdge(source.id, target.id);
25
+ }
26
+ }
27
+ if (target.parent && target.parent !== edge.parent) {
28
+ target = _nodes.get(target.parent);
29
+ } else {
30
+ target = void 0;
31
+ }
32
+ }
33
+ }
34
+ const sorted = alg.topsort(g);
35
+ const nodes = sorted.map((id) => nonNullable(_nodes.get(id)));
36
+ for (const node of nodes) {
37
+ node.children = nodes.flatMap((n) => n.parent === node.id ? n.id : []);
38
+ }
39
+ return nodes;
40
+ }
@@ -7,4 +7,3 @@ export declare const BaseError: import("modern-errors").ErrorSubclassCore<[], {}
7
7
  */
8
8
  export declare const UnknownError: import("modern-errors").ErrorSubclassCore<[], {}, import("modern-errors").CustomClass>;
9
9
  export declare const RelationRefError: import("modern-errors").ErrorSubclassCore<[], {}, import("modern-errors").CustomClass>;
10
- //# sourceMappingURL=_base.d.ts.map
@@ -1,11 +1,14 @@
1
- import ModernError from 'modern-errors';
2
- /**
3
- * Base class for all errors in the LikeC4 library.
4
- */
5
- export const BaseError = ModernError.subclass('BaseError');
6
- /**
7
- * Unknown error, mosly probably a bug, unhandled case or coming from a third-party library.
8
- */
9
- export const UnknownError = BaseError.subclass('UnknownError');
10
- export const RelationRefError = BaseError.subclass('RelationRefError');
11
- //# sourceMappingURL=_base.js.map
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.UnknownError = exports.RelationRefError = exports.BaseError = void 0;
7
+ var _modernErrors = _interopRequireDefault(require("modern-errors"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ const BaseError = _modernErrors.default.subclass("BaseError");
10
+ exports.BaseError = BaseError;
11
+ const UnknownError = BaseError.subclass("UnknownError");
12
+ exports.UnknownError = UnknownError;
13
+ const RelationRefError = BaseError.subclass("RelationRefError");
14
+ exports.RelationRefError = RelationRefError;
@@ -0,0 +1,4 @@
1
+ import ModernError from "modern-errors";
2
+ export const BaseError = ModernError.subclass("BaseError");
3
+ export const UnknownError = BaseError.subclass("UnknownError");
4
+ export const RelationRefError = BaseError.subclass("RelationRefError");
@@ -1,5 +1,5 @@
1
1
  export * from './_base';
2
2
  export * from './invariant';
3
+ export * from './non-nullable';
3
4
  export * from './nonexhaustive';
4
5
  export * from './model-index';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,60 @@
1
- export * from './_base';
2
- export * from './invariant';
3
- export * from './nonexhaustive';
4
- export * from './model-index';
5
- //# sourceMappingURL=index.js.map
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _base = require("./_base");
7
+ Object.keys(_base).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _base[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _base[key];
14
+ }
15
+ });
16
+ });
17
+ var _invariant = require("./invariant");
18
+ Object.keys(_invariant).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _invariant[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _invariant[key];
25
+ }
26
+ });
27
+ });
28
+ var _nonNullable = require("./non-nullable");
29
+ Object.keys(_nonNullable).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _nonNullable[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _nonNullable[key];
36
+ }
37
+ });
38
+ });
39
+ var _nonexhaustive = require("./nonexhaustive");
40
+ Object.keys(_nonexhaustive).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _nonexhaustive[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _nonexhaustive[key];
47
+ }
48
+ });
49
+ });
50
+ var _modelIndex = require("./model-index");
51
+ Object.keys(_modelIndex).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _modelIndex[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _modelIndex[key];
58
+ }
59
+ });
60
+ });
@@ -0,0 +1,5 @@
1
+ export * from "./_base.mjs";
2
+ export * from "./invariant.mjs";
3
+ export * from "./non-nullable.mjs";
4
+ export * from "./nonexhaustive.mjs";
5
+ export * from "./model-index.mjs";
@@ -1,4 +1,2 @@
1
1
  export declare const InvariantError: import("modern-errors").ErrorSubclassCore<[], {}, import("modern-errors").CustomClass>;
2
2
  export declare function invariant(condition: any, message?: string): asserts condition;
3
- export declare function nonNullable<T>(value: T): NonNullable<T>;
4
- //# sourceMappingURL=invariant.d.ts.map
@@ -1,21 +1,16 @@
1
- import { BaseError } from './_base';
2
- export const InvariantError = BaseError.subclass('InvariantError');
3
- // Throw an error if the condition fails
4
- // > Not providing an inline default argument for message as the result is smaller
5
- export function invariant(
6
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
- condition,
8
- // Can provide a string, or a function that returns a string for cases where
9
- // the message takes a fair amount of effort to compute
10
- message) {
11
- if (condition) {
12
- return;
13
- }
14
- throw new InvariantError(message ?? 'Invariant failed');
15
- }
16
- // Throws an error if the value is null or undefined
17
- export function nonNullable(value) {
18
- invariant(value != null, 'Expected value to exist');
19
- return value;
20
- }
21
- //# sourceMappingURL=invariant.js.map
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.InvariantError = void 0;
7
+ exports.invariant = invariant;
8
+ var _base = require("./_base");
9
+ const InvariantError = _base.BaseError.subclass("InvariantError");
10
+ exports.InvariantError = InvariantError;
11
+ function invariant(condition, message) {
12
+ if (condition) {
13
+ return;
14
+ }
15
+ throw new InvariantError(message ?? "Invariant failed");
16
+ }
@@ -0,0 +1,8 @@
1
+ import { BaseError } from "./_base.mjs";
2
+ export const InvariantError = BaseError.subclass("InvariantError");
3
+ export function invariant(condition, message) {
4
+ if (condition) {
5
+ return;
6
+ }
7
+ throw new InvariantError(message ?? "Invariant failed");
8
+ }
@@ -1,3 +1,2 @@
1
1
  export declare const InvalidModelError: import("modern-errors").ErrorSubclassCore<[], {}, import("modern-errors").CustomClass>;
2
2
  export declare function ensureModel(condition: any, message?: string): asserts condition;
3
- //# sourceMappingURL=model-index.d.ts.map
@@ -1,14 +1,16 @@
1
- import { BaseError } from './_base';
2
- export const InvalidModelError = BaseError.subclass('InvalidModelError');
3
- export function ensureModel(
4
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
- condition,
6
- // Can provide a string, or a function that returns a string for cases where
7
- // the message takes a fair amount of effort to compute
8
- message) {
9
- if (condition) {
10
- return;
11
- }
12
- throw new InvalidModelError(message ?? 'ModelIndex Invariant failed');
13
- }
14
- //# sourceMappingURL=model-index.js.map
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.InvalidModelError = void 0;
7
+ exports.ensureModel = ensureModel;
8
+ var _base = require("./_base");
9
+ const InvalidModelError = _base.BaseError.subclass("InvalidModelError");
10
+ exports.InvalidModelError = InvalidModelError;
11
+ function ensureModel(condition, message) {
12
+ if (condition) {
13
+ return;
14
+ }
15
+ throw new InvalidModelError(message ?? "ModelIndex Invariant failed");
16
+ }
@@ -0,0 +1,8 @@
1
+ import { BaseError } from "./_base.mjs";
2
+ export const InvalidModelError = BaseError.subclass("InvalidModelError");
3
+ export function ensureModel(condition, message) {
4
+ if (condition) {
5
+ return;
6
+ }
7
+ throw new InvalidModelError(message ?? "ModelIndex Invariant failed");
8
+ }
@@ -0,0 +1,2 @@
1
+ export declare const UnexpectedNullableError: import("modern-errors").ErrorSubclassCore<[], {}, import("modern-errors").CustomClass>;
2
+ export declare function nonNullable<T>(value: T): NonNullable<T>;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.UnexpectedNullableError = void 0;
7
+ exports.nonNullable = nonNullable;
8
+ var _base = require("./_base");
9
+ const UnexpectedNullableError = _base.BaseError.subclass("UnexpectedNullableError");
10
+ exports.UnexpectedNullableError = UnexpectedNullableError;
11
+ function nonNullable(value) {
12
+ if (value == null) {
13
+ throw new UnexpectedNullableError("Expected value to not be null or undefined");
14
+ }
15
+ return value;
16
+ }
@@ -0,0 +1,8 @@
1
+ import { BaseError } from "./_base.mjs";
2
+ export const UnexpectedNullableError = BaseError.subclass("UnexpectedNullableError");
3
+ export function nonNullable(value) {
4
+ if (value == null) {
5
+ throw new UnexpectedNullableError("Expected value to not be null or undefined");
6
+ }
7
+ return value;
8
+ }
@@ -1,3 +1,2 @@
1
1
  export declare const NonExhaustiveError: import("modern-errors").ErrorSubclassCore<[], {}, import("modern-errors").CustomClass>;
2
2
  export declare function nonexhaustive(arg: never): never;
3
- //# sourceMappingURL=nonexhaustive.d.ts.map
@@ -1,6 +1,13 @@
1
- import { BaseError } from './_base';
2
- export const NonExhaustiveError = BaseError.subclass('NonExhaustiveError');
3
- export function nonexhaustive(arg) {
4
- throw new NonExhaustiveError(`NonExhaustive value: ${JSON.stringify(arg)}`);
5
- }
6
- //# sourceMappingURL=nonexhaustive.js.map
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.NonExhaustiveError = void 0;
7
+ exports.nonexhaustive = nonexhaustive;
8
+ var _base = require("./_base");
9
+ const NonExhaustiveError = _base.BaseError.subclass("NonExhaustiveError");
10
+ exports.NonExhaustiveError = NonExhaustiveError;
11
+ function nonexhaustive(arg) {
12
+ throw new NonExhaustiveError(`NonExhaustive value: ${JSON.stringify(arg)}`);
13
+ }
@@ -0,0 +1,5 @@
1
+ import { BaseError } from "./_base.mjs";
2
+ export const NonExhaustiveError = BaseError.subclass("NonExhaustiveError");
3
+ export function nonexhaustive(arg) {
4
+ throw new NonExhaustiveError(`NonExhaustive value: ${JSON.stringify(arg)}`);
5
+ }
package/dist/index.d.ts CHANGED
@@ -1,8 +1,11 @@
1
- export type * from './types';
2
1
  export * from './types';
3
- export * from './compute-view';
4
2
  export * from './utils';
5
3
  export * from './model-index';
4
+ export * from './compute-view';
6
5
  export * from './colors';
7
6
  export * from './errors';
8
- //# sourceMappingURL=index.d.ts.map
7
+ export type * from './types';
8
+ export type * from './model-index';
9
+ export type * from './compute-view';
10
+ export type * from './errors';
11
+ export type * from './colors';
package/dist/index.js CHANGED
@@ -1,7 +1,71 @@
1
- export * from './types';
2
- export * from './compute-view';
3
- export * from './utils';
4
- export * from './model-index';
5
- export * from './colors';
6
- export * from './errors';
7
- //# sourceMappingURL=index.js.map
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _types = require("./types");
7
+ Object.keys(_types).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _types[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _types[key];
14
+ }
15
+ });
16
+ });
17
+ var _utils = require("./utils");
18
+ Object.keys(_utils).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _utils[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _utils[key];
25
+ }
26
+ });
27
+ });
28
+ var _modelIndex = require("./model-index");
29
+ Object.keys(_modelIndex).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _modelIndex[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _modelIndex[key];
36
+ }
37
+ });
38
+ });
39
+ var _computeView = require("./compute-view");
40
+ Object.keys(_computeView).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _computeView[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _computeView[key];
47
+ }
48
+ });
49
+ });
50
+ var _colors = require("./colors");
51
+ Object.keys(_colors).forEach(function (key) {
52
+ if (key === "default" || key === "__esModule") return;
53
+ if (key in exports && exports[key] === _colors[key]) return;
54
+ Object.defineProperty(exports, key, {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _colors[key];
58
+ }
59
+ });
60
+ });
61
+ var _errors = require("./errors");
62
+ Object.keys(_errors).forEach(function (key) {
63
+ if (key === "default" || key === "__esModule") return;
64
+ if (key in exports && exports[key] === _errors[key]) return;
65
+ Object.defineProperty(exports, key, {
66
+ enumerable: true,
67
+ get: function () {
68
+ return _errors[key];
69
+ }
70
+ });
71
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,6 @@
1
+ export * from "./types/index.mjs";
2
+ export * from "./utils/index.mjs";
3
+ export * from "./model-index/index.mjs";
4
+ export * from "./compute-view/index.mjs";
5
+ export * from "./colors.mjs";
6
+ export * from "./errors/index.mjs";
@@ -25,4 +25,3 @@ export default class ModelIndex {
25
25
  addRelation(rel: Relation): void;
26
26
  }
27
27
  export {};
28
- //# sourceMappingURL=ModelIndex.d.ts.map