@likec4/core 1.32.2 → 1.34.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 (113) hide show
  1. package/dist/builder/index.d.mts +6 -4
  2. package/dist/builder/index.mjs +45 -13
  3. package/dist/compute-view/index.d.mts +6 -4
  4. package/dist/compute-view/index.mjs +33 -10
  5. package/dist/compute-view/relationships-view/index.d.mts +6 -4
  6. package/dist/compute-view/relationships-view/index.mjs +6 -3
  7. package/dist/index.d.mts +9 -138
  8. package/dist/index.mjs +31 -3712
  9. package/dist/model/connection/deployment/index.d.mts +10 -0
  10. package/dist/model/connection/deployment/index.mjs +18 -0
  11. package/dist/model/connection/index.d.mts +70 -0
  12. package/dist/model/connection/index.mjs +23 -0
  13. package/dist/model/connection/model/index.d.mts +10 -0
  14. package/dist/model/connection/model/index.mjs +11 -0
  15. package/dist/model/index.d.mts +14 -256
  16. package/dist/model/index.mjs +27 -5
  17. package/dist/shared/{core.cbA9VZ02.mjs → core.4SpVCM9m.mjs} +31 -1073
  18. package/dist/shared/{core.BuO4ncfY.d.mts → core.668kXpZq.d.mts} +42 -52
  19. package/dist/shared/core.8KM0D6va.mjs +33 -0
  20. package/dist/shared/core.B0oEIXqd.mjs +47 -0
  21. package/dist/shared/core.BH9nN-_I.mjs +22 -0
  22. package/dist/shared/core.BMCb0wJI.mjs +177 -0
  23. package/dist/shared/core.BTnf14gD.mjs +331 -0
  24. package/dist/shared/core.BgvIuGGU.mjs +3 -0
  25. package/dist/shared/core.BoyJPEen.mjs +21 -0
  26. package/dist/shared/{core.CUYDgv2-.mjs → core.Br7Fab9l.mjs} +12 -15
  27. package/dist/shared/{core.BrCnZFTn.mjs → core.Btl47GOn.mjs} +3 -3
  28. package/dist/shared/core.ByrmCl9I.mjs +5 -0
  29. package/dist/shared/core.C80Z37Eu.mjs +29 -0
  30. package/dist/shared/{core.Pf5I9o0e.d.mts → core.CF82MWyh.d.mts} +1 -1
  31. package/dist/shared/core.CJSFKrYf.d.mts +83 -0
  32. package/dist/shared/{core.rmvsy0n3.mjs → core.C_C-3c1S.mjs} +5 -198
  33. package/dist/shared/{core.DoK86JEe.mjs → core.CpwrZi3D.mjs} +2 -73
  34. package/dist/shared/{core.CpXlRyE5.mjs → core.CtKXPqN_.mjs} +5 -36
  35. package/dist/shared/core.CxGKeL-L.mjs +144 -0
  36. package/dist/shared/core.CzdwsPmY.d.mts +69 -0
  37. package/dist/shared/core.D3xEWj5B.d.mts +41 -0
  38. package/dist/shared/{core.Cy9smucx.mjs → core.D4npX2q8.mjs} +1 -3
  39. package/dist/shared/core.D56nCp7e.mjs +168 -0
  40. package/dist/shared/core.D5qVzkws.mjs +724 -0
  41. package/dist/shared/{core.CBxTtXMi.d.mts → core.DAj3LuFH.d.mts} +58 -57
  42. package/dist/shared/{core.Bk7wEZFG.mjs → core.DXRAwwDB.mjs} +3 -2
  43. package/dist/shared/core.DcS-0zys.mjs +10 -0
  44. package/dist/shared/core.Di7__sMg.d.mts +87 -0
  45. package/dist/shared/{core.DaAyklhe.d.mts → core.DrS4Bf4y.d.mts} +31 -22
  46. package/dist/shared/core.DsMrjY2q.mjs +34 -0
  47. package/dist/shared/core.DuSLYTG6.d.mts +57 -0
  48. package/dist/shared/{core.Bdz6fBF1.d.mts → core.IWLie-Ma.d.mts} +92 -81
  49. package/dist/shared/{core.CBpKAlhj.mjs → core.PqNe5WxQ.mjs} +96 -56
  50. package/dist/shared/core.XptQjhMA.mjs +1295 -0
  51. package/dist/shared/core.zLlww-07.mjs +3 -0
  52. package/dist/theme/index.d.mts +134 -0
  53. package/dist/theme/index.mjs +3709 -0
  54. package/dist/types/_aux.d.mts +4 -0
  55. package/dist/types/index.d.mts +9 -5
  56. package/dist/types/index.mjs +17 -146
  57. package/dist/utils/index.d.mts +15 -100
  58. package/dist/utils/index.mjs +25 -1315
  59. package/dist/utils/iterable/index.d.mts +100 -0
  60. package/dist/utils/iterable/index.mjs +24 -0
  61. package/package.json +29 -13
  62. package/src/builder/Builder.ts +13 -4
  63. package/src/builder/__snapshots__/Builder-style1.spec.ts.snap +0 -13
  64. package/src/builder/__snapshots__/Builder-style2.compute-model.json5 +2 -6
  65. package/src/builder/__snapshots__/Builder-style2.spec.ts.snap +0 -7
  66. package/src/compute-view/deployment-view/__test__/fixture.ts +15 -5
  67. package/src/compute-view/deployment-view/utils.ts +13 -13
  68. package/src/compute-view/dynamic-view/compute.ts +2 -1
  69. package/src/compute-view/element-view/__test__/__snapshots__/legacy.spec.ts.snap +2 -2
  70. package/src/compute-view/relationships-view/layout.ts +1 -1
  71. package/src/compute-view/utils/applyCustomElementProperties.ts +8 -0
  72. package/src/compute-view/utils/applyCustomRelationProperties.ts +2 -0
  73. package/src/compute-view/utils/buildComputedNodes.ts +4 -3
  74. package/src/compute-view/utils/merge-props-from-relationships.ts +6 -5
  75. package/src/compute-view/utils/view-hash.ts +24 -3
  76. package/src/model/DeploymentElementModel.ts +21 -17
  77. package/src/model/DeploymentModel.ts +1 -1
  78. package/src/model/ElementModel.ts +15 -5
  79. package/src/model/LikeC4Model.ts +1 -1
  80. package/src/model/RelationModel.ts +20 -17
  81. package/src/model/index.ts +2 -0
  82. package/src/model/types.ts +2 -1
  83. package/src/model/view/EdgeModel.ts +4 -3
  84. package/src/model/view/LikeC4ViewModel.ts +6 -1
  85. package/src/model/view/NodeModel.ts +5 -3
  86. package/src/theme/index.ts +12 -5
  87. package/src/types/RichText.ts +200 -0
  88. package/src/types/expression-model.ts +2 -2
  89. package/src/types/expression.ts +2 -2
  90. package/src/types/fqnRef.ts +2 -2
  91. package/src/types/global.ts +1 -1
  92. package/src/types/index.ts +4 -2
  93. package/src/types/model-data.ts +2 -2
  94. package/src/types/model-deployment.ts +6 -5
  95. package/src/types/model-dump.ts +1 -1
  96. package/src/types/model-logical.ts +5 -5
  97. package/src/types/model-spec.ts +2 -2
  98. package/src/types/operators.ts +2 -2
  99. package/src/types/scalar.ts +47 -2
  100. package/src/types/view-common.ts +3 -3
  101. package/src/types/view-computed.ts +4 -6
  102. package/src/types/view-layouted.ts +11 -2
  103. package/src/types/view-parsed.deployment.ts +1 -1
  104. package/src/types/view-parsed.dynamic.ts +2 -2
  105. package/src/types/view-parsed.element.ts +2 -2
  106. package/src/types/view.ts +2 -2
  107. package/src/utils/index.ts +4 -9
  108. package/src/utils/markdown/index.ts +2 -0
  109. package/src/utils/markdown/to-html.ts +32 -0
  110. package/src/utils/markdown/to-text.ts +14 -0
  111. package/dist/types/aux.d.mts +0 -3
  112. /package/dist/types/{aux.mjs → _aux.mjs} +0 -0
  113. /package/src/types/{aux.ts → _aux.ts} +0 -0
