@jplorg/jpl 1.5.0 → 2.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/lib/builtins/index.js +2 -2
- package/lib/program/ops/opAccess/opaIter.js +2 -0
- package/lib/program/ops/opAccess/opaSlice.js +2 -0
- package/lib/program/ops/opAssignment/opaAssignIter.js +2 -0
- package/lib/program/ops/opAssignment/opaAssignSlice.js +2 -0
- package/package.json +1 -1
- package/src/builtins/index.js +2 -2
- package/src/program/ops/opAccess/opaIter.js +3 -0
- package/src/program/ops/opAccess/opaSlice.js +3 -0
- package/src/program/ops/opAssignment/opaAssignIter.js +3 -0
- package/src/program/ops/opAssignment/opaAssignSlice.js +3 -0
package/lib/builtins/index.js
CHANGED
|
@@ -66,8 +66,8 @@ func map(f): ([.[] | f()])
|
|
|
66
66
|
| func nullLikes(): (select(isNullLike))
|
|
67
67
|
| func isValue(): (not contains->(["null", "function"], type()))
|
|
68
68
|
| func values(): (select(isValue))
|
|
69
|
-
| func
|
|
70
|
-
| func contents(): (select(
|
|
69
|
+
| func isContent(): (isValue() and not contains->([[], {}, ""], .))
|
|
70
|
+
| func contents(): (select(isContent))
|
|
71
71
|
|
|
72
72
|
|
|
73
73
|
| func toEntries(): (o = . | keys() | map(func (): ({ key: ., value: o[.] })))
|
|
@@ -16,6 +16,8 @@ var _default = exports.default = {
|
|
|
16
16
|
const tf = runtime.type(from);
|
|
17
17
|
const tt = runtime.type(to);
|
|
18
18
|
switch (tv) {
|
|
19
|
+
case 'null':
|
|
20
|
+
return next(null);
|
|
19
21
|
case 'array':
|
|
20
22
|
if (['number', 'null'].includes(tf) && ['number', 'null'].includes(tt)) {
|
|
21
23
|
return next(value.slice(Math.trunc(from ?? 0), Math.trunc(to ?? value.length)));
|
|
@@ -26,6 +26,8 @@ var _default = exports.default = {
|
|
|
26
26
|
const ts = runtime.type(start);
|
|
27
27
|
const te = runtime.type(end);
|
|
28
28
|
switch (tv) {
|
|
29
|
+
case 'null':
|
|
30
|
+
return iter(from + 1, source);
|
|
29
31
|
case 'array':
|
|
30
32
|
if (['number', 'null'].includes(ts) && ['number', 'null'].includes(te)) {
|
|
31
33
|
return runtime.muxAll([await next(v.slice(Math.trunc(start ?? 0), Math.trunc(end ?? v.length)))], async output => {
|
package/package.json
CHANGED
package/src/builtins/index.js
CHANGED
|
@@ -59,8 +59,8 @@ func map(f): ([.[] | f()])
|
|
|
59
59
|
| func nullLikes(): (select(isNullLike))
|
|
60
60
|
| func isValue(): (not contains->(["null", "function"], type()))
|
|
61
61
|
| func values(): (select(isValue))
|
|
62
|
-
| func
|
|
63
|
-
| func contents(): (select(
|
|
62
|
+
| func isContent(): (isValue() and not contains->([[], {}, ""], .))
|
|
63
|
+
| func contents(): (select(isContent))
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
| func toEntries(): (o = . | keys() | map(func (): ({ key: ., value: o[.] })))
|
|
@@ -16,6 +16,9 @@ export default {
|
|
|
16
16
|
const tf = runtime.type(from);
|
|
17
17
|
const tt = runtime.type(to);
|
|
18
18
|
switch (tv) {
|
|
19
|
+
case 'null':
|
|
20
|
+
return next(null);
|
|
21
|
+
|
|
19
22
|
case 'array':
|
|
20
23
|
if (['number', 'null'].includes(tf) && ['number', 'null'].includes(tt)) {
|
|
21
24
|
return next(value.slice(Math.trunc(from ?? 0), Math.trunc(to ?? value.length)));
|
|
@@ -6,6 +6,9 @@ export default {
|
|
|
6
6
|
const vt = runtime.unwrapValue(target);
|
|
7
7
|
const tt = runtime.type(vt);
|
|
8
8
|
switch (tt) {
|
|
9
|
+
case 'null':
|
|
10
|
+
return [undefined];
|
|
11
|
+
|
|
9
12
|
case 'object': {
|
|
10
13
|
const items = Object.entries(vt);
|
|
11
14
|
const outputs = await runtime.muxAsync([items], async (item) =>
|
|
@@ -33,6 +33,9 @@ export default {
|
|
|
33
33
|
const ts = runtime.type(start);
|
|
34
34
|
const te = runtime.type(end);
|
|
35
35
|
switch (tv) {
|
|
36
|
+
case 'null':
|
|
37
|
+
return iter(from + 1, source);
|
|
38
|
+
|
|
36
39
|
case 'array':
|
|
37
40
|
if (['number', 'null'].includes(ts) && ['number', 'null'].includes(te)) {
|
|
38
41
|
return runtime.muxAll(
|