@ts-graphviz/common 2.1.4 → 2.1.5-next-d7ff421ec861ca8fdede1a6bdf256f3455fb9797
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/lib/common.cjs +0 -34
- package/lib/common.d.ts +0 -18
- package/lib/common.js +0 -34
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @ts-graphviz/common
|
|
2
2
|
|
|
3
|
+
## 2.1.5-next-d7ff421ec861ca8fdede1a6bdf256f3455fb9797
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1218](https://github.com/ts-graphviz/ts-graphviz/pull/1218) [`d7ff421`](https://github.com/ts-graphviz/ts-graphviz/commit/d7ff421ec861ca8fdede1a6bdf256f3455fb9797) Thanks [@kamiazya](https://github.com/kamiazya)! - Remove unnecessary internal utility functions
|
|
8
|
+
|
|
3
9
|
## 2.1.4
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/lib/common.cjs
CHANGED
|
@@ -1,36 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
function _pipe(...args) {
|
|
4
|
-
const [o1, ...operations] = args;
|
|
5
|
-
return (...t) => operations.reduce((acc, f) => f(acc), o1(...t));
|
|
6
|
-
}
|
|
7
|
-
function pipe(o1, ...operations) {
|
|
8
|
-
return _pipe(o1, ...operations);
|
|
9
|
-
}
|
|
10
|
-
const defer = (fn) => (...args) => (src) => fn(src, ...args);
|
|
11
|
-
const toIterable = (f) => ({
|
|
12
|
-
[Symbol.iterator]: f
|
|
13
|
-
});
|
|
14
|
-
const map = defer(
|
|
15
|
-
(src, selector) => Array.from(
|
|
16
|
-
toIterable(function* () {
|
|
17
|
-
for (const v of src) {
|
|
18
|
-
yield selector(v);
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
)
|
|
22
|
-
);
|
|
23
|
-
const filter = defer(
|
|
24
|
-
(src, pred) => Array.from(
|
|
25
|
-
toIterable(function* () {
|
|
26
|
-
for (const x of src) {
|
|
27
|
-
if (pred(x)) {
|
|
28
|
-
yield x;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
})
|
|
32
|
-
)
|
|
33
|
-
);
|
|
34
3
|
const RootModelsContext = Object.seal({
|
|
35
4
|
// NOTE: RootModelsContext is also initialized after the model class is declared in the '@ts-graphviz/core/register-default' module.
|
|
36
5
|
Graph: null,
|
|
@@ -86,14 +55,11 @@ function toNodeRefGroup(targets) {
|
|
|
86
55
|
}
|
|
87
56
|
exports.RootModelsContext = RootModelsContext;
|
|
88
57
|
exports.createModelsContext = createModelsContext;
|
|
89
|
-
exports.filter = filter;
|
|
90
58
|
exports.isCompass = isCompass;
|
|
91
59
|
exports.isForwardRefNode = isForwardRefNode;
|
|
92
60
|
exports.isNodeModel = isNodeModel;
|
|
93
61
|
exports.isNodeRef = isNodeRef;
|
|
94
62
|
exports.isNodeRefGroupLike = isNodeRefGroupLike;
|
|
95
63
|
exports.isNodeRefLike = isNodeRefLike;
|
|
96
|
-
exports.map = map;
|
|
97
|
-
exports.pipe = pipe;
|
|
98
64
|
exports.toNodeRef = toNodeRef;
|
|
99
65
|
exports.toNodeRefGroup = toNodeRefGroup;
|
package/lib/common.d.ts
CHANGED
|
@@ -3054,10 +3054,6 @@ to: EdgeTarget,
|
|
|
3054
3054
|
*/
|
|
3055
3055
|
export declare type EscString = string;
|
|
3056
3056
|
|
|
3057
|
-
export declare type F<A extends any[], O> = (...args: A) => O;
|
|
3058
|
-
|
|
3059
|
-
export declare const filter: <T>(pred: (item: T) => boolean) => (src: Iterable<T>) => T[];
|
|
3060
|
-
|
|
3061
3057
|
/**
|
|
3062
3058
|
* @group Models
|
|
3063
3059
|
*/
|
|
@@ -3550,8 +3546,6 @@ export declare namespace Insensitive {
|
|
|
3550
3546
|
*/
|
|
3551
3547
|
export declare type Int = number;
|
|
3552
3548
|
|
|
3553
|
-
export declare type IO<I, O> = F<[I], O>;
|
|
3554
|
-
|
|
3555
3549
|
/** @hidden */
|
|
3556
3550
|
export declare function isCompass(c: string): c is Compass;
|
|
3557
3551
|
|
|
@@ -3595,8 +3589,6 @@ export declare type LayerRange = string;
|
|
|
3595
3589
|
*/
|
|
3596
3590
|
export declare type LblString = HTMLLikeLabel | EscString;
|
|
3597
3591
|
|
|
3598
|
-
export declare const map: <T, O>(selector: (item: T) => O) => (src: Iterable<T>) => O[];
|
|
3599
|
-
|
|
3600
3592
|
/**
|
|
3601
3593
|
* @group Models Context
|
|
3602
3594
|
*/
|
|
@@ -3720,16 +3712,6 @@ export declare namespace PickMode {
|
|
|
3720
3712
|
}
|
|
3721
3713
|
}
|
|
3722
3714
|
|
|
3723
|
-
export declare function pipe<I extends any[], O>(f0: F<I, O>): F<I, O>;
|
|
3724
|
-
|
|
3725
|
-
export declare function pipe<I extends any[], T1, O>(f0: F<I, T1>, f1: IO<T1, O>): F<I, O>;
|
|
3726
|
-
|
|
3727
|
-
export declare function pipe<I extends any[], T1, T2, O>(f0: F<I, T1>, f1: IO<T1, T2>, f2: IO<T2, O>): F<I, O>;
|
|
3728
|
-
|
|
3729
|
-
export declare function pipe<I extends any[], T1, T2, T3, O>(f0: F<I, T1>, f1: IO<T1, T2>, f2: IO<T2, T3>, f3: IO<T3, O>): F<I, O>;
|
|
3730
|
-
|
|
3731
|
-
export declare function pipe<I extends any[], T1, T2, T3, T4, O>(f0: F<I, T1>, f1: IO<T1, T2>, f2: IO<T2, T3>, f3: IO<T3, T4>, f4: IO<T4, O>): F<I, O>;
|
|
3732
|
-
|
|
3733
3715
|
/**
|
|
3734
3716
|
* `"%f,%f('!')?"` representing the point (x,y).
|
|
3735
3717
|
*
|
package/lib/common.js
CHANGED
|
@@ -1,34 +1,3 @@
|
|
|
1
|
-
function _pipe(...args) {
|
|
2
|
-
const [o1, ...operations] = args;
|
|
3
|
-
return (...t) => operations.reduce((acc, f) => f(acc), o1(...t));
|
|
4
|
-
}
|
|
5
|
-
function pipe(o1, ...operations) {
|
|
6
|
-
return _pipe(o1, ...operations);
|
|
7
|
-
}
|
|
8
|
-
const defer = (fn) => (...args) => (src) => fn(src, ...args);
|
|
9
|
-
const toIterable = (f) => ({
|
|
10
|
-
[Symbol.iterator]: f
|
|
11
|
-
});
|
|
12
|
-
const map = defer(
|
|
13
|
-
(src, selector) => Array.from(
|
|
14
|
-
toIterable(function* () {
|
|
15
|
-
for (const v of src) {
|
|
16
|
-
yield selector(v);
|
|
17
|
-
}
|
|
18
|
-
})
|
|
19
|
-
)
|
|
20
|
-
);
|
|
21
|
-
const filter = defer(
|
|
22
|
-
(src, pred) => Array.from(
|
|
23
|
-
toIterable(function* () {
|
|
24
|
-
for (const x of src) {
|
|
25
|
-
if (pred(x)) {
|
|
26
|
-
yield x;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
})
|
|
30
|
-
)
|
|
31
|
-
);
|
|
32
1
|
const RootModelsContext = Object.seal({
|
|
33
2
|
// NOTE: RootModelsContext is also initialized after the model class is declared in the '@ts-graphviz/core/register-default' module.
|
|
34
3
|
Graph: null,
|
|
@@ -85,15 +54,12 @@ function toNodeRefGroup(targets) {
|
|
|
85
54
|
export {
|
|
86
55
|
RootModelsContext,
|
|
87
56
|
createModelsContext,
|
|
88
|
-
filter,
|
|
89
57
|
isCompass,
|
|
90
58
|
isForwardRefNode,
|
|
91
59
|
isNodeModel,
|
|
92
60
|
isNodeRef,
|
|
93
61
|
isNodeRefGroupLike,
|
|
94
62
|
isNodeRefLike,
|
|
95
|
-
map,
|
|
96
|
-
pipe,
|
|
97
63
|
toNodeRef,
|
|
98
64
|
toNodeRefGroup
|
|
99
65
|
};
|