@likec4/core 1.46.4 → 1.48.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.
- package/LICENSE +1 -1
- package/dist/_chunks/Builder.view-element.mjs +3284 -0
- package/dist/_chunks/LikeC4Model.d.mts +1287 -0
- package/dist/_chunks/LikeC4Styles.mjs +691 -0
- package/dist/_chunks/RichText.d.mts +84 -0
- package/dist/_chunks/RichText.mjs +148 -0
- package/dist/_chunks/_aux.d.mts +289 -0
- package/dist/_chunks/_aux.mjs +18 -0
- package/dist/_chunks/_types.d.mts +781 -0
- package/dist/_chunks/_types2.d.mts +38 -0
- package/dist/_chunks/assignTagColors.mjs +24 -0
- package/dist/_chunks/calcDriftsFromSnapshot.mjs +379 -0
- package/dist/_chunks/connection.mjs +0 -0
- package/dist/_chunks/const.d.mts +43 -0
- package/dist/_chunks/const.mjs +33 -0
- package/dist/_chunks/expression-model.d.mts +192 -0
- package/dist/_chunks/expression-model.mjs +103 -0
- package/dist/_chunks/expression.d.mts +347 -0
- package/dist/_chunks/expression.mjs +107 -0
- package/dist/_chunks/find.d.mts +82 -0
- package/dist/_chunks/find.mjs +646 -0
- package/dist/_chunks/find2.d.mts +78 -0
- package/dist/_chunks/find2.mjs +287 -0
- package/dist/_chunks/fqnRef.d.mts +58 -0
- package/dist/_chunks/fqnRef.mjs +41 -0
- package/dist/_chunks/geometry.mjs +335 -0
- package/dist/_chunks/index.d.mts +169 -0
- package/dist/_chunks/index2.d.mts +937 -0
- package/dist/_chunks/index3.d.mts +146 -0
- package/dist/_chunks/index4.d.mts +62 -0
- package/dist/_chunks/index5.d.mts +42 -0
- package/dist/_chunks/index6.d.mts +43 -0
- package/dist/{shared/core.OtRNdMxy.d.mts → _chunks/index7.d.mts} +113 -197
- package/dist/_chunks/index8.d.mts +144 -0
- package/dist/_chunks/invariant.mjs +18 -0
- package/dist/_chunks/iterable.mjs +146 -0
- package/dist/_chunks/libs/@mantine/colors-generator.mjs +3416 -0
- package/dist/_chunks/libs/@ungap/structured-clone.mjs +213 -0
- package/dist/_chunks/libs/bail.mjs +14 -0
- package/dist/_chunks/libs/ccount.mjs +25 -0
- package/dist/_chunks/libs/character-entities-html4.mjs +263 -0
- package/dist/_chunks/libs/character-entities-legacy.mjs +117 -0
- package/dist/_chunks/libs/character-entities.mjs +2136 -0
- package/dist/_chunks/libs/comma-separated-tokens.mjs +18 -0
- package/dist/_chunks/libs/decode-named-character-reference.mjs +21 -0
- package/dist/_chunks/libs/defu.mjs +42 -0
- package/dist/_chunks/libs/devlop.mjs +5 -0
- package/dist/_chunks/libs/escape-string-regexp.mjs +8 -0
- package/dist/_chunks/libs/extend.mjs +77 -0
- package/dist/_chunks/libs/graphology-dag.mjs +703 -0
- package/dist/_chunks/libs/graphology-types.d.mts +601 -0
- package/dist/_chunks/libs/graphology.d.mts +6 -0
- package/dist/_chunks/libs/graphology.mjs +4565 -0
- package/dist/_chunks/libs/hast-util-sanitize.mjs +863 -0
- package/dist/_chunks/libs/hast-util-to-html.mjs +2696 -0
- package/dist/_chunks/libs/is-plain-obj.mjs +9 -0
- package/dist/_chunks/libs/longest-streak.mjs +30 -0
- package/dist/_chunks/libs/markdown-table.mjs +290 -0
- package/dist/_chunks/libs/mdast-util-find-and-replace.mjs +653 -0
- package/dist/_chunks/libs/mdast-util-from-markdown.mjs +8522 -0
- package/dist/_chunks/libs/mdast-util-gfm.mjs +2393 -0
- package/dist/_chunks/libs/mdast-util-to-hast.mjs +1803 -0
- package/dist/_chunks/libs/micromark-extension-gfm.mjs +2243 -0
- package/dist/_chunks/libs/mnemonist.d.mts +254 -0
- package/dist/_chunks/libs/mnemonist.mjs +1978 -0
- package/dist/_chunks/libs/natural-compare-lite.mjs +42 -0
- package/dist/_chunks/libs/rehype-sanitize.mjs +29 -0
- package/dist/_chunks/libs/rehype-stringify.mjs +34 -0
- package/dist/_chunks/libs/remark-gfm.mjs +36 -0
- package/dist/_chunks/libs/remark-github-blockquote-alert.mjs +100 -0
- package/dist/_chunks/libs/remark-parse.mjs +39 -0
- package/dist/_chunks/libs/remark-rehype.mjs +171 -0
- package/dist/_chunks/libs/remeda.mjs +702 -0
- package/dist/_chunks/libs/trough.mjs +158 -0
- package/dist/_chunks/libs/unified.mjs +2212 -0
- package/dist/_chunks/mnemonist.d.mts +1 -0
- package/dist/_chunks/mnemonist.mjs +0 -0
- package/dist/_chunks/model.mjs +1898 -0
- package/dist/_chunks/model2.mjs +0 -0
- package/dist/_chunks/relationships-view.mjs +132 -0
- package/dist/_chunks/rolldown-runtime.mjs +42 -0
- package/dist/{shared/core.C_3y3eqV.d.mts → _chunks/scalar.d.mts} +13 -43
- package/dist/_chunks/scalar.mjs +84 -0
- package/dist/_chunks/utils.mjs +483 -0
- package/dist/builder/index.d.mts +11 -773
- package/dist/builder/index.mjs +631 -978
- package/dist/compute-view/index.d.mts +90 -27
- package/dist/compute-view/index.mjs +253 -83
- package/dist/compute-view/relationships-view/index.d.mts +16 -51
- package/dist/compute-view/relationships-view/index.mjs +6 -184
- package/dist/geometry/index.d.mts +2 -109
- package/dist/geometry/index.mjs +2 -327
- package/dist/index.d.mts +18 -20
- package/dist/index.mjs +27 -18
- package/dist/model/connection/deployment/index.d.mts +12 -15
- package/dist/model/connection/deployment/index.mjs +9 -2
- package/dist/model/connection/index.d.mts +14 -75
- package/dist/model/connection/index.mjs +10 -3
- package/dist/model/connection/model/index.d.mts +12 -15
- package/dist/model/connection/model/index.mjs +8 -2
- package/dist/model/index.d.mts +15 -57
- package/dist/model/index.mjs +11 -4
- package/dist/styles/index.d.mts +9 -117
- package/dist/styles/index.mjs +26 -59
- package/dist/types/RichText.d.mts +3 -0
- package/dist/types/RichText.mjs +7 -0
- package/dist/types/_aux.d.mts +3 -4
- package/dist/types/_aux.mjs +2 -7
- package/dist/types/expression-model.d.mts +6 -190
- package/dist/types/expression-model.mjs +6 -108
- package/dist/types/expression.d.mts +5 -6
- package/dist/types/expression.mjs +6 -112
- package/dist/types/fqnRef.d.mts +4 -60
- package/dist/types/fqnRef.mjs +6 -44
- package/dist/types/index.d.mts +9 -47
- package/dist/types/index.mjs +14 -16
- package/dist/types/scalar.d.mts +2 -2
- package/dist/types/scalar.mjs +7 -4
- package/dist/utils/graphology/index.d.mts +2 -1864
- package/dist/utils/graphology/index.mjs +3 -1
- package/dist/utils/index.d.mts +11 -124
- package/dist/utils/index.mjs +16 -43
- package/dist/utils/iterable/index.d.mts +9 -132
- package/dist/utils/iterable/index.mjs +2 -61
- package/dist/utils/mnemonist.d.mts +2 -0
- package/dist/utils/mnemonist.mjs +12 -0
- package/package.json +18 -22
- package/compute-view/relationships/package.json +0 -4
- package/dist/shared/core.3ZhnKAlZ.mjs +0 -106
- package/dist/shared/core.78IWAHAE.mjs +0 -332
- package/dist/shared/core.B85MJLTf.mjs +0 -5
- package/dist/shared/core.BFd1lU9R.mjs +0 -29
- package/dist/shared/core.BKlholso.mjs +0 -3
- package/dist/shared/core.BPGOjone.d.mts +0 -46
- package/dist/shared/core.BYdtmqY5.mjs +0 -1255
- package/dist/shared/core.BZCgljZd.d.mts +0 -83
- package/dist/shared/core.BbE4y-yl.mjs +0 -177
- package/dist/shared/core.BhNcrwzK.mjs +0 -7
- package/dist/shared/core.BkVA6gjl.mjs +0 -5
- package/dist/shared/core.BoYfZOBm.mjs +0 -3
- package/dist/shared/core.BsSXS-_R.mjs +0 -7
- package/dist/shared/core.BspBF3SJ.mjs +0 -3944
- package/dist/shared/core.BvPm_-u3.d.mts +0 -334
- package/dist/shared/core.C-Jdx7xo.d.mts +0 -1263
- package/dist/shared/core.C3JowhaZ.mjs +0 -32
- package/dist/shared/core.C4x8aaWa.mjs +0 -27
- package/dist/shared/core.CBLX4mT8.mjs +0 -28411
- package/dist/shared/core.CLSZtnFh.mjs +0 -69
- package/dist/shared/core.CRhT4Iio.mjs +0 -785
- package/dist/shared/core.CbT8JVYL.mjs +0 -5
- package/dist/shared/core.CdNCAwq7.mjs +0 -176
- package/dist/shared/core.ClTP6-TN.d.mts +0 -87
- package/dist/shared/core.CmGY9blO.mjs +0 -6717
- package/dist/shared/core.CmPXpJ8l.mjs +0 -21
- package/dist/shared/core.Coi_LOUZ.mjs +0 -7
- package/dist/shared/core.CqAJJpK_.mjs +0 -3
- package/dist/shared/core.Ctj2S3bD.d.mts +0 -466
- package/dist/shared/core.CywrQs86.d.mts +0 -31
- package/dist/shared/core.D00YbOhQ.d.mts +0 -300
- package/dist/shared/core.D0WZutNd.mjs +0 -94
- package/dist/shared/core.D4npX2q8.mjs +0 -18
- package/dist/shared/core.DB0Ue5Wx.d.mts +0 -70
- package/dist/shared/core.DEK-BO3_.mjs +0 -1206
- package/dist/shared/core.DH7TXqXf.mjs +0 -136
- package/dist/shared/core.DRJma0Ol.mjs +0 -22
- package/dist/shared/core.DSalPD6v.mjs +0 -1352
- package/dist/shared/core.DVfPJPJj.mjs +0 -2200
- package/dist/shared/core.DXhDWKFZ.d.mts +0 -3
- package/dist/shared/core.DbfO90vF.mjs +0 -434
- package/dist/shared/core.DcS-0zys.mjs +0 -10
- package/dist/shared/core.DeDCYTDR.d.mts +0 -98
- package/dist/shared/core.DpKY_3NF.d.mts +0 -504
- package/dist/shared/core.Dt0v3djy.d.mts +0 -41
- package/dist/shared/core.FZ305VYd.mjs +0 -21
- package/dist/shared/core.RfnaEmgA.mjs +0 -7
- package/dist/shared/core.oSV6SRfk.mjs +0 -13
- package/dist/shared/core.om36dXXW.mjs +0 -41
- package/dist/shared/core.q10OP9oJ.mjs +0 -5
- package/dist/shared/core.uFk_o9X6.mjs +0 -13
- package/dist/shared/core.xeuDd__E.mjs +0 -300
- package/dist/shared/core.xgoPk2RG.mjs +0 -4989
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/@ungap+structured-clone@1.3.0/node_modules/@ungap/structured-clone/esm/types.js
|
|
2
|
+
const VOID = -1;
|
|
3
|
+
const PRIMITIVE = 0;
|
|
4
|
+
const ARRAY = 1;
|
|
5
|
+
const OBJECT = 2;
|
|
6
|
+
const DATE = 3;
|
|
7
|
+
const REGEXP = 4;
|
|
8
|
+
const MAP = 5;
|
|
9
|
+
const SET = 6;
|
|
10
|
+
const ERROR = 7;
|
|
11
|
+
const BIGINT = 8;
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region ../../node_modules/.pnpm/@ungap+structured-clone@1.3.0/node_modules/@ungap/structured-clone/esm/deserialize.js
|
|
15
|
+
const env = typeof self === "object" ? self : globalThis;
|
|
16
|
+
const deserializer = ($, _) => {
|
|
17
|
+
const as = (out, index) => {
|
|
18
|
+
$.set(index, out);
|
|
19
|
+
return out;
|
|
20
|
+
};
|
|
21
|
+
const unpair = (index) => {
|
|
22
|
+
if ($.has(index)) return $.get(index);
|
|
23
|
+
const [type, value] = _[index];
|
|
24
|
+
switch (type) {
|
|
25
|
+
case PRIMITIVE:
|
|
26
|
+
case VOID: return as(value, index);
|
|
27
|
+
case ARRAY: {
|
|
28
|
+
const arr = as([], index);
|
|
29
|
+
for (const index of value) arr.push(unpair(index));
|
|
30
|
+
return arr;
|
|
31
|
+
}
|
|
32
|
+
case OBJECT: {
|
|
33
|
+
const object = as({}, index);
|
|
34
|
+
for (const [key, index] of value) object[unpair(key)] = unpair(index);
|
|
35
|
+
return object;
|
|
36
|
+
}
|
|
37
|
+
case DATE: return as(new Date(value), index);
|
|
38
|
+
case REGEXP: {
|
|
39
|
+
const { source, flags } = value;
|
|
40
|
+
return as(new RegExp(source, flags), index);
|
|
41
|
+
}
|
|
42
|
+
case MAP: {
|
|
43
|
+
const map = as(/* @__PURE__ */ new Map(), index);
|
|
44
|
+
for (const [key, index] of value) map.set(unpair(key), unpair(index));
|
|
45
|
+
return map;
|
|
46
|
+
}
|
|
47
|
+
case SET: {
|
|
48
|
+
const set = as(/* @__PURE__ */ new Set(), index);
|
|
49
|
+
for (const index of value) set.add(unpair(index));
|
|
50
|
+
return set;
|
|
51
|
+
}
|
|
52
|
+
case ERROR: {
|
|
53
|
+
const { name, message } = value;
|
|
54
|
+
return as(new env[name](message), index);
|
|
55
|
+
}
|
|
56
|
+
case BIGINT: return as(BigInt(value), index);
|
|
57
|
+
case "BigInt": return as(Object(BigInt(value)), index);
|
|
58
|
+
case "ArrayBuffer": return as(new Uint8Array(value).buffer, value);
|
|
59
|
+
case "DataView": {
|
|
60
|
+
const { buffer } = new Uint8Array(value);
|
|
61
|
+
return as(new DataView(buffer), value);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return as(new env[type](value), index);
|
|
65
|
+
};
|
|
66
|
+
return unpair;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* @typedef {Array<string,any>} Record a type representation
|
|
70
|
+
*/
|
|
71
|
+
/**
|
|
72
|
+
* Returns a deserialized value from a serialized array of Records.
|
|
73
|
+
* @param {Record[]} serialized a previously serialized value.
|
|
74
|
+
* @returns {any}
|
|
75
|
+
*/
|
|
76
|
+
const deserialize = (serialized) => deserializer(/* @__PURE__ */ new Map(), serialized)(0);
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region ../../node_modules/.pnpm/@ungap+structured-clone@1.3.0/node_modules/@ungap/structured-clone/esm/serialize.js
|
|
80
|
+
const EMPTY = "";
|
|
81
|
+
const { toString } = {};
|
|
82
|
+
const { keys } = Object;
|
|
83
|
+
const typeOf = (value) => {
|
|
84
|
+
const type = typeof value;
|
|
85
|
+
if (type !== "object" || !value) return [PRIMITIVE, type];
|
|
86
|
+
const asString = toString.call(value).slice(8, -1);
|
|
87
|
+
switch (asString) {
|
|
88
|
+
case "Array": return [ARRAY, EMPTY];
|
|
89
|
+
case "Object": return [OBJECT, EMPTY];
|
|
90
|
+
case "Date": return [DATE, EMPTY];
|
|
91
|
+
case "RegExp": return [REGEXP, EMPTY];
|
|
92
|
+
case "Map": return [MAP, EMPTY];
|
|
93
|
+
case "Set": return [SET, EMPTY];
|
|
94
|
+
case "DataView": return [ARRAY, asString];
|
|
95
|
+
}
|
|
96
|
+
if (asString.includes("Array")) return [ARRAY, asString];
|
|
97
|
+
if (asString.includes("Error")) return [ERROR, asString];
|
|
98
|
+
return [OBJECT, asString];
|
|
99
|
+
};
|
|
100
|
+
const shouldSkip = ([TYPE, type]) => TYPE === PRIMITIVE && (type === "function" || type === "symbol");
|
|
101
|
+
const serializer = (strict, json, $, _) => {
|
|
102
|
+
const as = (out, value) => {
|
|
103
|
+
const index = _.push(out) - 1;
|
|
104
|
+
$.set(value, index);
|
|
105
|
+
return index;
|
|
106
|
+
};
|
|
107
|
+
const pair = (value) => {
|
|
108
|
+
if ($.has(value)) return $.get(value);
|
|
109
|
+
let [TYPE, type] = typeOf(value);
|
|
110
|
+
switch (TYPE) {
|
|
111
|
+
case PRIMITIVE: {
|
|
112
|
+
let entry = value;
|
|
113
|
+
switch (type) {
|
|
114
|
+
case "bigint":
|
|
115
|
+
TYPE = BIGINT;
|
|
116
|
+
entry = value.toString();
|
|
117
|
+
break;
|
|
118
|
+
case "function":
|
|
119
|
+
case "symbol":
|
|
120
|
+
if (strict) throw new TypeError("unable to serialize " + type);
|
|
121
|
+
entry = null;
|
|
122
|
+
break;
|
|
123
|
+
case "undefined": return as([VOID], value);
|
|
124
|
+
}
|
|
125
|
+
return as([TYPE, entry], value);
|
|
126
|
+
}
|
|
127
|
+
case ARRAY: {
|
|
128
|
+
if (type) {
|
|
129
|
+
let spread = value;
|
|
130
|
+
if (type === "DataView") spread = new Uint8Array(value.buffer);
|
|
131
|
+
else if (type === "ArrayBuffer") spread = new Uint8Array(value);
|
|
132
|
+
return as([type, [...spread]], value);
|
|
133
|
+
}
|
|
134
|
+
const arr = [];
|
|
135
|
+
const index = as([TYPE, arr], value);
|
|
136
|
+
for (const entry of value) arr.push(pair(entry));
|
|
137
|
+
return index;
|
|
138
|
+
}
|
|
139
|
+
case OBJECT: {
|
|
140
|
+
if (type) switch (type) {
|
|
141
|
+
case "BigInt": return as([type, value.toString()], value);
|
|
142
|
+
case "Boolean":
|
|
143
|
+
case "Number":
|
|
144
|
+
case "String": return as([type, value.valueOf()], value);
|
|
145
|
+
}
|
|
146
|
+
if (json && "toJSON" in value) return pair(value.toJSON());
|
|
147
|
+
const entries = [];
|
|
148
|
+
const index = as([TYPE, entries], value);
|
|
149
|
+
for (const key of keys(value)) if (strict || !shouldSkip(typeOf(value[key]))) entries.push([pair(key), pair(value[key])]);
|
|
150
|
+
return index;
|
|
151
|
+
}
|
|
152
|
+
case DATE: return as([TYPE, value.toISOString()], value);
|
|
153
|
+
case REGEXP: {
|
|
154
|
+
const { source, flags } = value;
|
|
155
|
+
return as([TYPE, {
|
|
156
|
+
source,
|
|
157
|
+
flags
|
|
158
|
+
}], value);
|
|
159
|
+
}
|
|
160
|
+
case MAP: {
|
|
161
|
+
const entries = [];
|
|
162
|
+
const index = as([TYPE, entries], value);
|
|
163
|
+
for (const [key, entry] of value) if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry)))) entries.push([pair(key), pair(entry)]);
|
|
164
|
+
return index;
|
|
165
|
+
}
|
|
166
|
+
case SET: {
|
|
167
|
+
const entries = [];
|
|
168
|
+
const index = as([TYPE, entries], value);
|
|
169
|
+
for (const entry of value) if (strict || !shouldSkip(typeOf(entry))) entries.push(pair(entry));
|
|
170
|
+
return index;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const { message } = value;
|
|
174
|
+
return as([TYPE, {
|
|
175
|
+
name: type,
|
|
176
|
+
message
|
|
177
|
+
}], value);
|
|
178
|
+
};
|
|
179
|
+
return pair;
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* @typedef {Array<string,any>} Record a type representation
|
|
183
|
+
*/
|
|
184
|
+
/**
|
|
185
|
+
* Returns an array of serialized Records.
|
|
186
|
+
* @param {any} value a serializable value.
|
|
187
|
+
* @param {{json?: boolean, lossy?: boolean}?} options an object with a `lossy` or `json` property that,
|
|
188
|
+
* if `true`, will not throw errors on incompatible types, and behave more
|
|
189
|
+
* like JSON stringify would behave. Symbol and Function will be discarded.
|
|
190
|
+
* @returns {Record[]}
|
|
191
|
+
*/
|
|
192
|
+
const serialize = (value, { json, lossy } = {}) => {
|
|
193
|
+
const _ = [];
|
|
194
|
+
return serializer(!(json || lossy), !!json, /* @__PURE__ */ new Map(), _)(value), _;
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region ../../node_modules/.pnpm/@ungap+structured-clone@1.3.0/node_modules/@ungap/structured-clone/esm/index.js
|
|
199
|
+
/**
|
|
200
|
+
* @typedef {Array<string,any>} Record a type representation
|
|
201
|
+
*/
|
|
202
|
+
/**
|
|
203
|
+
* Returns an array of serialized Records.
|
|
204
|
+
* @param {any} any a serializable value.
|
|
205
|
+
* @param {{transfer?: any[], json?: boolean, lossy?: boolean}?} options an object with
|
|
206
|
+
* a transfer option (ignored when polyfilled) and/or non standard fields that
|
|
207
|
+
* fallback to the polyfill if present.
|
|
208
|
+
* @returns {Record[]}
|
|
209
|
+
*/
|
|
210
|
+
var esm_default = typeof structuredClone === "function" ? (any, options) => options && ("json" in options || "lossy" in options) ? deserialize(serialize(any, options)) : structuredClone(any) : (any, options) => deserialize(serialize(any, options));
|
|
211
|
+
|
|
212
|
+
//#endregion
|
|
213
|
+
export { esm_default as t };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/bail@2.0.2/node_modules/bail/index.js
|
|
2
|
+
/**
|
|
3
|
+
* Throw a given error.
|
|
4
|
+
*
|
|
5
|
+
* @param {Error|null|undefined} [error]
|
|
6
|
+
* Maybe error.
|
|
7
|
+
* @returns {asserts error is null|undefined}
|
|
8
|
+
*/
|
|
9
|
+
function bail(error) {
|
|
10
|
+
if (error) throw error;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
export { bail as t };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/ccount@2.0.1/node_modules/ccount/index.js
|
|
2
|
+
/**
|
|
3
|
+
* Count how often a character (or substring) is used in a string.
|
|
4
|
+
*
|
|
5
|
+
* @param {string} value
|
|
6
|
+
* Value to search in.
|
|
7
|
+
* @param {string} character
|
|
8
|
+
* Character (or substring) to look for.
|
|
9
|
+
* @return {number}
|
|
10
|
+
* Number of times `character` occurred in `value`.
|
|
11
|
+
*/
|
|
12
|
+
function ccount(value, character) {
|
|
13
|
+
const source = String(value);
|
|
14
|
+
if (typeof character !== "string") throw new TypeError("Expected character");
|
|
15
|
+
let count = 0;
|
|
16
|
+
let index = source.indexOf(character);
|
|
17
|
+
while (index !== -1) {
|
|
18
|
+
count++;
|
|
19
|
+
index = source.indexOf(character, index + character.length);
|
|
20
|
+
}
|
|
21
|
+
return count;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { ccount as t };
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/character-entities-html4@2.1.0/node_modules/character-entities-html4/index.js
|
|
2
|
+
/**
|
|
3
|
+
* Map of named character references from HTML 4.
|
|
4
|
+
*
|
|
5
|
+
* @type {Record<string, string>}
|
|
6
|
+
*/
|
|
7
|
+
const characterEntitiesHtml4 = {
|
|
8
|
+
nbsp: "\xA0",
|
|
9
|
+
iexcl: "¡",
|
|
10
|
+
cent: "¢",
|
|
11
|
+
pound: "£",
|
|
12
|
+
curren: "¤",
|
|
13
|
+
yen: "¥",
|
|
14
|
+
brvbar: "¦",
|
|
15
|
+
sect: "§",
|
|
16
|
+
uml: "¨",
|
|
17
|
+
copy: "©",
|
|
18
|
+
ordf: "ª",
|
|
19
|
+
laquo: "«",
|
|
20
|
+
not: "¬",
|
|
21
|
+
shy: "",
|
|
22
|
+
reg: "®",
|
|
23
|
+
macr: "¯",
|
|
24
|
+
deg: "°",
|
|
25
|
+
plusmn: "±",
|
|
26
|
+
sup2: "²",
|
|
27
|
+
sup3: "³",
|
|
28
|
+
acute: "´",
|
|
29
|
+
micro: "µ",
|
|
30
|
+
para: "¶",
|
|
31
|
+
middot: "·",
|
|
32
|
+
cedil: "¸",
|
|
33
|
+
sup1: "¹",
|
|
34
|
+
ordm: "º",
|
|
35
|
+
raquo: "»",
|
|
36
|
+
frac14: "¼",
|
|
37
|
+
frac12: "½",
|
|
38
|
+
frac34: "¾",
|
|
39
|
+
iquest: "¿",
|
|
40
|
+
Agrave: "À",
|
|
41
|
+
Aacute: "Á",
|
|
42
|
+
Acirc: "Â",
|
|
43
|
+
Atilde: "Ã",
|
|
44
|
+
Auml: "Ä",
|
|
45
|
+
Aring: "Å",
|
|
46
|
+
AElig: "Æ",
|
|
47
|
+
Ccedil: "Ç",
|
|
48
|
+
Egrave: "È",
|
|
49
|
+
Eacute: "É",
|
|
50
|
+
Ecirc: "Ê",
|
|
51
|
+
Euml: "Ë",
|
|
52
|
+
Igrave: "Ì",
|
|
53
|
+
Iacute: "Í",
|
|
54
|
+
Icirc: "Î",
|
|
55
|
+
Iuml: "Ï",
|
|
56
|
+
ETH: "Ð",
|
|
57
|
+
Ntilde: "Ñ",
|
|
58
|
+
Ograve: "Ò",
|
|
59
|
+
Oacute: "Ó",
|
|
60
|
+
Ocirc: "Ô",
|
|
61
|
+
Otilde: "Õ",
|
|
62
|
+
Ouml: "Ö",
|
|
63
|
+
times: "×",
|
|
64
|
+
Oslash: "Ø",
|
|
65
|
+
Ugrave: "Ù",
|
|
66
|
+
Uacute: "Ú",
|
|
67
|
+
Ucirc: "Û",
|
|
68
|
+
Uuml: "Ü",
|
|
69
|
+
Yacute: "Ý",
|
|
70
|
+
THORN: "Þ",
|
|
71
|
+
szlig: "ß",
|
|
72
|
+
agrave: "à",
|
|
73
|
+
aacute: "á",
|
|
74
|
+
acirc: "â",
|
|
75
|
+
atilde: "ã",
|
|
76
|
+
auml: "ä",
|
|
77
|
+
aring: "å",
|
|
78
|
+
aelig: "æ",
|
|
79
|
+
ccedil: "ç",
|
|
80
|
+
egrave: "è",
|
|
81
|
+
eacute: "é",
|
|
82
|
+
ecirc: "ê",
|
|
83
|
+
euml: "ë",
|
|
84
|
+
igrave: "ì",
|
|
85
|
+
iacute: "í",
|
|
86
|
+
icirc: "î",
|
|
87
|
+
iuml: "ï",
|
|
88
|
+
eth: "ð",
|
|
89
|
+
ntilde: "ñ",
|
|
90
|
+
ograve: "ò",
|
|
91
|
+
oacute: "ó",
|
|
92
|
+
ocirc: "ô",
|
|
93
|
+
otilde: "õ",
|
|
94
|
+
ouml: "ö",
|
|
95
|
+
divide: "÷",
|
|
96
|
+
oslash: "ø",
|
|
97
|
+
ugrave: "ù",
|
|
98
|
+
uacute: "ú",
|
|
99
|
+
ucirc: "û",
|
|
100
|
+
uuml: "ü",
|
|
101
|
+
yacute: "ý",
|
|
102
|
+
thorn: "þ",
|
|
103
|
+
yuml: "ÿ",
|
|
104
|
+
fnof: "ƒ",
|
|
105
|
+
Alpha: "Α",
|
|
106
|
+
Beta: "Β",
|
|
107
|
+
Gamma: "Γ",
|
|
108
|
+
Delta: "Δ",
|
|
109
|
+
Epsilon: "Ε",
|
|
110
|
+
Zeta: "Ζ",
|
|
111
|
+
Eta: "Η",
|
|
112
|
+
Theta: "Θ",
|
|
113
|
+
Iota: "Ι",
|
|
114
|
+
Kappa: "Κ",
|
|
115
|
+
Lambda: "Λ",
|
|
116
|
+
Mu: "Μ",
|
|
117
|
+
Nu: "Ν",
|
|
118
|
+
Xi: "Ξ",
|
|
119
|
+
Omicron: "Ο",
|
|
120
|
+
Pi: "Π",
|
|
121
|
+
Rho: "Ρ",
|
|
122
|
+
Sigma: "Σ",
|
|
123
|
+
Tau: "Τ",
|
|
124
|
+
Upsilon: "Υ",
|
|
125
|
+
Phi: "Φ",
|
|
126
|
+
Chi: "Χ",
|
|
127
|
+
Psi: "Ψ",
|
|
128
|
+
Omega: "Ω",
|
|
129
|
+
alpha: "α",
|
|
130
|
+
beta: "β",
|
|
131
|
+
gamma: "γ",
|
|
132
|
+
delta: "δ",
|
|
133
|
+
epsilon: "ε",
|
|
134
|
+
zeta: "ζ",
|
|
135
|
+
eta: "η",
|
|
136
|
+
theta: "θ",
|
|
137
|
+
iota: "ι",
|
|
138
|
+
kappa: "κ",
|
|
139
|
+
lambda: "λ",
|
|
140
|
+
mu: "μ",
|
|
141
|
+
nu: "ν",
|
|
142
|
+
xi: "ξ",
|
|
143
|
+
omicron: "ο",
|
|
144
|
+
pi: "π",
|
|
145
|
+
rho: "ρ",
|
|
146
|
+
sigmaf: "ς",
|
|
147
|
+
sigma: "σ",
|
|
148
|
+
tau: "τ",
|
|
149
|
+
upsilon: "υ",
|
|
150
|
+
phi: "φ",
|
|
151
|
+
chi: "χ",
|
|
152
|
+
psi: "ψ",
|
|
153
|
+
omega: "ω",
|
|
154
|
+
thetasym: "ϑ",
|
|
155
|
+
upsih: "ϒ",
|
|
156
|
+
piv: "ϖ",
|
|
157
|
+
bull: "•",
|
|
158
|
+
hellip: "…",
|
|
159
|
+
prime: "′",
|
|
160
|
+
Prime: "″",
|
|
161
|
+
oline: "‾",
|
|
162
|
+
frasl: "⁄",
|
|
163
|
+
weierp: "℘",
|
|
164
|
+
image: "ℑ",
|
|
165
|
+
real: "ℜ",
|
|
166
|
+
trade: "™",
|
|
167
|
+
alefsym: "ℵ",
|
|
168
|
+
larr: "←",
|
|
169
|
+
uarr: "↑",
|
|
170
|
+
rarr: "→",
|
|
171
|
+
darr: "↓",
|
|
172
|
+
harr: "↔",
|
|
173
|
+
crarr: "↵",
|
|
174
|
+
lArr: "⇐",
|
|
175
|
+
uArr: "⇑",
|
|
176
|
+
rArr: "⇒",
|
|
177
|
+
dArr: "⇓",
|
|
178
|
+
hArr: "⇔",
|
|
179
|
+
forall: "∀",
|
|
180
|
+
part: "∂",
|
|
181
|
+
exist: "∃",
|
|
182
|
+
empty: "∅",
|
|
183
|
+
nabla: "∇",
|
|
184
|
+
isin: "∈",
|
|
185
|
+
notin: "∉",
|
|
186
|
+
ni: "∋",
|
|
187
|
+
prod: "∏",
|
|
188
|
+
sum: "∑",
|
|
189
|
+
minus: "−",
|
|
190
|
+
lowast: "∗",
|
|
191
|
+
radic: "√",
|
|
192
|
+
prop: "∝",
|
|
193
|
+
infin: "∞",
|
|
194
|
+
ang: "∠",
|
|
195
|
+
and: "∧",
|
|
196
|
+
or: "∨",
|
|
197
|
+
cap: "∩",
|
|
198
|
+
cup: "∪",
|
|
199
|
+
int: "∫",
|
|
200
|
+
there4: "∴",
|
|
201
|
+
sim: "∼",
|
|
202
|
+
cong: "≅",
|
|
203
|
+
asymp: "≈",
|
|
204
|
+
ne: "≠",
|
|
205
|
+
equiv: "≡",
|
|
206
|
+
le: "≤",
|
|
207
|
+
ge: "≥",
|
|
208
|
+
sub: "⊂",
|
|
209
|
+
sup: "⊃",
|
|
210
|
+
nsub: "⊄",
|
|
211
|
+
sube: "⊆",
|
|
212
|
+
supe: "⊇",
|
|
213
|
+
oplus: "⊕",
|
|
214
|
+
otimes: "⊗",
|
|
215
|
+
perp: "⊥",
|
|
216
|
+
sdot: "⋅",
|
|
217
|
+
lceil: "⌈",
|
|
218
|
+
rceil: "⌉",
|
|
219
|
+
lfloor: "⌊",
|
|
220
|
+
rfloor: "⌋",
|
|
221
|
+
lang: "〈",
|
|
222
|
+
rang: "〉",
|
|
223
|
+
loz: "◊",
|
|
224
|
+
spades: "♠",
|
|
225
|
+
clubs: "♣",
|
|
226
|
+
hearts: "♥",
|
|
227
|
+
diams: "♦",
|
|
228
|
+
quot: "\"",
|
|
229
|
+
amp: "&",
|
|
230
|
+
lt: "<",
|
|
231
|
+
gt: ">",
|
|
232
|
+
OElig: "Œ",
|
|
233
|
+
oelig: "œ",
|
|
234
|
+
Scaron: "Š",
|
|
235
|
+
scaron: "š",
|
|
236
|
+
Yuml: "Ÿ",
|
|
237
|
+
circ: "ˆ",
|
|
238
|
+
tilde: "˜",
|
|
239
|
+
ensp: " ",
|
|
240
|
+
emsp: " ",
|
|
241
|
+
thinsp: " ",
|
|
242
|
+
zwnj: "",
|
|
243
|
+
zwj: "",
|
|
244
|
+
lrm: "",
|
|
245
|
+
rlm: "",
|
|
246
|
+
ndash: "–",
|
|
247
|
+
mdash: "—",
|
|
248
|
+
lsquo: "‘",
|
|
249
|
+
rsquo: "’",
|
|
250
|
+
sbquo: "‚",
|
|
251
|
+
ldquo: "“",
|
|
252
|
+
rdquo: "”",
|
|
253
|
+
bdquo: "„",
|
|
254
|
+
dagger: "†",
|
|
255
|
+
Dagger: "‡",
|
|
256
|
+
permil: "‰",
|
|
257
|
+
lsaquo: "‹",
|
|
258
|
+
rsaquo: "›",
|
|
259
|
+
euro: "€"
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
//#endregion
|
|
263
|
+
export { characterEntitiesHtml4 as t };
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/character-entities-legacy@3.0.0/node_modules/character-entities-legacy/index.js
|
|
2
|
+
/**
|
|
3
|
+
* List of legacy HTML named character references that don’t need a trailing semicolon.
|
|
4
|
+
*
|
|
5
|
+
* @type {Array<string>}
|
|
6
|
+
*/
|
|
7
|
+
const characterEntitiesLegacy = [
|
|
8
|
+
"AElig",
|
|
9
|
+
"AMP",
|
|
10
|
+
"Aacute",
|
|
11
|
+
"Acirc",
|
|
12
|
+
"Agrave",
|
|
13
|
+
"Aring",
|
|
14
|
+
"Atilde",
|
|
15
|
+
"Auml",
|
|
16
|
+
"COPY",
|
|
17
|
+
"Ccedil",
|
|
18
|
+
"ETH",
|
|
19
|
+
"Eacute",
|
|
20
|
+
"Ecirc",
|
|
21
|
+
"Egrave",
|
|
22
|
+
"Euml",
|
|
23
|
+
"GT",
|
|
24
|
+
"Iacute",
|
|
25
|
+
"Icirc",
|
|
26
|
+
"Igrave",
|
|
27
|
+
"Iuml",
|
|
28
|
+
"LT",
|
|
29
|
+
"Ntilde",
|
|
30
|
+
"Oacute",
|
|
31
|
+
"Ocirc",
|
|
32
|
+
"Ograve",
|
|
33
|
+
"Oslash",
|
|
34
|
+
"Otilde",
|
|
35
|
+
"Ouml",
|
|
36
|
+
"QUOT",
|
|
37
|
+
"REG",
|
|
38
|
+
"THORN",
|
|
39
|
+
"Uacute",
|
|
40
|
+
"Ucirc",
|
|
41
|
+
"Ugrave",
|
|
42
|
+
"Uuml",
|
|
43
|
+
"Yacute",
|
|
44
|
+
"aacute",
|
|
45
|
+
"acirc",
|
|
46
|
+
"acute",
|
|
47
|
+
"aelig",
|
|
48
|
+
"agrave",
|
|
49
|
+
"amp",
|
|
50
|
+
"aring",
|
|
51
|
+
"atilde",
|
|
52
|
+
"auml",
|
|
53
|
+
"brvbar",
|
|
54
|
+
"ccedil",
|
|
55
|
+
"cedil",
|
|
56
|
+
"cent",
|
|
57
|
+
"copy",
|
|
58
|
+
"curren",
|
|
59
|
+
"deg",
|
|
60
|
+
"divide",
|
|
61
|
+
"eacute",
|
|
62
|
+
"ecirc",
|
|
63
|
+
"egrave",
|
|
64
|
+
"eth",
|
|
65
|
+
"euml",
|
|
66
|
+
"frac12",
|
|
67
|
+
"frac14",
|
|
68
|
+
"frac34",
|
|
69
|
+
"gt",
|
|
70
|
+
"iacute",
|
|
71
|
+
"icirc",
|
|
72
|
+
"iexcl",
|
|
73
|
+
"igrave",
|
|
74
|
+
"iquest",
|
|
75
|
+
"iuml",
|
|
76
|
+
"laquo",
|
|
77
|
+
"lt",
|
|
78
|
+
"macr",
|
|
79
|
+
"micro",
|
|
80
|
+
"middot",
|
|
81
|
+
"nbsp",
|
|
82
|
+
"not",
|
|
83
|
+
"ntilde",
|
|
84
|
+
"oacute",
|
|
85
|
+
"ocirc",
|
|
86
|
+
"ograve",
|
|
87
|
+
"ordf",
|
|
88
|
+
"ordm",
|
|
89
|
+
"oslash",
|
|
90
|
+
"otilde",
|
|
91
|
+
"ouml",
|
|
92
|
+
"para",
|
|
93
|
+
"plusmn",
|
|
94
|
+
"pound",
|
|
95
|
+
"quot",
|
|
96
|
+
"raquo",
|
|
97
|
+
"reg",
|
|
98
|
+
"sect",
|
|
99
|
+
"shy",
|
|
100
|
+
"sup1",
|
|
101
|
+
"sup2",
|
|
102
|
+
"sup3",
|
|
103
|
+
"szlig",
|
|
104
|
+
"thorn",
|
|
105
|
+
"times",
|
|
106
|
+
"uacute",
|
|
107
|
+
"ucirc",
|
|
108
|
+
"ugrave",
|
|
109
|
+
"uml",
|
|
110
|
+
"uuml",
|
|
111
|
+
"yacute",
|
|
112
|
+
"yen",
|
|
113
|
+
"yuml"
|
|
114
|
+
];
|
|
115
|
+
|
|
116
|
+
//#endregion
|
|
117
|
+
export { characterEntitiesLegacy as t };
|