@@ -1,60 +1,48 @@
1
- import { IsAny, UnionToIntersection, Simplify, Tagged } from 'type-fest';
1
+ import { Tagged } from 'type-fest';
2
2
 
3
- type NonEmptyArray<T> = [T, ...T[]];
4
- type NonEmptyReadonlyArray<T> = readonly [T, ...T[]];
5
- type KeysOf<T> = keyof T extends infer K extends string ? K : never;
6
- type AllNever<Expressions> = UnionToIntersection<{
7
- [Name in keyof Expressions]: {
8
- -readonly [Key in keyof Expressions[Name]]?: never;
9
- };
10
- }[keyof Expressions]>;
3
+ type ProjectId<T = string> = Tagged<T, 'ProjectID'>;
4
+ type MarkdownOrString = {
5
+ txt: string;
6
+ md?: never;
7
+ } | {
8
+ md: string;
9
+ txt?: never;
10
+ };
11
11
  /**
12
+ * Converts a MarkdownOrString object or a plain string into a simple string representation.
13
+ * This utility function handles different types of text content and normalizes them to a string format.
14
+ *
15
+ * @param value - The content to be flattened.
16
+ * Can be one of:
17
+ * - A plain string
18
+ * - A MarkdownOrString object with either txt or md property
19
+ * - undefined or null
20
+ *
21
+ * @returns The string content contained within the input value.
22
+ * - Returns the input directly if it's already a string
23
+ * - Returns the txt property if available in a MarkdownOrString object
24
+ * - Falls back to the md property if txt is not available
25
+ * - Returns null if:
26
+ * - The input is null or undefined
27
+ * - The resulting string value is empty, whitespace, or null
28
+ *
12
29
  * @example
13
- * ```ts
14
- * type Variant1 = {
15
- * a: string
16
- * }
17
- * type Variant2 = {
18
- * b: number
19
- * }
30
+ * // String input
31
+ * flattenMarkdownOrString("Hello world") // Returns: "Hello world"
32
+ * flattenMarkdownOrString(" ") // Returns: null
20
33
  *
21
- * type Variants = ExclusiveUnion<{
22
- * Variant1: Variant1,
23
- * Variant2: Variant2
24
- * }>
34
+ * // MarkdownOrString with txt property
35
+ * flattenMarkdownOrString({ txt: "Plain text" }) // Returns: "Plain text"
36
+ * flattenMarkdownOrString({ txt: " " }) // Returns: null
25
37
  *
26
- * // Fail here
27
- * const variant1: Variants = {
28
- * a: 'one',
29
- * b: 1
30
- * }
31
- * ```
32
- */
33
- type ExclusiveUnion<Expressions, All = AllNever<Expressions>> = Expressions extends object ? {
34
- [Name in keyof Expressions]: Simplify<Omit<All, keyof Expressions[Name]> & Expressions[Name]>;
35
- }[keyof Expressions] : never;
36
- /**
37
- * Copy from https://github.com/remeda/remeda/blob/main/src/internal/types/NTuple.ts
38
- * An array with *exactly* N elements in it.
38
+ * // MarkdownOrString with md property
39
+ * flattenMarkdownOrString({ md: "**Bold markdown**" }) // Returns: "**Bold markdown**"
39
40
  *
40
- * Only literal N values are supported. For very large N the type might result
41
- * in a recurse depth error. For negative N the type would result in an infinite
42
- * recursion. None of these have protections because this is an internal type!
41
+ * // Null input
42
+ * flattenMarkdownOrString(null) // Returns: null
43
43
  */
