@podlite/schema 0.0.31 → 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.
@@ -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
@@ -193,7 +193,7 @@ export interface FormattingCodeS {
193
193
  export interface FormattingCodeA {
194
194
  type: 'fcode';
195
195
  name: 'A';
196
- content: string | Text;
196
+ content: string | Text | [Text];
197
197
  }
198
198
  export interface FormattingCodeD {
199
199
  type: 'fcode';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@podlite/schema",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "description": "AST tools for Podlite markup language",
5
5
  "main": "lib/index.js",
6
6
  "license": "MIT",
@@ -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
  }