@jplorg/jpl 1.4.0 → 1.5.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/lib/builtins/index.js +23 -13
- package/package.json +13 -13
- package/src/builtins/index.js +23 -13
package/lib/builtins/index.js
CHANGED
|
@@ -41,22 +41,32 @@ func map(f): ([.[] | f()])
|
|
|
41
41
|
if from <= to then func (): (. + s) else func (): (. - s) end
|
|
42
42
|
)
|
|
43
43
|
)
|
|
44
|
-
| func hasContent(): (not contains->(["null", "function"], type()) and not contains->([[], {}, ""], .))
|
|
45
44
|
|
|
46
45
|
|
|
47
46
|
# type selectors:
|
|
48
|
-
|
|
49
|
-
| func arrays(): (select(
|
|
50
|
-
| func
|
|
51
|
-
| func
|
|
52
|
-
| func
|
|
53
|
-
| func
|
|
54
|
-
| func
|
|
55
|
-
| func
|
|
56
|
-
| func
|
|
57
|
-
| func
|
|
58
|
-
| func
|
|
59
|
-
| func
|
|
47
|
+
| func isArray(): (type() == "array")
|
|
48
|
+
| func arrays(): (select(isArray))
|
|
49
|
+
| func isObject(): (type() == "object")
|
|
50
|
+
| func objects(): (select(isObject))
|
|
51
|
+
| func isIterable(): (contains->(["array", "object"], type()))
|
|
52
|
+
| func iterables(): (select(isIterable))
|
|
53
|
+
| func isScalar(): (not contains->(["array", "object"], type()))
|
|
54
|
+
| func scalars(): (select(isScalar))
|
|
55
|
+
| func isBoolean(): (type() == "boolean")
|
|
56
|
+
| func booleans(): (select(isBoolean))
|
|
57
|
+
| func isNumber(): (type() == "number")
|
|
58
|
+
| func numbers(): (select(isNumber))
|
|
59
|
+
| func isString(): (type() == "string")
|
|
60
|
+
| func strings(): (select(isString))
|
|
61
|
+
| func isNull(): (type() == "null")
|
|
62
|
+
| func nulls(): (select(isNull))
|
|
63
|
+
| func isFunction(): (type() == "function")
|
|
64
|
+
| func functions(): (select(isFunction))
|
|
65
|
+
| func isNullLike(): (contains->(["null", "function"], type()))
|
|
66
|
+
| func nullLikes(): (select(isNullLike))
|
|
67
|
+
| func isValue(): (not contains->(["null", "function"], type()))
|
|
68
|
+
| func values(): (select(isValue))
|
|
69
|
+
| func hasContent(): (isValue() and not contains->([[], {}, ""], .))
|
|
60
70
|
| func contents(): (select(hasContent))
|
|
61
71
|
|
|
62
72
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jplorg/jpl",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"description": "JPL interpreter",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -47,19 +47,19 @@
|
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://github.com/jplorg/jpl",
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@babel/cli": "^7.28.
|
|
51
|
-
"@babel/core": "^7.28.
|
|
52
|
-
"@babel/eslint-parser": "^7.28.
|
|
53
|
-
"@babel/preset-env": "^7.28.
|
|
54
|
-
"@babel/preset-react": "^7.
|
|
55
|
-
"cross-env": "^10.
|
|
56
|
-
"eslint": "^9.
|
|
50
|
+
"@babel/cli": "^7.28.6",
|
|
51
|
+
"@babel/core": "^7.28.6",
|
|
52
|
+
"@babel/eslint-parser": "^7.28.6",
|
|
53
|
+
"@babel/preset-env": "^7.28.6",
|
|
54
|
+
"@babel/preset-react": "^7.28.5",
|
|
55
|
+
"cross-env": "^10.1.0",
|
|
56
|
+
"eslint": "^9.39.2",
|
|
57
57
|
"eslint-config-prettier": "^10.1.1",
|
|
58
58
|
"eslint-plugin-import": "^2.31.0",
|
|
59
|
-
"eslint-plugin-prettier": "^5.
|
|
60
|
-
"eslint-plugin-unused-imports": "^4.
|
|
61
|
-
"globals": "^
|
|
62
|
-
"prettier": "^3.
|
|
63
|
-
"rimraf": "^6.
|
|
59
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
60
|
+
"eslint-plugin-unused-imports": "^4.3.0",
|
|
61
|
+
"globals": "^17.2.0",
|
|
62
|
+
"prettier": "^3.8.1",
|
|
63
|
+
"rimraf": "^6.1.2"
|
|
64
64
|
}
|
|
65
65
|
}
|
package/src/builtins/index.js
CHANGED
|
@@ -34,22 +34,32 @@ func map(f): ([.[] | f()])
|
|
|
34
34
|
if from <= to then func (): (. + s) else func (): (. - s) end
|
|
35
35
|
)
|
|
36
36
|
)
|
|
37
|
-
| func hasContent(): (not contains->(["null", "function"], type()) and not contains->([[], {}, ""], .))
|
|
38
37
|
|
|
39
38
|
|
|
40
39
|
# type selectors:
|
|
41
|
-
|
|
42
|
-
| func arrays(): (select(
|
|
43
|
-
| func
|
|
44
|
-
| func
|
|
45
|
-
| func
|
|
46
|
-
| func
|
|
47
|
-
| func
|
|
48
|
-
| func
|
|
49
|
-
| func
|
|
50
|
-
| func
|
|
51
|
-
| func
|
|
52
|
-
| func
|
|
40
|
+
| func isArray(): (type() == "array")
|
|
41
|
+
| func arrays(): (select(isArray))
|
|
42
|
+
| func isObject(): (type() == "object")
|
|
43
|
+
| func objects(): (select(isObject))
|
|
44
|
+
| func isIterable(): (contains->(["array", "object"], type()))
|
|
45
|
+
| func iterables(): (select(isIterable))
|
|
46
|
+
| func isScalar(): (not contains->(["array", "object"], type()))
|
|
47
|
+
| func scalars(): (select(isScalar))
|
|
48
|
+
| func isBoolean(): (type() == "boolean")
|
|
49
|
+
| func booleans(): (select(isBoolean))
|
|
50
|
+
| func isNumber(): (type() == "number")
|
|
51
|
+
| func numbers(): (select(isNumber))
|
|
52
|
+
| func isString(): (type() == "string")
|
|
53
|
+
| func strings(): (select(isString))
|
|
54
|
+
| func isNull(): (type() == "null")
|
|
55
|
+
| func nulls(): (select(isNull))
|
|
56
|
+
| func isFunction(): (type() == "function")
|
|
57
|
+
| func functions(): (select(isFunction))
|
|
58
|
+
| func isNullLike(): (contains->(["null", "function"], type()))
|
|
59
|
+
| func nullLikes(): (select(isNullLike))
|
|
60
|
+
| func isValue(): (not contains->(["null", "function"], type()))
|
|
61
|
+
| func values(): (select(isValue))
|
|
62
|
+
| func hasContent(): (isValue() and not contains->([[], {}, ""], .))
|
|
53
63
|
| func contents(): (select(hasContent))
|
|
54
64
|
|
|
55
65
|
|