44
- type NTuple<T, N extends number, Result extends Array<unknown> = []> = Result['length'] extends N ? Result : NTuple<T, N, [...Result, T]>;
45
- type IteratorLike<T> = IteratorObject<T, BuiltinIteratorReturn>;
46
- type Predicate<T> = (x: T) => boolean;
47
- interface Link {
48
- title?: string;
49
- url: string;
50
- relative?: string;
51
- }
52
- /**
53
- * Coalesce `V` to a string if it is `any`
54
- */
55
- type Coalesce<V extends string, OrIfAny = string> = IsAny<V> extends true ? OrIfAny : V;
56
-
57
- type ProjectId<T = string> = Tagged<T, 'ProjectID'>;
44
+ declare function flattenMarkdownOrString(value: MarkdownOrString | string): string;
45
+ declare function flattenMarkdownOrString(value: MarkdownOrString | string | undefined | null): string | null;
58
46
  type BuiltInIcon = 'none' | `${'aws' | 'azure' | 'gcp' | 'tech'}:${string}`;
59
47
  type Icon = Tagged<string, 'Icon'> | BuiltInIcon;
60
48
  type IconUrl = Icon;
@@ -123,6 +111,7 @@ declare const scalar_GlobalFqn: typeof GlobalFqn;
123
111
  type scalar_GroupElementKind = GroupElementKind;
