@graffy/link 0.15.21-alpha.4 → 0.15.22
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/index.cjs +4 -0
- package/index.mjs +4 -0
- package/package.json +2 -2
package/index.cjs
CHANGED
|
@@ -57,6 +57,8 @@ function linkGraph(rootGraph, defs) {
|
|
|
57
57
|
return lookupValues(rootGraph, key.slice(2).split("."));
|
|
58
58
|
}
|
|
59
59
|
if (Array.isArray(key)) {
|
|
60
|
+
if (!key.length)
|
|
61
|
+
return [{ value: [], vars: {} }];
|
|
60
62
|
return unbraid(key.map(getChoices));
|
|
61
63
|
}
|
|
62
64
|
if (typeof key === "object" && key) {
|
|
@@ -183,6 +185,8 @@ function prepQueryLinks(rootQuery, defs) {
|
|
|
183
185
|
Object.defineProperty(pager, "toString", { value: () => key });
|
|
184
186
|
return pager;
|
|
185
187
|
}
|
|
188
|
+
if (!Array.isArray(query) || !query.length)
|
|
189
|
+
return [];
|
|
186
190
|
const [key, ...rest] = path;
|
|
187
191
|
if (rest.length === 0) {
|
|
188
192
|
if (key[0] === "$") {
|
package/index.mjs
CHANGED
|
@@ -52,6 +52,8 @@ function linkGraph(rootGraph, defs) {
|
|
|
52
52
|
return lookupValues(rootGraph, key.slice(2).split("."));
|
|
53
53
|
}
|
|
54
54
|
if (Array.isArray(key)) {
|
|
55
|
+
if (!key.length)
|
|
56
|
+
return [{ value: [], vars: {} }];
|
|
55
57
|
return unbraid(key.map(getChoices));
|
|
56
58
|
}
|
|
57
59
|
if (typeof key === "object" && key) {
|
|
@@ -178,6 +180,8 @@ function prepQueryLinks(rootQuery, defs) {
|
|
|
178
180
|
Object.defineProperty(pager, "toString", { value: () => key });
|
|
179
181
|
return pager;
|
|
180
182
|
}
|
|
183
|
+
if (!Array.isArray(query) || !query.length)
|
|
184
|
+
return [];
|
|
181
185
|
const [key, ...rest] = path;
|
|
182
186
|
if (rest.length === 0) {
|
|
183
187
|
if (key[0] === "$") {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graffy/link",
|
|
3
3
|
"description": "Graffy module for constructing links using an intuitive, declarative notation.",
|
|
4
4
|
"author": "aravind (https://github.com/aravindet)",
|
|
5
|
-
"version": "0.15.
|
|
5
|
+
"version": "0.15.22",
|
|
6
6
|
"main": "./index.cjs",
|
|
7
7
|
"exports": {
|
|
8
8
|
"import": "./index.mjs",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@graffy/common": "0.15.
|
|
19
|
+
"@graffy/common": "0.15.22",
|
|
20
20
|
"debug": "^4.3.3"
|
|
21
21
|
}
|
|
22
22
|
}
|