pacc 2.1.5 → 3.0.0
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/LICENSE +1 -1
- package/package.json +6 -6
- package/src/attribute.mjs +5 -10
- package/src/tokens.mjs +2 -2
package/LICENSE
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pacc",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"lint:docs": "documentation lint ./src/**/*.mjs"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"ava": "^6.
|
|
29
|
-
"browser-ava": "^2.1.
|
|
30
|
-
"c8": "^
|
|
31
|
-
"documentation": "^14.0.
|
|
32
|
-
"semantic-release": "^
|
|
28
|
+
"ava": "^6.1.1",
|
|
29
|
+
"browser-ava": "^2.1.9",
|
|
30
|
+
"c8": "^9.1.0",
|
|
31
|
+
"documentation": "^14.0.3",
|
|
32
|
+
"semantic-release": "^23.0.0"
|
|
33
33
|
},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
package/src/attribute.mjs
CHANGED
|
@@ -47,7 +47,7 @@ export function setAttribute(object, expression, value) {
|
|
|
47
47
|
|
|
48
48
|
default:
|
|
49
49
|
if (anchor) {
|
|
50
|
-
anchor[anchorKey] = object =
|
|
50
|
+
anchor[anchorKey] = object = typeof token === "string" ? {} : [];
|
|
51
51
|
anchor = undefined;
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -85,7 +85,7 @@ export function getAttribute(object, expression) {
|
|
|
85
85
|
* @param {string} expression
|
|
86
86
|
* @returns {[any,string]} value associated with the given property name
|
|
87
87
|
*/
|
|
88
|
-
export function getAttributeAndOperator(object, expression
|
|
88
|
+
export function getAttributeAndOperator(object, expression) {
|
|
89
89
|
let op = EQUAL;
|
|
90
90
|
let predicateTokens;
|
|
91
91
|
|
|
@@ -120,15 +120,10 @@ export function getAttributeAndOperator(object, expression, getters = {}) {
|
|
|
120
120
|
break;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
object = g(object);
|
|
123
|
+
if (object[token] !== undefined) {
|
|
124
|
+
object = object[token];
|
|
126
125
|
} else {
|
|
127
|
-
|
|
128
|
-
object = object[token];
|
|
129
|
-
} else {
|
|
130
|
-
return [undefined, op];
|
|
131
|
-
}
|
|
126
|
+
return [undefined, op];
|
|
132
127
|
}
|
|
133
128
|
}
|
|
134
129
|
}
|
package/src/tokens.mjs
CHANGED
|
@@ -217,11 +217,11 @@ export function* tokens(string) {
|
|
|
217
217
|
default:
|
|
218
218
|
yield lookup[state];
|
|
219
219
|
case undefined:
|
|
220
|
-
buffer = c.charCodeAt(0) -
|
|
220
|
+
buffer = c.charCodeAt(0) - 48;
|
|
221
221
|
state = "number";
|
|
222
222
|
break;
|
|
223
223
|
case "number":
|
|
224
|
-
buffer = buffer * 10 + c.charCodeAt(0) -
|
|
224
|
+
buffer = buffer * 10 + c.charCodeAt(0) - 48;
|
|
225
225
|
break;
|
|
226
226
|
case "string":
|
|
227
227
|
case "identifier":
|