124
112
  type scalar_Icon = Icon;
125
113
  type scalar_IconUrl = IconUrl;
114
+ type scalar_MarkdownOrString = MarkdownOrString;
126
115
  declare const scalar_NodeId: typeof NodeId;
127
116
  type scalar_ProjectId<T = string> = ProjectId<T>;
128
117
  declare const scalar_RelationId: typeof RelationId;
@@ -134,13 +123,14 @@ declare const scalar_StepEdgeKind: typeof StepEdgeKind;
134
123
  type scalar_Tag<T = string> = Tag<T>;
135
124
  declare const scalar_ViewId: typeof ViewId;
136
125
  declare const scalar_extractStep: typeof extractStep;
126
+ declare const scalar_flattenMarkdownOrString: typeof flattenMarkdownOrString;
137
127
  declare const scalar_isGlobalFqn: typeof isGlobalFqn;
138
128
  declare const scalar_isGroupElementKind: typeof isGroupElementKind;
139
129
  declare const scalar_isStepEdgeId: typeof isStepEdgeId;
140
130
  declare const scalar_splitGlobalFqn: typeof splitGlobalFqn;
141
131
  declare const scalar_stepEdgeId: typeof stepEdgeId;
142
132
  declare namespace scalar {
143
- export { type scalar_AnyFqn as AnyFqn, type scalar_BuiltInIcon as BuiltInIcon, scalar_DeploymentFqn as DeploymentFqn, type scalar_DeploymentKind as DeploymentKind, scalar_EdgeId as EdgeId, type scalar_ElementKind as ElementKind, scalar_Fqn as Fqn, scalar_GlobalFqn as GlobalFqn, type scalar_GroupElementKind as GroupElementKind, type scalar_Icon as Icon, type scalar_IconUrl as IconUrl, scalar_NodeId as NodeId, type scalar_ProjectId as ProjectId, scalar_RelationId as RelationId, type scalar_RelationKind as RelationKind, type scalar_RelationshipKind as RelationshipKind, type scalar_StepEdgeId as StepEdgeId, type scalar_StepEdgeIdLiteral as StepEdgeIdLiteral, scalar_StepEdgeKind as StepEdgeKind, type scalar_Tag as Tag, scalar_ViewId as ViewId, scalar_extractStep as extractStep, scalar_isGlobalFqn as isGlobalFqn, scalar_isGroupElementKind as isGroupElementKind, scalar_isStepEdgeId as isStepEdgeId, scalar_splitGlobalFqn as splitGlobalFqn, scalar_stepEdgeId as stepEdgeId };
133
+ export { type scalar_AnyFqn as AnyFqn, type scalar_BuiltInIcon as BuiltInIcon, scalar_DeploymentFqn as DeploymentFqn, type scalar_DeploymentKind as DeploymentKind, scalar_EdgeId as EdgeId, type scalar_ElementKind as ElementKind, scalar_Fqn as Fqn, scalar_GlobalFqn as GlobalFqn, type scalar_GroupElementKind as GroupElementKind, type scalar_Icon as Icon, type scalar_IconUrl as IconUrl, type scalar_MarkdownOrString as MarkdownOrString, scalar_NodeId as NodeId, type scalar_ProjectId as ProjectId, scalar_RelationId as RelationId, type scalar_RelationKind as RelationKind, type scalar_RelationshipKind as RelationshipKind, type scalar_StepEdgeId as StepEdgeId, type scalar_StepEdgeIdLiteral as StepEdgeIdLiteral, scalar_StepEdgeKind as StepEdgeKind, type scalar_Tag as Tag, scalar_ViewId as ViewId, scalar_extractStep as extractStep, scalar_flattenMarkdownOrString as flattenMarkdownOrString, scalar_isGlobalFqn as isGlobalFqn, scalar_isGroupElementKind as isGroupElementKind, scalar_isStepEdgeId as isStepEdgeId, scalar_splitGlobalFqn as splitGlobalFqn, scalar_stepEdgeId as stepEdgeId };
144
134
  }
