pacc 8.1.0 → 8.1.1

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.
Files changed (3) hide show
  1. package/README.md +15 -5
  2. package/package.json +1 -1
  3. package/src/ast.mjs +4 -4
package/README.md CHANGED
@@ -26,6 +26,8 @@ const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
26
26
 
27
27
  ### Table of Contents
28
28
 
29
+ * [AST](#ast)
30
+ * [Properties](#properties)
29
31
  * [binopError](#binoperror)
30
32
  * [Parameters](#parameters)
31
33
  * [prepareAttributesDefinitions](#prepareattributesdefinitions)
@@ -37,7 +39,7 @@ const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
37
39
  * [parseBytes](#parsebytes)
38
40
  * [Parameters](#parameters-4)
39
41
  * [AttributeDefinition](#attributedefinition)
40
- * [Properties](#properties)
42
+ * [Properties](#properties-1)
41
43
  * [default\_attribute](#default_attribute)
42
44
  * [default\_attribute](#default_attribute-1)
43
45
  * [default\_attribute](#default_attribute-2)
@@ -121,7 +123,7 @@ const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
121
123
  * [Parameters](#parameters-18)
122
124
  * [lookup](#lookup)
123
125
  * [Token](#token)
124
- * [Properties](#properties-1)
126
+ * [Properties](#properties-2)
125
127
  * [createToken](#createtoken)
126
128
  * [Parameters](#parameters-19)
127
129
  * [PLUS](#plus)
@@ -153,17 +155,25 @@ const result = getAttribute({ a: [0,{ b: 4 }]}, "a[1].b");
153
155
  * [IDENTIFIER](#identifier)
154
156
  * [EOF](#eof)
155
157
  * [Type](#type)
156
- * [Properties](#properties-2)
158
+ * [Properties](#properties-3)
157
159
  * [raiseOnUnknownType](#raiseonunknowntype)
158
160
  * [Parameters](#parameters-20)
159
161
 
162
+ ## AST
163
+
164
+ Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
165
+
166
+ ### Properties
167
+
168
+ * `eval` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** 
169
+
160
170
  ## binopError
161
171
 
162
172
  ### Parameters
163
173
 
164
174
  * `op` **[Token](#token)** 
165
- * `left` **AST** 
166
- * `right` **AST** 
175
+ * `left` **[AST](#ast)** 
176
+ * `right` **[AST](#ast)** 
167
177
 
168
178
  ## prepareAttributesDefinitions
169
179
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pacc",
3
- "version": "8.1.0",
3
+ "version": "8.1.1",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
package/src/ast.mjs CHANGED
@@ -72,11 +72,11 @@ export function binopEval(node, current, context) {
72
72
  }
73
73
 
74
74
  export function predicateIteratorEval(node, current, context) {
75
- if (current instanceof Set) {
76
- current = [...current];
77
- } else if (current instanceof Map) {
78
- current = [...current.values()];
75
+
76
+ if(current.values) {
77
+ current = current.values();
79
78
  }
79
+
80
80
  return current
81
81
  .filter(item => node.left.eval(node.left, item, context))
82
82
  .map(item => node.right.eval(node.right, item, context));