functionalscript 0.0.424 → 0.0.427

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 (39) hide show
  1. package/Cargo.lock +7 -0
  2. package/Cargo.toml +2 -1
  3. package/com/cpp/test.f.cjs +1 -1
  4. package/com/cs/test.f.cjs +1 -1
  5. package/com/rust/module.f.cjs +42 -16
  6. package/com/rust/test.f.cjs +99 -74
  7. package/com/types/{test.f.cjs → testlib.f.cjs} +0 -0
  8. package/commonjs/build/test.f.cjs +2 -4
  9. package/commonjs/package/dependencies/test.f.cjs +1 -3
  10. package/commonjs/package/test.f.cjs +1 -5
  11. package/commonjs/path/test.f.cjs +158 -170
  12. package/commonjs/test.cjs +52 -61
  13. package/html/test.f.cjs +12 -13
  14. package/json/test.f.cjs +41 -37
  15. package/json/tokenizer/test.f.cjs +238 -296
  16. package/nodejs/version/test.f.cjs +1 -3
  17. package/package.json +1 -1
  18. package/sha2/test.f.cjs +37 -40
  19. package/test.mjs +51 -19
  20. package/text/test.f.cjs +1 -3
  21. package/text/utf16/test.f.cjs +96 -109
  22. package/text/utf8/test.f.cjs +116 -135
  23. package/types/array/test.f.cjs +84 -84
  24. package/types/btree/find/test.f.cjs +2 -2
  25. package/types/btree/remove/test.f.cjs +6 -3
  26. package/types/btree/set/test.f.cjs +372 -370
  27. package/types/btree/test.f.cjs +11 -7
  28. package/types/byteSet/module.f.cjs +2 -4
  29. package/types/byteSet/test.f.cjs +37 -40
  30. package/types/function/compare/module.f.cjs +1 -1
  31. package/types/function/compare/test.f.cjs +1 -3
  32. package/types/function/test.f.cjs +1 -3
  33. package/types/list/test.f.cjs +208 -219
  34. package/types/map/test.f.cjs +57 -57
  35. package/types/nibbleSet/test.f.cjs +37 -40
  36. package/types/number/test.f.cjs +24 -26
  37. package/types/object/test.f.cjs +12 -13
  38. package/types/option/test.f.cjs +1 -3
  39. package/types/range/test.f.cjs +1 -3
@@ -12,182 +12,170 @@ const stringify = g => {
12
12
  return json.stringify(identity)(g)
13
13
  }
14
14
 
