@likec4/core 1.47.0 → 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 -775
- package/dist/builder/index.mjs +631 -1022
- package/dist/compute-view/index.d.mts +85 -56
- package/dist/compute-view/index.mjs +247 -214
- 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 +17 -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.BNN-3vPH.mjs +0 -1255
- package/dist/shared/core.BPGOjone.d.mts +0 -46
- package/dist/shared/core.BP_QHEXs.mjs +0 -785
- package/dist/shared/core.BbE4y-yl.mjs +0 -177
- package/dist/shared/core.Bdy3hhTc.mjs +0 -28382
- package/dist/shared/core.BfCKSW-g.d.mts +0 -1266
- 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.C3JowhaZ.mjs +0 -32
- package/dist/shared/core.C4x8aaWa.mjs +0 -27
- package/dist/shared/core.CAgYpDtM.d.mts +0 -98
- package/dist/shared/core.CHf8VEa3.mjs +0 -1206
- package/dist/shared/core.CLSZtnFh.mjs +0 -69
- package/dist/shared/core.CbT8JVYL.mjs +0 -5
- package/dist/shared/core.CdNCAwq7.mjs +0 -176
- 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.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.DC5IAaDT.d.mts +0 -334
- package/dist/shared/core.DE9qzhn8.d.mts +0 -83
- package/dist/shared/core.DGcIbsj4.mjs +0 -3946
- package/dist/shared/core.DH7TXqXf.mjs +0 -136
- package/dist/shared/core.DKhRkHRN.d.mts +0 -41
- package/dist/shared/core.DRJma0Ol.mjs +0 -22
- package/dist/shared/core.DU5SRqNF.mjs +0 -2209
- 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.Dh119QSP.mjs +0 -4995
- package/dist/shared/core.DjcWextK.mjs +0 -1371
- package/dist/shared/core.Dojz4bvg.d.mts +0 -504
- package/dist/shared/core.FZ305VYd.mjs +0 -21
- package/dist/shared/core.RfnaEmgA.mjs +0 -7
- package/dist/shared/core.btEq3i3f.mjs +0 -300
- package/dist/shared/core.oSV6SRfk.mjs +0 -13
- package/dist/shared/core.om36dXXW.mjs +0 -41
- package/dist/shared/core.osFs8tU7.d.mts +0 -466
- package/dist/shared/core.q10OP9oJ.mjs +0 -5
- package/dist/shared/core.tpvDGvdC.d.mts +0 -87
- package/dist/shared/core.uFk_o9X6.mjs +0 -13
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,124 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
*/
|
|
13
|
-
declare class Stack<T> implements Iterable<T> {
|
|
14
|
-
|
|
15
|
-
// Members
|
|
16
|
-
size: number;
|
|
17
|
-
|
|
18
|
-
// Constructor
|
|
19
|
-
constructor();
|
|
20
|
-
|
|
21
|
-
// Methods
|
|
22
|
-
clear(): void;
|
|
23
|
-
push(item: T): number;
|
|
24
|
-
pop(): T | undefined;
|
|
25
|
-
peek(): T | undefined;
|
|
26
|
-
forEach(callback: (item: T, index: number, stack: this) => void, scope?: any): void;
|
|
27
|
-
toArray(): Array<T>;
|
|
28
|
-
values(): IterableIterator<T>;
|
|
29
|
-
entries(): IterableIterator<[number, T]>;
|
|
30
|
-
[Symbol.iterator](): IterableIterator<T>;
|
|
31
|
-
toString(): string;
|
|
32
|
-
toJSON(): Array<T>;
|
|
33
|
-
inspect(): any;
|
|
34
|
-
|
|
35
|
-
// Statics
|
|
36
|
-
static from<I>(iterable: Iterable<I> | {[key: string]: I}): Stack<I>;
|
|
37
|
-
static of<I>(...items: Array<I>): Stack<I>;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Common head of two arrays
|
|
42
|
-
*
|
|
43
|
-
* @param equals - Equality function, defaults to `Object.is`
|
|
44
|
-
*/
|
|
45
|
-
declare function commonHead<T>(sources: ReadonlyArray<T>, targets: ReadonlyArray<T>, equals?: (a: T, b: T) => boolean): T[];
|
|
46
|
-
|
|
47
|
-
declare function compareNatural(a: string | undefined, b: string | undefined): -1 | 0 | 1;
|
|
48
|
-
/**
|
|
49
|
-
* Compares two strings lexicographically first, then hierarchically based on their depth.\
|
|
50
|
-
* From parent nodes to leaves
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* const lines = [
|
|
54
|
-
* 'b.c',
|
|
55
|
-
* 'b',
|
|
56
|
-
* 'a.b.c',
|
|
57
|
-
* ]
|
|
58
|
-
* lines.sort(compareNaturalHierarchically('.'))
|
|
59
|
-
* // [
|
|
60
|
-
* // 'a.b.c',
|
|
61
|
-
* // 'b',
|
|
62
|
-
* // 'b.c',
|
|
63
|
-
* // ]
|
|
64
|
-
*/
|
|
65
|
-
declare function compareNaturalHierarchically(separator?: string, deepestFirst?: boolean): (a: string | undefined, b: string | undefined) => number;
|
|
66
|
-
|
|
67
|
-
declare function getOrCreate<K, V>(map: Map<K, V>, key: K, create: (key: K) => V): V;
|
|
68
|
-
declare function getOrCreate<K extends WeakKey, V>(map: WeakMap<K, V>, key: K, create: (key: K) => V): V;
|
|
69
|
-
|
|
70
|
-
declare function delay(): Promise<string>;
|
|
71
|
-
declare function delay(ms: number): Promise<string>;
|
|
72
|
-
declare function delay(randomFrom: number, randomTo: number): Promise<string>;
|
|
73
|
-
declare function promiseNextTick(): Promise<void>;
|
|
74
|
-
declare function onNextTick(fn: () => Promise<void> | void): void;
|
|
75
|
-
|
|
76
|
-
type RelationshipLike = {
|
|
77
|
-
source: {
|
|
78
|
-
id: string;
|
|
79
|
-
};
|
|
80
|
-
target: {
|
|
81
|
-
id: string;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* Compares two relations hierarchically.
|
|
86
|
-
* From the most general (implicit) to the most specific (deepest in the tree)
|
|
87
|
-
*/
|
|
88
|
-
declare const compareRelations: <T extends RelationshipLike>(a: T, b: T) => number;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Returns new set as a union of given sets
|
|
92
|
-
* Keeps order of elements
|
|
93
|
-
*/
|
|
94
|
-
declare function union<T>(...sets: ReadonlySet<T>[]): Set<T>;
|
|
95
|
-
/**
|
|
96
|
-
* Returns new set as an intersection of all sets
|
|
97
|
-
* Keeps order from the first set
|
|
98
|
-
*/
|
|
99
|
-
declare function intersection<T>(first: ReadonlySet<T>, ...sets: NonEmptyArray<ReadonlySet<NoInfer<T>>>): Set<T>;
|
|
100
|
-
/**
|
|
101
|
-
* Returns new set as a difference of two sets (A-B)
|
|
102
|
-
* Keeps order from the first set
|
|
103
|
-
*/
|
|
104
|
-
declare function difference<T>(a: ReadonlySet<T>, b: ReadonlySet<NoInfer<T>>): Set<T>;
|
|
105
|
-
declare function equals<T>(a: ReadonlySet<T>, b: ReadonlySet<T>): boolean;
|
|
106
|
-
declare function symmetricDifference<T>(a: ReadonlySet<T>, b: ReadonlySet<T>): Set<T>;
|
|
107
|
-
|
|
108
|
-
declare function objectHash(value: any): string;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* @see https://gist.github.com/victor-homyakov/bcb7d7911e4a388b1c810f8c3ce17bcf
|
|
112
|
-
*/
|
|
113
|
-
declare function stringHash(str: string): string;
|
|
114
|
-
|
|
115
|
-
declare function markdownToHtml(markdown: string): string;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Converts markdown to plain text, removing any markdown formatting.
|
|
119
|
-
* @param markdown - The markdown to convert.
|
|
120
|
-
* @returns The plain text.
|
|
121
|
-
*/
|
|
122
|
-
declare function markdownToText(markdown: string): string;
|
|
123
|
-
|
|
124
|
-
export { Stack, commonHead, compareNatural, compareNaturalHierarchically, compareRelations, delay, difference, equals as equalsSet, getOrCreate, intersection, markdownToHtml, markdownToText, objectHash, onNextTick, promiseNextTick, stringHash, symmetricDifference, union };
|
|
1
|
+
import "../_chunks/_aux.mjs";
|
|
2
|
+
import "../_chunks/scalar.mjs";
|
|
3
|
+
import "../_chunks/expression.mjs";
|
|
4
|
+
import "../_chunks/fqnRef.mjs";
|
|
5
|
+
import "../_chunks/expression-model.mjs";
|
|
6
|
+
import "../_chunks/index2.mjs";
|
|
7
|
+
import "../_chunks/RichText.mjs";
|
|
8
|
+
import { a as Queue, c as DefaultMap, i as MultiMap, n as BiMap, o as LinkedList, r as Stack, s as DefaultWeakMap } from "../_chunks/libs/mnemonist.mjs";
|
|
9
|
+
import { A as parentFqn, C as compareFqnHierarchically, D as isDescendantOf, E as isAncestor, F as compareNaturalHierarchically, I as commonHead, L as invariant, M as sortNaturalByFqn, N as sortParentsFirst, O as isSameHierarchy, P as compareNatural, R as nonNullable, S as compareByFqnHierarchically, T as hierarchyLevel, _ as isNonEmptyArray, a as difference, b as ancestorsFqn, c as symmetricDifference, d as delay, f as onNextTick, g as isAnyOf, h as hasProp, i as objectHash, j as sortByFqnHierarchically, k as nameFromFqn, l as union, m as memoizeProp, n as markdownToHtml, o as equals, p as promiseNextTick, r as stringHash, s as intersection, t as markdownToText, u as compareRelations, v as isString, w as hierarchyDistance, x as commonAncestor, y as getOrCreate, z as nonexhaustive } from "../_chunks/index7.mjs";
|
|
10
|
+
import { a as ireduce, c as iflatMap, d as ifind, f as ifilter, i as isome, l as iflat, n as toArray, o as imap, p as isIterable, r as toSet, s as ihead, t as iunique, u as ifirst } from "../_chunks/index8.mjs";
|
|
11
|
+
export { BiMap, DefaultMap, DefaultWeakMap, LinkedList, MultiMap, Queue, Stack, ancestorsFqn, commonAncestor, commonHead, compareByFqnHierarchically, compareFqnHierarchically, compareNatural, compareNaturalHierarchically, compareRelations, delay, difference, equals as equalsSet, getOrCreate, hasProp, hierarchyDistance, hierarchyLevel, ifilter, ifind, ifirst, iflat, iflatMap, ihead, imap, intersection, invariant, ireduce, isAncestor, isAnyOf, isDescendantOf, isIterable, isNonEmptyArray, isSameHierarchy, isString, isome, iunique, markdownToHtml, markdownToText, memoizeProp, nameFromFqn, nonNullable, nonexhaustive, objectHash, onNextTick, parentFqn, promiseNextTick, sortByFqnHierarchically, sortNaturalByFqn, sortParentsFirst, stringHash, symmetricDifference, toArray, toSet, union };
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1,44 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export { b as BiMap, d as DefaultWeakMap, l as LinkedList, m as MultiMap, q as Queue } from '../shared/core.BNN-3vPH.mjs';
|
|
10
|
-
export { D as DefaultMap } from '../shared/core.BbE4y-yl.mjs';
|
|
11
|
-
export { i as ifilter } from '../shared/core.DRJma0Ol.mjs';
|
|
12
|
-
export { i as ifind } from '../shared/core.CmPXpJ8l.mjs';
|
|
13
|
-
export { ifirst, iflatMap, ireduce } from './iterable/index.mjs';
|
|
14
|
-
export { i as iflat, a as iunique } from '../shared/core.C4x8aaWa.mjs';
|
|
15
|
-
export { i as ihead } from '../shared/core.uFk_o9X6.mjs';
|
|
16
|
-
export { i as imap, a as toArray, t as toSet } from '../shared/core.C3JowhaZ.mjs';
|
|
17
|
-
export { i as isIterable } from '../shared/core.RfnaEmgA.mjs';
|
|
18
|
-
export { i as isome } from '../shared/core.FZ305VYd.mjs';
|
|
19
|
-
export { m as markdownToHtml, a as markdownToText } from '../shared/core.Bdy3hhTc.mjs';
|
|
1
|
+
import "../_chunks/libs/natural-compare-lite.mjs";
|
|
2
|
+
import { A as sortParentsFirst, C as isAncestor, D as parentFqn, E as nameFromFqn, F as commonHead, I as compareNatural, L as compareNaturalHierarchically, M as isAnyOf, N as isNonEmptyArray, O as sortByFqnHierarchically, P as isString, S as hierarchyLevel, T as isSameHierarchy, _ as ancestorsFqn, a as difference, b as compareFqnHierarchically, c as intersection, d as compareRelations, f as delay, g as getOrCreate, h as memoizeProp, i as objectHash, j as hasProp, k as sortNaturalByFqn, l as symmetricDifference, m as promiseNextTick, n as markdownToHtml, o as equals, p as onNextTick, r as stringHash, t as markdownToText, u as union, v as commonAncestor, w as isDescendantOf, x as hierarchyDistance, y as compareByFqnHierarchically } from "../_chunks/utils.mjs";
|
|
3
|
+
import { n as nonNullable, r as nonexhaustive, t as invariant } from "../_chunks/invariant.mjs";
|
|
4
|
+
import "../_chunks/libs/graphology-dag.mjs";
|
|
5
|
+
import { i as import_linked_list, l as import_stack, n as import_default_map, o as import_multi_map, r as import_default_weak_map, s as import_queue, t as import_bi_map } from "../_chunks/libs/mnemonist.mjs";
|
|
6
|
+
import { a as ireduce, c as iflatMap, d as ifind, f as ifilter, i as isome, l as iflat, n as toArray, o as imap, p as isIterable, r as toSet, s as ihead, t as iunique, u as ifirst } from "../_chunks/iterable.mjs";
|
|
7
|
+
import "../_chunks/libs/defu.mjs";
|
|
8
|
+
import "../_chunks/libs/extend.mjs";
|
|
20
9
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
ms = args[0];
|
|
30
|
-
}
|
|
31
|
-
return new Promise((resolve) => {
|
|
32
|
-
setTimeout(() => {
|
|
33
|
-
resolve(DELAY);
|
|
34
|
-
}, ms ?? 100);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
function promiseNextTick() {
|
|
38
|
-
return Promise.resolve().then(() => void 0);
|
|
39
|
-
}
|
|
40
|
-
function onNextTick(fn) {
|
|
41
|
-
void Promise.resolve().then(fn);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { delay, onNextTick, promiseNextTick };
|
|
10
|
+
var BiMap = import_bi_map.default;
|
|
11
|
+
var DefaultMap = import_default_map.default;
|
|
12
|
+
var DefaultWeakMap = import_default_weak_map.default;
|
|
13
|
+
var LinkedList = import_linked_list.default;
|
|
14
|
+
var MultiMap = import_multi_map.default;
|
|
15
|
+
var Queue = import_queue.default;
|
|
16
|
+
var Stack = import_stack.default;
|
|
17
|
+
export { BiMap, DefaultMap, DefaultWeakMap, LinkedList, MultiMap, Queue, Stack, ancestorsFqn, commonAncestor, commonHead, compareByFqnHierarchically, compareFqnHierarchically, compareNatural, compareNaturalHierarchically, compareRelations, delay, difference, equals as equalsSet, getOrCreate, hasProp, hierarchyDistance, hierarchyLevel, ifilter, ifind, ifirst, iflat, iflatMap, ihead, imap, intersection, invariant, ireduce, isAncestor, isAnyOf, isDescendantOf, isIterable, isNonEmptyArray, isSameHierarchy, isString, isome, iunique, markdownToHtml, markdownToText, memoizeProp, nameFromFqn, nonNullable, nonexhaustive, objectHash, onNextTick, parentFqn, promiseNextTick, sortByFqnHierarchically, sortNaturalByFqn, sortParentsFirst, stringHash, symmetricDifference, toArray, toSet, union };
|
|
@@ -1,132 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
declare function ifilter<T, S extends T>(predicate: (v: T) => v is S): (iterable: Iterable<T>) => IteratorLike<S>;
|
|
12
|
-
declare function ifilter<T>(predicate: (v: T) => boolean): (iterable: Iterable<T>) => IteratorLike<T>;
|
|
13
|
-
/**
|
|
14
|
-
* Filters an iterable based on a predicate.
|
|
15
|
-
* Data first version of `ifilter`.
|
|
16
|
-
* @signature
|
|
17
|
-
* ifilter(data, predicate)
|
|
18
|
-
* @example
|
|
19
|
-
* ifilter(new Set([1, 2, 3]), x => x % 2 === 1) // => Iterable<[1, 3]>
|
|
20
|
-
*/
|
|
21
|
-
declare function ifilter<T, S extends T>(iterable: Iterable<T>, predicate: (v: T) => v is S): IteratorLike<S>;
|
|
22
|
-
declare function ifilter<T>(iterable: Iterable<T>, predicate: (v: T) => boolean): IteratorLike<T>;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Finds the first element in the iterable that satisfies the predicate.
|
|
26
|
-
* Composable first version of `find`.
|
|
27
|
-
* @signature
|
|
28
|
-
* ifind(predicate)(data)
|
|
29
|
-
*/
|
|
30
|
-
declare function ifind<T, S extends T>(predicate: (item: T) => item is S): (iterable: Iterable<T>) => S | undefined;
|
|
31
|
-
declare function ifind<T>(predicate: (item: T) => boolean): (iterable: Iterable<T>) => T | undefined;
|
|
32
|
-
/**
|
|
33
|
-
* Finds the first element in the iterable that satisfies the predicate.
|
|
34
|
-
* Data first version of `find`.
|
|
35
|
-
* @signature
|
|
36
|
-
* ifind(data, predicate)
|
|
37
|
-
*/
|
|
38
|
-
declare function ifind<T, S extends T>(iterable: Iterable<T>, predicate: (item: T) => item is S): S | undefined;
|
|
39
|
-
declare function ifind<T>(iterable: Iterable<T>, predicate: (item: T) => boolean): T | undefined;
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Takes the first N elements from an iterable.
|
|
43
|
-
* Composable first version of `ifirst`.
|
|
44
|
-
* @signature
|
|
45
|
-
* ifirst(count)(data)
|
|
46
|
-
*/
|
|
47
|
-
declare function ifirst<T>(count: number): (iterable: Iterable<T>) => IteratorLike<T>;
|
|
48
|
-
/**
|
|
49
|
-
* Takes the first N elements from an iterable.
|
|
50
|
-
* Data first version of `ifirst`.
|
|
51
|
-
* @signature
|
|
52
|
-
* ifirst(data, count)
|
|
53
|
-
* @example
|
|
54
|
-
* ifirst([1, 2, 3, 4, 5], 3) // => Iterable<[1, 2, 3]>
|
|
55
|
-
*/
|
|
56
|
-
declare function ifirst<T>(iterable: Iterable<T>, count: number): IteratorLike<T>;
|
|
57
|
-
|
|
58
|
-
declare function iflat(): <T>(iterable: Iterable<IteratorLike<T>>) => IteratorLike<T>;
|
|
59
|
-
declare function iflat<T>(iterable: Iterable<IteratorLike<T>>): IteratorLike<T>;
|
|
60
|
-
|
|
61
|
-
type FlatMapFunction<T, S> = (item: T) => Iterable<S>;
|
|
62
|
-
/**
|
|
63
|
-
* Maps an iterable using a mapper function and flattens the result by one level.
|
|
64
|
-
* Composable first version of `iflatMap`.
|
|
65
|
-
* @signature
|
|
66
|
-
* iflatMap(mapper)(data)
|
|
67
|
-
*/
|
|
68
|
-
declare function iflatMap<T, S>(mapper: FlatMapFunction<T, S>): (iterable: Iterable<T>) => IteratorLike<S>;
|
|
69
|
-
/**
|
|
70
|
-
* Maps an iterable using a mapper function and flattens the result by one level.
|
|
71
|
-
* Data first version of `iflatMap`.
|
|
72
|
-
* @signature
|
|
73
|
-
* iflatMap(data, mapper)
|
|
74
|
-
*/
|
|
75
|
-
declare function iflatMap<T, S>(iterable: Iterable<T>, mapper: FlatMapFunction<T, S>): IteratorLike<S>;
|
|
76
|
-
|
|
77
|
-
declare function ihead<T>(): (iterable: Iterable<T>) => T | undefined;
|
|
78
|
-
/**
|
|
79
|
-
* Finds the first element in the iterable that satisfies the predicate.
|
|
80
|
-
* Data first version of `find`.
|
|
81
|
-
* @signature
|
|
82
|
-
* ifind(data, predicate)
|
|
83
|
-
*/
|
|
84
|
-
declare function ihead<T>(iterable: Iterable<T>): T | undefined;
|
|
85
|
-
|
|
86
|
-
type MapFunction<T, S> = (item: T) => S;
|
|
87
|
-
/**
|
|
88
|
-
* Maps an iterable using a mapper function.
|
|
89
|
-
* Composable first version of `imap`.
|
|
90
|
-
* @signature
|
|
91
|
-
* imap(mapper)(data)
|
|
92
|
-
*/
|
|
93
|
-
declare function imap<T, S>(mapper: MapFunction<T, S>): (iterable: Iterable<T>) => IteratorLike<S>;
|
|
94
|
-
/**
|
|
95
|
-
* Maps an iterable using a mapper function.
|
|
96
|
-
* Data first version of `imap`.
|
|
97
|
-
* @signature
|
|
98
|
-
* imap(data, mapper)
|
|
99
|
-
*/
|
|
100
|
-
declare function imap<T, S>(iterable: Iterable<T>, mapper: MapFunction<T, S>): IteratorLike<S>;
|
|
101
|
-
|
|
102
|
-
declare function ireduce<T, R>(reducer: (acc: R, item: T) => R, initialValue: R): (iterable: Iterable<T>) => R;
|
|
103
|
-
declare function ireduce<T, R>(iterable: Iterable<T>, reducer: (acc: R, item: T) => R, initialValue: R): R;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Checks if at least one element in the iterable satisfies the predicate.
|
|
107
|
-
* Composable first version of `some`.
|
|
108
|
-
* @signature
|
|
109
|
-
* isome(predicate)(data)
|
|
110
|
-
*/
|
|
111
|
-
declare function isome<T>(predicate: (item: T) => boolean): (iterable: Iterable<T>) => boolean;
|
|
112
|
-
/**
|
|
113
|
-
* Checks if at least one element in the iterable satisfies the predicate.
|
|
114
|
-
* Data first version of `some`.
|
|
115
|
-
* @signature
|
|
116
|
-
* isome(data, predicate)
|
|
117
|
-
*/
|
|
118
|
-
declare function isome<T>(iterable: Iterable<T>, predicate: (item: T) => boolean): boolean;
|
|
119
|
-
|
|
120
|
-
declare function toArray(): <T>(iterable: Iterable<T> | ArrayLike<T>) => T[];
|
|
121
|
-
declare function toArray<T>(iterable: Iterable<T> | ArrayLike<T>): T[];
|
|
122
|
-
declare function toSet(): <T>(iterable: Iterable<T>) => Set<T>;
|
|
123
|
-
declare function toSet<T>(iterable: Iterable<T>): Set<T>;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Returns an iterable that yields only unique values.
|
|
127
|
-
* It uses a Set to keep track of the values.
|
|
128
|
-
*/
|
|
129
|
-
declare function iunique(): <T>(iterable: Iterable<T>) => IteratorLike<T>;
|
|
130
|
-
declare function iunique<T>(iterable: Iterable<T>): IteratorLike<T>;
|
|
131
|
-
|
|
132
|
-
export { ifilter, ifind, ifirst, iflat, iflatMap, ihead, imap, ireduce, isome, iunique, toArray, toSet };
|
|
1
|
+
import "../../_chunks/_aux.mjs";
|
|
2
|
+
import "../../_chunks/scalar.mjs";
|
|
3
|
+
import "../../_chunks/expression.mjs";
|
|
4
|
+
import "../../_chunks/fqnRef.mjs";
|
|
5
|
+
import "../../_chunks/expression-model.mjs";
|
|
6
|
+
import "../../_chunks/index2.mjs";
|
|
7
|
+
import "../../_chunks/RichText.mjs";
|
|
8
|
+
import { a as ireduce, c as iflatMap, d as ifind, f as ifilter, i as isome, l as iflat, n as toArray, o as imap, p as isIterable, r as toSet, s as ihead, t as iunique, u as ifirst } from "../../_chunks/index8.mjs";
|
|
9
|
+
export { ifilter, ifind, ifirst, iflat, iflatMap, ihead, imap, ireduce, isIterable, isome, iunique, toArray, toSet };
|
|
@@ -1,62 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import { e } from '../../shared/core.DRJma0Ol.mjs';
|
|
3
|
-
export { i as ifilter } from '../../shared/core.DRJma0Ol.mjs';
|
|
4
|
-
export { i as ifind } from '../../shared/core.CmPXpJ8l.mjs';
|
|
5
|
-
import { i as invariant } from '../../shared/core.D4npX2q8.mjs';
|
|
6
|
-
import { e as e$1 } from '../../shared/core.C4x8aaWa.mjs';
|
|
7
|
-
export { i as iflat, a as iunique } from '../../shared/core.C4x8aaWa.mjs';
|
|
8
|
-
export { i as ihead } from '../../shared/core.uFk_o9X6.mjs';
|
|
9
|
-
export { i as imap, a as toArray, t as toSet } from '../../shared/core.C3JowhaZ.mjs';
|
|
10
|
-
export { i as isome } from '../../shared/core.FZ305VYd.mjs';
|
|
1
|
+
import { a as ireduce, c as iflatMap, d as ifind, f as ifilter, i as isome, l as iflat, n as toArray, o as imap, p as isIterable, r as toSet, s as ihead, t as iunique, u as ifirst } from "../../_chunks/iterable.mjs";
|
|
11
2
|
|
|
12
|
-
|
|
13
|
-
const count = arg2 ?? arg1;
|
|
14
|
-
invariant(typeof count === "number" && count >= 0, "Count must be a non-negative number");
|
|
15
|
-
function* _first(iter) {
|
|
16
|
-
let taken = 0;
|
|
17
|
-
for (const value of iter) {
|
|
18
|
-
if (taken >= count) {
|
|
19
|
-
break;
|
|
20
|
-
}
|
|
21
|
-
yield value;
|
|
22
|
-
taken++;
|
|
23
|
-
}
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
if (arg2 === void 0) {
|
|
27
|
-
return (iterable) => _first(iterable);
|
|
28
|
-
}
|
|
29
|
-
return _first(arg1);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function iflatMap(arg1, arg2) {
|
|
33
|
-
const mapper = arg2 ?? arg1;
|
|
34
|
-
invariant(e(mapper));
|
|
35
|
-
function* _flatMap(iter) {
|
|
36
|
-
for (const value of iter) {
|
|
37
|
-
const mapped = mapper(value);
|
|
38
|
-
yield* mapped;
|
|
39
|
-
}
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (!arg2) {
|
|
43
|
-
return _flatMap;
|
|
44
|
-
}
|
|
45
|
-
return _flatMap(arg1);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function ireduce(arg1, arg2, arg3) {
|
|
49
|
-
const reducer = e$1(arg3) ? arg2 : arg1;
|
|
50
|
-
const initialValue = arg3 ?? arg2;
|
|
51
|
-
invariant(e(reducer));
|
|
52
|
-
function _reduce(iter) {
|
|
53
|
-
let acc = initialValue;
|
|
54
|
-
for (const value of iter) {
|
|
55
|
-
acc = reducer(acc, value);
|
|
56
|
-
}
|
|
57
|
-
return acc;
|
|
58
|
-
}
|
|
59
|
-
return e$1(arg3) ? _reduce(arg1) : _reduce;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export { ifirst, iflatMap, ireduce };
|
|
3
|
+
export { ifilter, ifind, ifirst, iflat, iflatMap, ihead, imap, ireduce, isIterable, isome, iunique, toArray, toSet };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "../_chunks/libs/graphology-dag.mjs";
|
|
2
|
+
import { a as import_lru_map, i as import_linked_list, l as import_stack, n as import_default_map, o as import_multi_map, r as import_default_weak_map, s as import_queue, t as import_bi_map } from "../_chunks/libs/mnemonist.mjs";
|
|
3
|
+
|
|
4
|
+
var BiMap = import_bi_map.default;
|
|
5
|
+
var DefaultMap = import_default_map.default;
|
|
6
|
+
var DefaultWeakMap = import_default_weak_map.default;
|
|
7
|
+
var LRUMap = import_lru_map.default;
|
|
8
|
+
var LinkedList = import_linked_list.default;
|
|
9
|
+
var MultiMap = import_multi_map.default;
|
|
10
|
+
var Queue = import_queue.default;
|
|
11
|
+
var Stack = import_stack.default;
|
|
12
|
+
export { BiMap, DefaultMap, DefaultWeakMap, LRUMap, LinkedList, MultiMap, Queue, Stack };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@likec4/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.48.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://likec4.dev",
|
|
6
6
|
"author": "Denis Davydkov <denis@davydkov.com>",
|
|
@@ -47,14 +47,6 @@
|
|
|
47
47
|
"default": "./dist/geometry/index.mjs"
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
-
"./compute-view/relationships": {
|
|
51
|
-
"sources": "./src/compute-view/relationships-view/index.ts",
|
|
52
|
-
"default": {
|
|
53
|
-
"types": "./dist/compute-view/relationships-view/index.d.mts",
|
|
54
|
-
"import": "./dist/compute-view/relationships-view/index.mjs",
|
|
55
|
-
"default": "./dist/compute-view/relationships-view/index.mjs"
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
50
|
"./compute-view": {
|
|
59
51
|
"sources": "./src/compute-view/index.ts",
|
|
60
52
|
"default": {
|
|
@@ -110,18 +102,21 @@
|
|
|
110
102
|
"access": "public"
|
|
111
103
|
},
|
|
112
104
|
"dependencies": {
|
|
113
|
-
"
|
|
105
|
+
"immer": "^11.1.3",
|
|
106
|
+
"ohash": "^2.0.11",
|
|
107
|
+
"type-fest": "^4.41.0",
|
|
108
|
+
"zod": "^3.25.76"
|
|
114
109
|
},
|
|
115
110
|
"devDependencies": {
|
|
116
111
|
"@dagrejs/dagre": "1.1.8",
|
|
117
|
-
"@mantine/colors-generator": "8.3.
|
|
112
|
+
"@mantine/colors-generator": "8.3.13",
|
|
113
|
+
"@rolldown/plugin-node-polyfills": "^1.0.0",
|
|
118
114
|
"@types/chroma-js": "^3.1.2",
|
|
119
115
|
"@types/extend": "3.0.4",
|
|
120
116
|
"@types/hast": "3.0.4",
|
|
121
117
|
"@types/mdast": "4.0.4",
|
|
122
118
|
"@types/natural-compare-lite": "^1.4.2",
|
|
123
|
-
"@types/node": "~22.19.
|
|
124
|
-
"@types/object-hash": "^3.0.6",
|
|
119
|
+
"@types/node": "~22.19.7",
|
|
125
120
|
"@types/unist": "3.0.3",
|
|
126
121
|
"chroma-js": "^3.2.0",
|
|
127
122
|
"defu": "^6.1.4",
|
|
@@ -129,14 +124,13 @@
|
|
|
129
124
|
"graphology": "^0.26.0",
|
|
130
125
|
"graphology-dag": "^0.4.1",
|
|
131
126
|
"graphology-types": "^0.24.8",
|
|
132
|
-
"immer": "^11.1.0",
|
|
133
127
|
"mdast-util-from-markdown": "^2.0.2",
|
|
134
|
-
"mdast-util-to-string": "^4.0.0",
|
|
135
128
|
"mdast-util-to-hast": "^13.2.1",
|
|
129
|
+
"mdast-util-to-string": "^4.0.0",
|
|
136
130
|
"mnemonist": "0.40.3",
|
|
137
131
|
"natural-compare-lite": "^1.4.0",
|
|
138
|
-
"object-hash": "^3.0.0",
|
|
139
132
|
"obliterator": "^2.0.5",
|
|
133
|
+
"obuild": "^0.4.20",
|
|
140
134
|
"oxlint": "1.35.0",
|
|
141
135
|
"rehype-format": "5.0.1",
|
|
142
136
|
"rehype-sanitize": "^6.0.0",
|
|
@@ -146,18 +140,19 @@
|
|
|
146
140
|
"remark-parse": "11.0.0",
|
|
147
141
|
"remark-rehype": "11.1.2",
|
|
148
142
|
"remeda": "^2.32.0",
|
|
149
|
-
"turbo": "2.7.
|
|
143
|
+
"turbo": "2.7.6",
|
|
150
144
|
"typescript": "5.9.3",
|
|
151
|
-
"unbuild": "3.5.0",
|
|
152
145
|
"unified": "11.0.5",
|
|
153
|
-
"vitest": "4.0.
|
|
146
|
+
"vitest": "4.0.18",
|
|
147
|
+
"@likec4/style-preset": "1.48.0",
|
|
154
148
|
"@likec4/devops": "1.42.0",
|
|
155
|
-
"@likec4/
|
|
149
|
+
"@likec4/styles": "1.48.0",
|
|
150
|
+
"@likec4/tsconfig": "1.48.0"
|
|
156
151
|
},
|
|
157
152
|
"scripts": {
|
|
158
153
|
"typecheck": "tsc -b --verbose",
|
|
159
|
-
"build": "
|
|
160
|
-
"lint": "
|
|
154
|
+
"build": "obuild",
|
|
155
|
+
"lint": "oxlint --type-aware",
|
|
161
156
|
"lint:package": "pnpx publint ./package.tgz",
|
|
162
157
|
"test": "vitest run --no-isolate",
|
|
163
158
|
"test:watch": "vitest",
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs } from './core.B85MJLTf.mjs';
|
|
2
|
-
import { e as e$1 } from './core.CqAJJpK_.mjs';
|
|
3
|
-
|
|
4
|
-
const e={done:true,hasNext:false},t$1={done:false,hasNext:false},n$1=()=>e;
|
|
5
|
-
|
|
6
|
-
function t(e,...t){let a=e,o=t.map(e=>`lazy`in e?r(e):void 0),s=0;for(;s<t.length;){if(o[s]===void 0||!i(a)){let e=t[s];a=e(a),s+=1;continue}let e=[];for(let n=s;n<t.length;n++){let t=o[n];if(t===void 0||(e.push(t),t.isSingle))break}let r=[];for(let t of a)if(n(t,r,e))break;let{isSingle:c}=e.at(-1);a=c?r[0]:r,s+=e.length;}return a}function n(t,r,i){if(i.length===0)return r.push(t),false;let a=t,o=t$1,s=false;for(let[e,t]of i.entries()){let{index:c,items:l}=t;if(l.push(a),o=t(a,c,l),t.index+=1,o.hasNext){if(o.hasMany??false){for(let t of o.next)if(n(t,r,i.slice(e+1)))return true;return s}a=o.next;}if(!o.hasNext)break;o.done&&(s=true);}return o.hasNext&&r.push(a),s}function r(e){let{lazy:t,lazyArgs:n}=e,r=t(...n);return Object.assign(r,{isSingle:t.single??false,index:0,items:[]})}function i(e){return typeof e==`string`||typeof e==`object`&&!!e&&Symbol.iterator in e}
|
|
7
|
-
|
|
8
|
-
var naturalCompareLite = {exports: {}};
|
|
9
|
-
|
|
10
|
-
var hasRequiredNaturalCompareLite;
|
|
11
|
-
|
|
12
|
-
function requireNaturalCompareLite () {
|
|
13
|
-
if (hasRequiredNaturalCompareLite) return naturalCompareLite.exports;
|
|
14
|
-
hasRequiredNaturalCompareLite = 1;
|
|
15
|
-
/*
|
|
16
|
-
* @version 1.4.0
|
|
17
|
-
* @date 2015-10-26
|
|
18
|
-
* @stability 3 - Stable
|
|
19
|
-
* @author Lauri Rooden (https://github.com/litejs/natural-compare-lite)
|
|
20
|
-
* @license MIT License
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var naturalCompare = function(a, b) {
|
|
25
|
-
var i, codeA
|
|
26
|
-
, codeB = 1
|
|
27
|
-
, posA = 0
|
|
28
|
-
, posB = 0
|
|
29
|
-
, alphabet = String.alphabet;
|
|
30
|
-
|
|
31
|
-
function getCode(str, pos, code) {
|
|
32
|
-
if (code) {
|
|
33
|
-
for (i = pos; code = getCode(str, i), code < 76 && code > 65;) ++i;
|
|
34
|
-
return +str.slice(pos - 1, i)
|
|
35
|
-
}
|
|
36
|
-
code = alphabet && alphabet.indexOf(str.charAt(pos));
|
|
37
|
-
return code > -1 ? code + 76 : ((code = str.charCodeAt(pos) || 0), code < 45 || code > 127) ? code
|
|
38
|
-
: code < 46 ? 65 // -
|
|
39
|
-
: code < 48 ? code - 1
|
|
40
|
-
: code < 58 ? code + 18 // 0-9
|
|
41
|
-
: code < 65 ? code - 11
|
|
42
|
-
: code < 91 ? code + 11 // A-Z
|
|
43
|
-
: code < 97 ? code - 37
|
|
44
|
-
: code < 123 ? code + 5 // a-z
|
|
45
|
-
: code - 63
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if ((a+="") != (b+="")) for (;codeB;) {
|
|
50
|
-
codeA = getCode(a, posA++);
|
|
51
|
-
codeB = getCode(b, posB++);
|
|
52
|
-
|
|
53
|
-
if (codeA < 76 && codeB < 76 && codeA > 66 && codeB > 66) {
|
|
54
|
-
codeA = getCode(a, posA, posA);
|
|
55
|
-
codeB = getCode(b, posB, posA = i);
|
|
56
|
-
posB = i;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (codeA != codeB) return (codeA < codeB) ? -1 : 1
|
|
60
|
-
}
|
|
61
|
-
return 0
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
try {
|
|
65
|
-
naturalCompareLite.exports = naturalCompare;
|
|
66
|
-
} catch (e) {
|
|
67
|
-
String.naturalCompare = naturalCompare;
|
|
68
|
-
}
|
|
69
|
-
return naturalCompareLite.exports;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
var naturalCompareLiteExports = requireNaturalCompareLite();
|
|
73
|
-
const compare = /*@__PURE__*/getDefaultExportFromCjs(naturalCompareLiteExports);
|
|
74
|
-
|
|
75
|
-
function compareNatural(a, b) {
|
|
76
|
-
if (a === b) return 0;
|
|
77
|
-
if (e$1(a)) {
|
|
78
|
-
if (e$1(b)) {
|
|
79
|
-
return compare(a, b);
|
|
80
|
-
}
|
|
81
|
-
return 1;
|
|
82
|
-
}
|
|
83
|
-
return e$1(b) ? -1 : 0;
|
|
84
|
-
}
|
|
85
|
-
function compareNaturalHierarchically(separator = ".", deepestFirst = false) {
|
|
86
|
-
return (a, b) => {
|
|
87
|
-
if (a === b) return 0;
|
|
88
|
-
if (!a) return -1;
|
|
89
|
-
if (!b) return 1;
|
|
90
|
-
const aParts = a.split(separator);
|
|
91
|
-
const bParts = b.split(separator);
|
|
92
|
-
const minLength = Math.min(aParts.length, bParts.length);
|
|
93
|
-
for (let i = 0; i < minLength; i++) {
|
|
94
|
-
const aPart = aParts[i];
|
|
95
|
-
const bPart = bParts[i];
|
|
96
|
-
const comparison = compare(aPart, bPart);
|
|
97
|
-
if (comparison !== 0) {
|
|
98
|
-
return comparison;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
const diff = aParts.length - bParts.length;
|
|
102
|
-
return deepestFirst ? -1 * diff : diff;
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export { t$1 as a, compareNaturalHierarchically as b, compareNatural as c, n$1 as n, t };
|