@podlite/schema 0.0.30 → 0.0.32
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 +5 -0
- package/esm/grammarfc.js +300 -359
- package/esm/grammarfc.js.map +1 -1
- package/esm/helpers/makeInterator.js +3 -0
- package/esm/helpers/makeInterator.js.map +1 -1
- package/esm/helpers/makeTransformer.js +3 -0
- package/esm/helpers/makeTransformer.js.map +1 -1
- package/esm/types.d.ts +1 -1
- package/lib/grammarfc.js +300 -359
- package/lib/helpers/makeInterator.js +3 -0
- package/lib/helpers/makeTransformer.js +3 -0
- package/lib/types.d.ts +1 -1
- package/package.json +1 -1
- package/schema/AstTree.json +10 -0
- package/schema/PodliteDocument.json +10 -0
|
@@ -8,6 +8,9 @@ function flattenDeep(arr) {
|
|
|
8
8
|
}
|
|
9
9
|
function thisFunc(rules) {
|
|
10
10
|
function interator(node, context) {
|
|
11
|
+
if (node == null) {
|
|
12
|
+
return node;
|
|
13
|
+
}
|
|
11
14
|
if (node instanceof Array) {
|
|
12
15
|
// filter null and undefined nodes
|
|
13
16
|
return flattenDeep(node.map(item => interator(item, context))).filter(Boolean);
|
|
@@ -34,6 +34,9 @@ const makeTransformer = rule => {
|
|
|
34
34
|
rules.push((0, makeQuery_1.makeRule)((0, makeQuery_1.makePlug)(key), fn));
|
|
35
35
|
}
|
|
36
36
|
function visiter(node, context = {}) {
|
|
37
|
+
if (node == null) {
|
|
38
|
+
return node;
|
|
39
|
+
}
|
|
37
40
|
if (node instanceof Array) {
|
|
38
41
|
return flattenDeep(node.map(item => visiter(item, context)));
|
|
39
42
|
}
|
package/lib/types.d.ts
CHANGED
package/package.json
CHANGED
package/schema/AstTree.json
CHANGED
|
@@ -1999,6 +1999,16 @@
|
|
|
1999
1999
|
{
|
|
2000
2000
|
"$ref": "#/definitions/Text"
|
|
2001
2001
|
},
|
|
2002
|
+
{
|
|
2003
|
+
"type": "array",
|
|
2004
|
+
"items": [
|
|
2005
|
+
{
|
|
2006
|
+
"$ref": "#/definitions/Text"
|
|
2007
|
+
}
|
|
2008
|
+
],
|
|
2009
|
+
"minItems": 1,
|
|
2010
|
+
"maxItems": 1
|
|
2011
|
+
},
|
|
2002
2012
|
{
|
|
2003
2013
|
"type": "string"
|
|
2004
2014
|
}
|
|
@@ -1999,6 +1999,16 @@
|
|
|
1999
1999
|
{
|
|
2000
2000
|
"$ref": "#/definitions/Text"
|
|
2001
2001
|
},
|
|
2002
|
+
{
|
|
2003
|
+
"type": "array",
|
|
2004
|
+
"items": [
|
|
2005
|
+
{
|
|
2006
|
+
"$ref": "#/definitions/Text"
|
|
2007
|
+
}
|
|
2008
|
+
],
|
|
2009
|
+
"minItems": 1,
|
|
2010
|
+
"maxItems": 1
|
|
2011
|
+
},
|
|
2002
2012
|
{
|
|
2003
2013
|
"type": "string"
|
|
2004
2014
|
}
|