15
- {
16
- const p = { name: '', version: '' }
17
- const result = _.parseLocal('')('./a')
18
- if (stringify(result) !== '{"external":false,"dir":false,"items":["a"]}') { throw result }
19
- }
20
-
21
- {
22
- const result = _.parseLocal('')('./a/')
23
- if (stringify(result) !== '{"external":false,"dir":true,"items":["a"]}') { throw result }
24
- }
25
-
26
- {
27
- const result = _.parseLocal('')('..')
28
- if (result !== undefined) { throw result }
29
- }
30
-
31
- {
32
- const result = _.parseLocal('a')('')
33
- if (stringify(result) !== '{"external":true,"dir":true,"items":[]}') { throw result }
34
- }
35
-
36
- {
37
- const result = _.parseLocal('')('./a/b/.././c')
38
- if (stringify(result) !== '{"external":false,"dir":false,"items":["a","c"]}') { throw result }
39
- }
40
-
41
- {
42
- const result = _.parseLocal('x/r')('./a/b/.././c')
43
- if (stringify(result) !== '{"external":false,"dir":false,"items":["x","r","a","c"]}') { throw result }
44
- }
45
-
46
- {
47
- const result = _.parseLocal('a')('a/b/.././c')
48
- if (stringify(result) !== '{"external":true,"dir":false,"items":["a","c"]}') { throw result }
49
- }
50
-
51
- {
52
- const result = _.parseLocal('')('./x/..')
53
- if (stringify(result) !== '{"external":false,"dir":true,"items":[]}') { throw result }
54
- }
55
-
56
- {
57
- if (_.parseGlobal(() => undefined)(false)(['a', 'b']) !== undefined) { throw 'error' }
58
- if (_.parseGlobal(() => undefined)(false)(['b']) !== undefined) { throw 'error' }
59
- if (_.parseGlobal(d => at(d)({ b: 'x' }))(false)(['d']) !== undefined) { throw 'error' }
60
- {
61
- const result = stringify(_.parseGlobal(d => at(d)({ b: 'x' }))(false)(['b']))
62
- if (result !== '{"package":"x","items":[],"dir":false}') { throw result }
63
- }
64
- if (_.parseGlobal(d => at(d)({ 'b/r': 'x' }))(false)(['b']) !== undefined) { throw 'error' }
65
- {
66
- const result = stringify(_.parseGlobal(d => at(d)({ 'b/r': 'x' }))(false)(['b', 'r']))
67
- if (result !== '{"package":"x","items":[],"dir":false}') { throw result }
68
- }
69
- {
70
- const result = stringify(_.parseGlobal(d => at(d)({ 'b/r': 'x' }))(false)(['b', 'r', 'd', 't']))
71
- if (result !== '{"package":"x","items":["d","t"],"dir":false}') { throw result }
72
- }
73
- {
74
- const result = stringify(_.parseGlobal(d => at(d)({ 'b/r': 'x' }))(true)(['b', 'r', 'd', 't']))
75
- if (result !== '{"package":"x","items":["d","t"],"dir":true}') { throw result }
76
- }
77
- }
78
-
79
- {
80
- /** @type {object.Map<package_.Package>} */
81
- const packages = {
82
- '': {
83
- dependency: () => todo(),
84
- file: path => at(path)({ 'a/c': 'return "a/c"' }),
15
+ module.exports = [
16
+ () => {
17
+ const p = { name: '', version: '' }
18
+ const result = _.parseLocal('')('./a')
19
+ if (stringify(result) !== '{"external":false,"dir":false,"items":["a"]}') { throw result }
20
+ },
21
+ () => {
22
+ const result = _.parseLocal('')('./a/')
23
+ if (stringify(result) !== '{"external":false,"dir":true,"items":["a"]}') { throw result }
24
+ },
25
+ () => {
26
+ const result = _.parseLocal('')('..')
27
+ if (result !== undefined) { throw result }
28
+ },
29
+ () => {
30
+ const result = _.parseLocal('a')('')
31
+ if (stringify(result) !== '{"external":true,"dir":true,"items":[]}') { throw result }
32
+ },
33
+ () => {
34
+ const result = _.parseLocal('')('./a/b/.././c')
35
+ if (stringify(result) !== '{"external":false,"dir":false,"items":["a","c"]}') { throw result }
36
+ },
37
+ () => {
38
+ const result = _.parseLocal('x/r')('./a/b/.././c')
39
+ if (stringify(result) !== '{"external":false,"dir":false,"items":["x","r","a","c"]}') { throw result }
40
+ },
41
+ () => {
42
+ const result = _.parseLocal('a')('a/b/.././c')
43
+ if (stringify(result) !== '{"external":true,"dir":false,"items":["a","c"]}') { throw result }
44
+ },
45
+ () => {
46
+ const result = _.parseLocal('')('./x/..')
47
+ if (stringify(result) !== '{"external":false,"dir":true,"items":[]}') { throw result }
48
+ },
49
+ () => {
50
+ if (_.parseGlobal(() => undefined)(false)(['a', 'b']) !== undefined) { throw 'error' }
51
+ if (_.parseGlobal(() => undefined)(false)(['b']) !== undefined) { throw 'error' }
52
+ if (_.parseGlobal(d => at(d)({ b: 'x' }))(false)(['d']) !== undefined) { throw 'error' }
53
+ {
54
+ const result = stringify(_.parseGlobal(d => at(d)({ b: 'x' }))(false)(['b']))
55
+ if (result !== '{"package":"x","items":[],"dir":false}') { throw result }
85
56
  }
86
- }
87
- const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: ['a', 'b']})('../c'))
88
- if (result !== '{"id":{"package":"","path":["a","c"]},"source":"return \\"a/c\\""}') { throw result }
89
- }
90
-
91
- {
92
- /** @type {object.Map<package_.Package>} */
93
- const packages = {
94
- '': {
95
- dependency: x => {
96
- const path = `node_modules/${x}`
97
- return at(path)(packages) !== undefined ? path : undefined
57
+ if (_.parseGlobal(d => at(d)({ 'b/r': 'x' }))(false)(['b']) !== undefined) { throw 'error' }
58
+ {
59
+ const result = stringify(_.parseGlobal(d => at(d)({ 'b/r': 'x' }))(false)(['b', 'r']))
60
+ if (result !== '{"package":"x","items":[],"dir":false}') { throw result }
61
+ }
62
+ {
63
+ const result = stringify(_.parseGlobal(d => at(d)({ 'b/r': 'x' }))(false)(['b', 'r', 'd', 't']))
64
+ if (result !== '{"package":"x","items":["d","t"],"dir":false}') { throw result }
65
+ }
66
+ {
67
+ const result = stringify(_.parseGlobal(d => at(d)({ 'b/r': 'x' }))(true)(['b', 'r', 'd', 't']))
68
+ if (result !== '{"package":"x","items":["d","t"],"dir":true}') { throw result }
69
+ }
70
+ },
71
+ () => {
72
+ /** @type {object.Map<package_.Package>} */
73
+ const packages = {
74
+ '': {
75
+ dependency: () => todo(),
76
+ file: path => at(path)({ 'a/c': 'return "a/c"' }),
77
+ }
78
+ }
79
+ const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: ['a', 'b'] })('../c'))
80
+ if (result !== '{"id":{"package":"","path":["a","c"]},"source":"return \\"a/c\\""}') { throw result }
81
+ },
82
+ () => {
83
+ /** @type {object.Map<package_.Package>} */
84
+ const packages = {
85
+ '': {
86
+ dependency: x => {
87
+ const path = `node_modules/${x}`
88
+ return at(path)(packages) !== undefined ? path : undefined
89
+ },
90
+ file: path => at(path)({
91
+ 'index.js': 'return "index.js"',
92
+ 'x/index.js': 'return "x/index.js"',
93
+ 'x.js': 'return "x.js"',
94
+ })
98
95
  },
99
- file: path => at(path)({
100
- 'index.js': 'return "index.js"',
101
- 'x/index.js': 'return "x/index.js"',
102
- 'x.js': 'return "x.js"',
103
- })
104
- },
105
- 'node_modules/z': {
106
- dependency: () => todo(),
107
- file: path => at(path)({ 'a/c/index.js': 'return "a/c"' }),
96
+ 'node_modules/z': {
97
+ dependency: () => todo(),
98
+ file: path => at(path)({ 'a/c/index.js': 'return "a/c"' }),
99
+ }
108
100
  }
109
- }
110
- {
111
- const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: ['a', 'b']})('z/a/c'))
112
- if (result !== '{"id":{"package":"node_modules/z","path":["a","c","index.js"]},"source":"return \\"a/c\\""}') {
113
- throw result
101
+ {
102
+ const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: ['a', 'b'] })('z/a/c'))
103
+ if (result !== '{"id":{"package":"node_modules/z","path":["a","c","index.js"]},"source":"return \\"a/c\\""}') {
104
+ throw result
105
+ }
114
106
  }