145
135
 
146
- export { type AnyFqn as A, type BuiltInIcon as B, type Coalesce as C, DeploymentFqn as D, EdgeId as E, Fqn as F, GroupElementKind as G, type IteratorLike as I, type KeysOf as K, type Link as L, NodeId as N, type ProjectId as P, RelationId as R, type StepEdgeIdLiteral as S, type Tag as T, ViewId as V, type ElementKind as a, type DeploymentKind as b, type RelationshipKind as c, type NonEmptyArray as d, type NonEmptyReadonlyArray as e, type ExclusiveUnion as f, type NTuple as g, type Predicate as h, type Icon as i, type IconUrl as j, isGroupElementKind as k, type RelationKind as l, GlobalFqn as m, isGlobalFqn as n, splitGlobalFqn as o, type StepEdgeId as p, stepEdgeId as q, StepEdgeKind as r, scalar as s, isStepEdgeId as t, extractStep as u };
136
+ export { type AnyFqn as A, type BuiltInIcon as B, DeploymentFqn as D, type ElementKind as E, Fqn as F, GroupElementKind as G, type Icon as I, type MarkdownOrString as M, NodeId as N, type ProjectId as P, type RelationKind as R, type StepEdgeIdLiteral as S, type Tag as T, ViewId as V, type IconUrl as a, type DeploymentKind as b, type RelationshipKind as c, RelationId as d, GlobalFqn as e, flattenMarkdownOrString as f, isGlobalFqn as g, splitGlobalFqn as h, isGroupElementKind as i, EdgeId as j, type StepEdgeId as k, stepEdgeId as l, StepEdgeKind as m, isStepEdgeId as n, extractStep as o, scalar as s };
@@ -0,0 +1,33 @@
1
+ function n(e){return e!==void 0}
2
+
3
+ function l(n){return n!=null}
4
+
5
+ function isIterable(something) {
6
+ return l(something) && typeof something === "object" && Symbol.iterator in something;
7
+ }
8
+
9
+ function iflat(iterable) {
10
+ return iterable ? _iflat(iterable) : _iflat;
11
+ }
12
+ function* _iflat(iterable) {
13
+ for (const inner of iterable) {
14
+ yield* inner;
15
+ }
16
+ return;
17
+ }
18
+
19
+ function iunique(iterable) {
20
+ return iterable ? _iunique(iterable) : _iunique;
21
+ }
22
+ function* _iunique(iterable) {
23
+ const seen = /* @__PURE__ */ new Set();
24
+ for (const item of iterable) {
25
+ if (!seen.has(item)) {
26
+ seen.add(item);
27
+ yield item;
28
+ }
29
+ }
30
+ return;
31
+ }
32
+
33
+ export { isIterable as a, iunique as b, iflat as i, l, n };
@@ -0,0 +1,47 @@
1
+ import rehypeRaw from 'rehype-raw';
2
+ import rehypeSanitize from 'rehype-sanitize';
3
+ import rehypeStringify from 'rehype-stringify';
4
+ import remarkGfm from 'remark-gfm';
5
+ import remarkParse from 'remark-parse';
6
+ import remarkRehype from 'remark-rehype';
7
+ import { unified } from 'unified';
8
+ import { fromMarkdown } from 'mdast-util-from-markdown';
9
+ import { toString } from 'mdast-util-to-string';
10
+
11
+ function memoizeProp(obj, tag, fn) {
12
+ const tagSymbol = typeof tag === "symbol" ? tag : Symbol.for(tag);
13
+ if (!obj.hasOwnProperty(tagSymbol)) {
14
+ Object.defineProperty(obj, tagSymbol, {
15
+ enumerable: false,
16
+ writable: false,
17
+ value: fn()
18
+ });
19
+ }
20
+ return obj[tagSymbol];
21
+ }
22
+
23
+ function remark() {
24
+ return unified().use(remarkParse).use(remarkGfm).use(remarkRehype, {
25
+ // Tight paragraphs prevent extra newlines
26
+ allowDangerousHtml: true,
27
+ clobberPrefix: "",
28
+ tableCellPadding: false,
29
+ tight: true
30
+ }).use(rehypeRaw).use(rehypeSanitize).use(rehypeStringify, {
31
+ // Prevent extra closing newlines
32
+ closeSelfClosing: true,
33
+ tightSelfClosing: true
34
+ });
35
+ }
36
+ function markdownToHtml(markdown) {
37
+ return String(remark().processSync(markdown.trim())).trim();
38
+ }
39
+
40
+ function markdownToText(markdown) {
41
+ return toString(fromMarkdown(markdown), {
42
+ includeHtml: false,
43
+ includeImageAlt: false
44
+ });
45
+ }
46
+
47
+ export { markdownToHtml as a, markdownToText as b, memoizeProp as m };
@@ -0,0 +1,22 @@
1
+ import { i as invariant } from './core.D4npX2q8.mjs';
2
+
3
+ function t(n){return typeof n=="function"}
4
+
5
+ function ifilter(arg1, arg2) {
6
+ const pred = arg2 ?? arg1;
7
+ invariant(t(pred));
8
+ function* _filter(iter) {
9
+ for (const value of iter) {
10
+ if (pred(value)) {
11
+ yield value;
12
+ }
13
+ }
14
+ return;
15
+ }
16
+ if (!arg2) {
17
+ return _filter;
18
+ }
19
+ return _filter(arg1);
20
+ }
21
+
22
+ export { ifilter as i, t };
@@ -0,0 +1,177 @@
1
+ import { r as getDefaultExportFromCjs } from './core.C_C-3c1S.mjs';
2
+
3
+ /**
4
+ * Mnemonist DefaultMap
5
+ * =====================
6
+ *
7
+ * JavaScript implementation of a default map that will return a constructed
8
+ * value any time one tries to access an inexisting key. It's quite similar
9
+ * to python's defaultdict.
10
+ */
11
+
12
+ var defaultMap;
13
+ var hasRequiredDefaultMap;
14
+
15
+ function requireDefaultMap () {
16
+ if (hasRequiredDefaultMap) return defaultMap;
17
+ hasRequiredDefaultMap = 1;
18
+ /**
19
+ * DefaultMap.
20
+ *
21
+ * @constructor
22
+ */
23
+ function DefaultMap(factory) {
24
+ if (typeof factory !== 'function')
25
+ throw new Error('mnemonist/DefaultMap.constructor: expecting a function.');
26
+
27
+ this.items = new Map();
28
+ this.factory = factory;
29
+ this.size = 0;
30
+ }
31
+
32
+ /**
33
+ * Method used to clear the structure.
34
+ *
35
+ * @return {undefined}
36
+ */
37
+ DefaultMap.prototype.clear = function() {
38
+
39
+ // Properties
40
+ this.items.clear();
41
+ this.size = 0;
42
+ };
43
+
44
+ /**
45
+ * Method used to get the value set for given key. If the key does not exist,
46
+ * the value will be created using the provided factory.
47
+ *
48
+ * @param {any} key - Target key.
49
+ * @return {any}
50
+ */
51
+ DefaultMap.prototype.get = function(key) {
52
+ var value = this.items.get(key);
53
+
54
+ if (typeof value === 'undefined') {
55
+ value = this.factory(key, this.size);
56
+ this.items.set(key, value);
57
+ this.size++;
58
+ }
59
+
60
+ return value;
61
+ };
62
+
63
+ /**
64
+ * Method used to get the value set for given key. If the key does not exist,
65
+ * a value won't be created.
66
+ *
67
+ * @param {any} key - Target key.
68
+ * @return {any}
69
+ */
70
+ DefaultMap.prototype.peek = function(key) {
71
+ return this.items.get(key);
72
+ };
73
+
74
+ /**
75
+ * Method used to set a value for given key.
76
+ *
77
+ * @param {any} key - Target key.
78
+ * @param {any} value - Value.
79
+ * @return {DefaultMap}
80
+ */
81
+ DefaultMap.prototype.set = function(key, value) {
82
+ this.items.set(key, value);
83
+ this.size = this.items.size;
84
+
85
+ return this;
86
+ };
87
+
88
+ /**
89
+ * Method used to test the existence of a key in the map.
90
+ *
91
+ * @param {any} key - Target key.
92
+ * @return {boolean}
93
+ */
94
+ DefaultMap.prototype.has = function(key) {
95
+ return this.items.has(key);
96
+ };
97
+
98
+ /**
99
+ * Method used to delete target key.
100
+ *
101
+ * @param {any} key - Target key.
102
+ * @return {boolean}
103
+ */
104
+ DefaultMap.prototype.delete = function(key) {
105
+ var deleted = this.items.delete(key);
106
+
107
+ this.size = this.items.size;
108
+
109
+ return deleted;
110
+ };
111
+
112
+ /**
113
+ * Method used to iterate over each of the key/value pairs.
114
+ *
115
+ * @param {function} callback - Function to call for each item.
116
+ * @param {object} scope - Optional scope.
117
+ * @return {undefined}
118
+ */
119
+ DefaultMap.prototype.forEach = function(callback, scope) {
120
+ scope = arguments.length > 1 ? scope : this;
121
+
122
+ this.items.forEach(callback, scope);
123
+ };
124
+
125
+ /**
126
+ * Iterators.
127
+ */
128
+ DefaultMap.prototype.entries = function() {
129
+ return this.items.entries();
130
+ };
131
+
132
+ DefaultMap.prototype.keys = function() {
133
+ return this.items.keys();
134
+ };
135
+
136
+ DefaultMap.prototype.values = function() {
137
+ return this.items.values();
138
+ };
139
+
140
+ /**
141
+ * Attaching the #.entries method to Symbol.iterator if possible.
142
+ */
143
+ if (typeof Symbol !== 'undefined')
144
+ DefaultMap.prototype[Symbol.iterator] = DefaultMap.prototype.entries;
145
+
146
+ /**
147
+ * Convenience known methods.
148
+ */
149
+ DefaultMap.prototype.inspect = function() {
150
+ return this.items;
151
+ };
152
+
153
+ if (typeof Symbol !== 'undefined')
154
+ DefaultMap.prototype[Symbol.for('nodejs.util.inspect.custom')] = DefaultMap.prototype.inspect;
155
+
156
+ /**
157
+ * Typical factories.
158
+ */
159
+ DefaultMap.autoIncrement = function() {
160
+ var i = 0;
161
+
162
+ return function() {
163
+ return i++;
164
+ };
165
+ };
166
+
167
+ /**
168
+ * Exporting.
169
+ */
170
+ defaultMap = DefaultMap;
171
+ return defaultMap;
172
+ }
173
+
174
+ var defaultMapExports = /*@__PURE__*/ requireDefaultMap();
175
+ const DefaultMap = /*@__PURE__*/getDefaultExportFromCjs(defaultMapExports);
176
+
177
+ export { DefaultMap as D };