115
- }
116
- {
117
- const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: ['a', 'b']})('../..'))
118
- if (result !== '{"id":{"package":"","path":["index.js"]},"source":"return \\"index.js\\""}') { throw result }
119
- }
120
- {
121
- const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: []})('./x'))
122
- if (result !== '{"id":{"package":"","path":["x.js"]},"source":"return \\"x.js\\""}') { throw result }
123
- }
124
- {
125
- const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: []})('./x.js'))
126
- if (result !== '{"id":{"package":"","path":["x.js"]},"source":"return \\"x.js\\""}') { throw result }
127
- }
128
- {
129
- const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: []})('./x/'))
130
- if (result !== '{"id":{"package":"","path":["x","index.js"]},"source":"return \\"x/index.js\\""}') { throw result }
131
- }
132
- {
133
- const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: ['x', 'a']})('../'))
134
- if (result !== '{"id":{"package":"","path":["x","index.js"]},"source":"return \\"x/index.js\\""}') { throw result }
135
- }
136
- {
137
- const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: ['x', 'a']})('..'))
138
- if (result !== '{"id":{"package":"","path":["x","index.js"]},"source":"return \\"x/index.js\\""}') { throw result }
139
- }
140
- }
141
-
142
- {
143
- /** @type {object.Map<package_.Package>} */
144
- const packages = {
145
- '': {
146
- dependency: x => {
147
- const path = `node_modules/${x}`
148
- return at(path)(packages) !== undefined ? path : undefined
107
+ {
108
+ const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: ['a', 'b'] })('../..'))
109
+ if (result !== '{"id":{"package":"","path":["index.js"]},"source":"return \\"index.js\\""}') { throw result }
110
+ }
111
+ {
112
+ const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: [] })('./x'))
113
+ if (result !== '{"id":{"package":"","path":["x.js"]},"source":"return \\"x.js\\""}') { throw result }
114
+ }
115
+ {
116
+ const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: [] })('./x.js'))
117
+ if (result !== '{"id":{"package":"","path":["x.js"]},"source":"return \\"x.js\\""}') { throw result }
118
+ }
119
+ {
120
+ const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: [] })('./x/'))
121
+ if (result !== '{"id":{"package":"","path":["x","index.js"]},"source":"return \\"x/index.js\\""}') { throw result }
122
+ }
123
+ {
124
+ const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: ['x', 'a'] })('../'))
125
+ if (result !== '{"id":{"package":"","path":["x","index.js"]},"source":"return \\"x/index.js\\""}') { throw result }
126
+ }
127
+ {
128
+ const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: ['x', 'a'] })('..'))
129
+ if (result !== '{"id":{"package":"","path":["x","index.js"]},"source":"return \\"x/index.js\\""}') { throw result }
130
+ }
131
+ },
132
+ () => {
133
+ /** @type {object.Map<package_.Package>} */
134
+ const packages = {
135
+ '': {
136
+ dependency: x => {
137
+ const path = `node_modules/${x}`
138
+ return at(path)(packages) !== undefined ? path : undefined
139
+ },
140
+ file: todo
149
141
  },
150
- file: todo
151
- },
152
- 'node_modules/z/a': {
153
- dependency: () => todo(),
154
- file: path => at(path)({
155
- 'c/index.js': 'return "c/index.js"',
156
- 'c.js': 'return "c.js"'
157
- }),
142
+ 'node_modules/z/a': {
143
+ dependency: () => todo(),
144
+ file: path => at(path)({
145
+ 'c/index.js': 'return "c/index.js"',
146
+ 'c.js': 'return "c.js"'
147
+ }),
148
+ }
158
149
  }
159
- }
160
- {
161
- const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: ['a', 'b']})('z/a/c'))
162
- if (result !== '{"id":{"package":"node_modules/z/a","path":["c.js"]},"source":"return \\"c.js\\""}') { throw result }
163
- }
164
- {
165
- const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: ['a', 'b']})('z/a/c/'))
166
- if (result !== '{"id":{"package":"node_modules/z/a","path":["c","index.js"]},"source":"return \\"c/index.js\\""}') { throw result }
167
- }
168
- }
169
-
170
- {
171
- /** @type {object.Map<package_.Package>} */
172
- const packages = {
173
- '': {
174
- dependency: x => {
175
- const path = `node_modules/${x}`
176
- return at(path)(packages) !== undefined ? path : undefined
150
+ {
151
+ const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: ['a', 'b'] })('z/a/c'))
152
+ if (result !== '{"id":{"package":"node_modules/z/a","path":["c.js"]},"source":"return \\"c.js\\""}') { throw result }
153
+ }
154
+ {
155
+ const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: ['a', 'b'] })('z/a/c/'))
156
+ if (result !== '{"id":{"package":"node_modules/z/a","path":["c","index.js"]},"source":"return \\"c/index.js\\""}') { throw result }
157
+ }
158
+ },
159
+ () => {
160
+ /** @type {object.Map<package_.Package>} */
161
+ const packages = {
162
+ '': {
163
+ dependency: x => {
164
+ const path = `node_modules/${x}`
165
+ return at(path)(packages) !== undefined ? path : undefined
166
+ },
167
+ file: todo
177
168
  },
178
- file: todo
179
- },
180
- 'node_modules/z/a/c': {
181
- dependency: () => todo(),
182
- file: path => at(path)({
183
- '': 'throw',
184
- '.js': 'throw',
185
- 'index.js': 'return "a/c"'
186
- }),
169
+ 'node_modules/z/a/c': {
170
+ dependency: () => todo(),
171
+ file: path => at(path)({
172
+ '': 'throw',
173
+ '.js': 'throw',
174
+ 'index.js': 'return "a/c"'
175
+ }),
176
+ }
187
177
  }
178
+ const result = stringify(_.parseAndFind(p => at(p)(packages))({ package: '', path: ['a', 'b'] })('z/a/c'))
179
+ if (result !== '{"id":{"package":"node_modules/z/a/c","path":["index.js"]},"source":"return \\"a/c\\""}') { throw result }
188
180
  }
189
- const result = stringify(_.parseAndFind(p => at(p)(packages))({package: '', path: ['a', 'b']})('z/a/c'))
190
- if (result !== '{"id":{"package":"node_modules/z/a/c","path":["index.js"]},"source":"return \\"a/c\\""}') { throw result }
191
- }
192
-
193
- module.exports = {}
181
+ ]
package/commonjs/test.cjs CHANGED
@@ -1,72 +1,63 @@
1
1
  const _ = require('./module.cjs')
2
2
  const run = require('./module/function/module.f.cjs')
3
3
 
4
- // ok:
5
- {
6
- const source = 'module.exports = "Hello world!"'
7
- const m = _.compile(source)
8
- if (m[0] !== 'ok') { throw m }
9
- const [result] = m[1](() => { throw 0 })(undefined)
10
- if (result[0] !== 'ok') { throw result }
11
- if (result[1] !== 'Hello world!') { throw result }
12
- }
13
-
14
- // compilation error:
15
- {
16
- const source = '+'
17
- const m = _.compile(source)
18
- if (m[0] !== 'error') { throw m }
19
- }
20
-
21
- // compilation error with "use strict;":
22
- {
23
- const source = 'const x = 04'
24
- const m = _.compile(source)
25
- if (m[0] !== 'error') { throw m }
26
- }
27
-
28
- // runtime error:
29
- {
30
- const source = 'a = 5'
31
- const m = _.compile(source)
32
- if (m[0] !== 'ok') { throw m }
33
- const [result] = m[1](() => { throw 0 })(undefined)
34
- if (result[0] !== 'error') { throw result }
35
- }
36
-
37
- //
38
- {
39
- const depSource = 'module.exports = 137'
40
- const d = _.compile(depSource)
41
- if (d[0] !== 'ok') { throw d }
42
-
43
- /** @type {run.Require<number>} */
44
- const req = path => prior => {
45
- if (path !== 'm') { throw path }
46
- return d[1](req)(prior + 1)
47
- }
48
-
49
- let info = 0
50
- {
51
- const source = 'module.exports = require("m") + 42'
4
+ module.exports = {
5
+ ok: () => {
6
+ const source = 'module.exports = "Hello world!"'
52
7
  const m = _.compile(source)
53
8
  if (m[0] !== 'ok') { throw m }
54
-
55
- const [result, newInfo] = m[1](req)(info)
9
+ const [result] = m[1](() => { throw 0 })(undefined)
56
10
  if (result[0] !== 'ok') { throw result }
57
- if (result[1] !== 179) { throw result }
58
- info = newInfo
59
- }
60
-
61
- {
62
- const source = 'module.exports = require("x") + 42'
11
+ if (result[1] !== 'Hello world!') { throw result }
12
+ },
13
+ compilationError: () => {
14
+ const source = '+'
15
+ const m = _.compile(source)
16
+ if (m[0] !== 'error') { throw m }
17
+ },
18
+ compilationErrorStrict: () => {
19
+ const source = 'const x = 04'
20
+ const m = _.compile(source)
21
+ if (m[0] !== 'error') { throw m }
22
+ },
23
+ runtimeError: () => {
24
+ const source = 'a = 5'
63
25
  const m = _.compile(source)
64
26
  if (m[0] !== 'ok') { throw m }
65
-
66
- const [result, infox] = m[1](req)(info)
27
+ const [result] = m[1](() => { throw 0 })(undefined)
67
28
  if (result[0] !== 'error') { throw result }
68
- if (infox !== 1) { throw info }
29
+ },
30
+ test: () => {
31
+ const depSource = 'module.exports = 137'
32
+ const d = _.compile(depSource)
33
+ if (d[0] !== 'ok') { throw d }
34
+
35
+ /** @type {run.Require<number>} */
36
+ const req = path => prior => {
37
+ if (path !== 'm') { throw path }
38
+ return d[1](req)(prior + 1)
39
+ }
40
+
41
+ let info = 0
42
+ {
43
+ const source = 'module.exports = require("m") + 42'
44
+ const m = _.compile(source)
45
+ if (m[0] !== 'ok') { throw m }
46
+
47
+ const [result, newInfo] = m[1](req)(info)
48
+ if (result[0] !== 'ok') { throw result }
49
+ if (result[1] !== 179) { throw result }
50
+ info = newInfo
51
+ }
52
+
53
+ {
54
+ const source = 'module.exports = require("x") + 42'
55
+ const m = _.compile(source)
56
+ if (m[0] !== 'ok') { throw m }
57
+
58
+ const [result, infox] = m[1](req)(info)
59
+ if (result[0] !== 'error') { throw result }
60
+ if (infox !== 1) { throw info }
61
+ }
69
62
  }
70
63
  }
71
-
72
- module.exports = {}
package/html/test.f.cjs CHANGED
@@ -1,15 +1,14 @@
1
1
  const _ = require('./module.f.cjs')
2
2
 
3
- {
4
- const r = _.htmlToString(['html', []])
5
- if (r !== '<!DOCTYPE html><html></html>') { throw r }
6
- }
7
-
8
- {
9
- /** @type {_.Element} */
10
- const x = ['div', {}, ['<div>&amp;</div>', ['a', { href: 'hello"' }, []]]]
11
- const s = _.htmlToString(x)
12
- if (s !== '<!DOCTYPE html><div>&lt;div&gt;&amp;amp;&lt;/div&gt;<a href="hello&quot;"></a></div>') { throw s }
13
- }
14
-
15
- module.exports = {}
3
+ module.exports = {
4
+ empty: () => {
5
+ const r = _.htmlToString(['html', []])
6
+ if (r !== '<!DOCTYPE html><html></html>') { throw r }
7
+ },
8
+ some: () => {
9
+ /** @type {_.Element} */
10
+ const x = ['div', {}, ['<div>&amp;</div>', ['a', { href: 'hello"' }, []]]]
11
+ const s = _.htmlToString(x)
12
+ if (s !== '<!DOCTYPE html><div>&lt;div&gt;&amp;amp;&lt;/div&gt;<a href="hello&quot;"></a></div>') { throw s }
13
+ }
14
+ }
package/json/test.f.cjs CHANGED
@@ -2,41 +2,45 @@ const json = require('./module.f.cjs')
2
2
  const { sort } = require('../types/object/module.f.cjs')
3
3
  const { identity } = require('../types/function/module.f.cjs')
4
4
 
5
- if (json.setProperty("Hello")([])({}) !== "Hello") { throw 'error' }
6
-
7
- {
8
- const r = json.setProperty("Hello")(['a'])({})
9
- const x = json.stringify(sort)(r)
10
- if (x !== '{"a":"Hello"}') { throw x }
11
- }
12
-
13
- {
14
- const x = json.stringify(identity)(json.setProperty("Hello")(['a'])({}))
15
- if (x !== '{"a":"Hello"}') { throw x }
16
- }
17
-
18
- {
19
- const x = json.stringify(sort)(json.setProperty("Hello")(['a'])({c:[],b:12}))
20
- if (x !== '{"a":"Hello","b":12,"c":[]}') { throw x }
21
- }
22
-
23
- {
24
- const x = json.stringify(identity)(json.setProperty("Hello")(['a'])({ c: [], b: 12 }))
25
- if (x !== '{"c":[],"b":12,"a":"Hello"}') { throw x }
26
- }
27
-
28
- {
29
- const _0 = { a: { y: [24] }, c: [], b: 12 }
30
- const _1 = json.setProperty("Hello")(['a', 'x'])(_0)
31
- const _2 = json.stringify(sort)(_1)
32
- if (_2 !== '{"a":{"x":"Hello","y":[24]},"b":12,"c":[]}') { throw _2 }
5
+ module.exports = {
6
+ setProperty: () => {
7
+ if (json.setProperty("Hello")([])({}) !== "Hello") { throw 'error' }
8
+ },
9
+ stringify: [
10
+ {
11
+ sort: () => {
12
+ const r = json.setProperty("Hello")(['a'])({})
13
+ const x = json.stringify(sort)(r)
14
+ if (x !== '{"a":"Hello"}') { throw x }
15
+ },
16
+ identity: () => {
17
+ const x = json.stringify(identity)(json.setProperty("Hello")(['a'])({}))
18
+ if (x !== '{"a":"Hello"}') { throw x }
19
+ },
20
+ },
21
+ {
22
+ sort: () => {
23
+ const x = json.stringify(sort)(json.setProperty("Hello")(['a'])({ c: [], b: 12 }))
24
+ if (x !== '{"a":"Hello","b":12,"c":[]}') { throw x }
25
+ },
26
+ identity: () => {
27
+ const x = json.stringify(identity)(json.setProperty("Hello")(['a'])({ c: [], b: 12 }))
28
+ if (x !== '{"c":[],"b":12,"a":"Hello"}') { throw x }
29
+ },
30
+ },
31
+ {
32
+ sort: () => {
33
+ const _0 = { a: { y: [24] }, c: [], b: 12 }
34
+ const _1 = json.setProperty("Hello")(['a', 'x'])(_0)
35
+ const _2 = json.stringify(sort)(_1)
36
+ if (_2 !== '{"a":{"x":"Hello","y":[24]},"b":12,"c":[]}') { throw _2 }
37
+ },
38
+ identity: () => {
39
+ const _0 = { a: { y: [24] }, c: [], b: 12 }
40
+ const _1 = json.setProperty("Hello")(['a', 'x'])(_0)
41
+ const _2 = json.stringify(identity)(_1)
42
+ if (_2 !== '{"a":{"y":[24],"x":"Hello"},"c":[],"b":12}') { throw _2 }
43
+ }
44
+ }
45
+ ]
33
46
  }
34
-
35
- {
36
- const _0 = { a: { y: [24] }, c: [], b: 12 }
37
- const _1 = json.setProperty("Hello")(['a', 'x'])(_0)
38
- const _2 = json.stringify(identity)(_1)
39
- if (_2 !== '{"a":{"y":[24],"x":"Hello"},"c":[],"b":12}') { throw _2 }
40
- }
41
-
42
- module.exports = {}