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.
- package/Cargo.lock +7 -0
- package/Cargo.toml +2 -1
- package/com/cpp/test.f.cjs +1 -1
- package/com/cs/test.f.cjs +1 -1
- package/com/rust/module.f.cjs +42 -16
- package/com/rust/test.f.cjs +99 -74
- package/com/types/{test.f.cjs → testlib.f.cjs} +0 -0
- package/commonjs/build/test.f.cjs +2 -4
- package/commonjs/package/dependencies/test.f.cjs +1 -3
- package/commonjs/package/test.f.cjs +1 -5
- package/commonjs/path/test.f.cjs +158 -170
- package/commonjs/test.cjs +52 -61
- package/html/test.f.cjs +12 -13
- package/json/test.f.cjs +41 -37
- package/json/tokenizer/test.f.cjs +238 -296
- package/nodejs/version/test.f.cjs +1 -3
- package/package.json +1 -1
- package/sha2/test.f.cjs +37 -40
- package/test.mjs +51 -19
- package/text/test.f.cjs +1 -3
- package/text/utf16/test.f.cjs +96 -109
- package/text/utf8/test.f.cjs +116 -135
- package/types/array/test.f.cjs +84 -84
- package/types/btree/find/test.f.cjs +2 -2
- package/types/btree/remove/test.f.cjs +6 -3
- package/types/btree/set/test.f.cjs +372 -370
- package/types/btree/test.f.cjs +11 -7
- package/types/byteSet/module.f.cjs +2 -4
- package/types/byteSet/test.f.cjs +37 -40
- package/types/function/compare/module.f.cjs +1 -1
- package/types/function/compare/test.f.cjs +1 -3
- package/types/function/test.f.cjs +1 -3
- package/types/list/test.f.cjs +208 -219
- package/types/map/test.f.cjs +57 -57
- package/types/nibbleSet/test.f.cjs +37 -40
- package/types/number/test.f.cjs +24 -26
- package/types/object/test.f.cjs +12 -13
- package/types/option/test.f.cjs +1 -3
- package/types/range/test.f.cjs +1 -3
package/types/array/test.f.cjs
CHANGED
|
@@ -5,88 +5,88 @@ const { sort } = require('../object/module.f.cjs')
|
|
|
5
5
|
/** @type {(a: readonly json.Unknown[]) => string} */
|
|
6
6
|
const stringify = a => json.stringify(sort)(a)
|
|
7
7
|
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
module.exports = {
|
|
9
|
+
stringify: () => {
|
|
10
|
+
const result = stringify([1, 20, 300])
|
|
11
|
+
if (result !== '[1,20,300]') { throw result }
|
|
12
|
+
},
|
|
13
|
+
at: [
|
|
14
|
+
() => {
|
|
15
|
+
const result = _.at(2)([1, 20, 300])
|
|
16
|
+
if (result === undefined) { throw result }
|
|
17
|
+
if (result[0] !== 300) { throw result }
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
() => {
|
|
21
|
+
const result = _.at(3)([1, 20, 300])
|
|
22
|
+
if (result !== undefined) { throw result }
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
first: [
|
|
26
|
+
() => {
|
|
27
|
+
const result = _.first([1, 20, 300])
|
|
28
|
+
if (result !== 1) { throw result }
|
|
29
|
+
},
|
|
30
|
+
() => {
|
|
31
|
+
const result = _.first([])
|
|
32
|
+
if (result !== undefined) { throw result }
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
last: [
|
|
36
|
+
() => {
|
|
37
|
+
const result = _.last([1, 20, 300])
|
|
38
|
+
if (result !== 300) { throw result }
|
|
39
|
+
},
|
|
40
|
+
() => {
|
|
41
|
+
const result = _.last([])
|
|
42
|
+
if (result !== undefined) { throw result }
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
head: [
|
|
46
|
+
() => {
|
|
47
|
+
const result = _.head([1, 20, 300])
|
|
48
|
+
if (result === undefined) { throw result }
|
|
49
|
+
const str = stringify(result)
|
|
50
|
+
if (str !== '[1,20]') { throw str }
|
|
51
|
+
},
|
|
52
|
+
() => {
|
|
53
|
+
const result = _.head([])
|
|
54
|
+
if (result !== undefined) { throw result }
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
tail: [
|
|
58
|
+
() => {
|
|
59
|
+
const result = _.tail([1, 20, 300])
|
|
60
|
+
if (result === undefined) { throw result }
|
|
61
|
+
const str = stringify(result)
|
|
62
|
+
if (str !== '[20,300]') { throw str }
|
|
63
|
+
},
|
|
64
|
+
() => {
|
|
65
|
+
const result = _.tail([])
|
|
66
|
+
if (result !== undefined) { throw result }
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
|
|
70
|
+
splitFirst: [
|
|
71
|
+
() => {
|
|
72
|
+
const result = _.splitFirst([1, 20, 300])
|
|
73
|
+
if (result === undefined) { throw result }
|
|
74
|
+
const str = stringify(result)
|
|
75
|
+
if (str !== '[1,[20,300]]') { throw str }
|
|
76
|
+
},
|
|
77
|
+
() => {
|
|
78
|
+
const result = _.splitFirst([])
|
|
79
|
+
if (result !== undefined) { throw result }
|
|
80
|
+
},
|
|
81
|
+
() => {
|
|
82
|
+
const result = _.splitLast([1, 20, 300])
|
|
83
|
+
if (result === undefined) { throw result }
|
|
84
|
+
const str = stringify(result)
|
|
85
|
+
if (str !== '[[1,20],300]') { throw str }
|
|
86
|
+
},
|
|
87
|
+
() => {
|
|
88
|
+
const result = _.splitLast([])
|
|
89
|
+
if (result !== undefined) { throw result }
|
|
90
|
+
}
|
|
91
|
+
]
|
|
11
92
|
}
|
|
12
|
-
|
|
13
|
-
{
|
|
14
|
-
const result = _.at(2)([1, 20, 300])
|
|
15
|
-
if (result === undefined) {throw result}
|
|
16
|
-
if (result[0] !== 300) { throw result }
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
{
|
|
20
|
-
const result = _.at(3)([1, 20, 300])
|
|
21
|
-
if (result !== undefined) {throw result}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
{
|
|
25
|
-
const result = _.first([1, 20, 300])
|
|
26
|
-
if (result !== 1) { throw result }
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
{
|
|
30
|
-
const result = _.first([])
|
|
31
|
-
if (result !== undefined) {throw result}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
const result = _.last([1, 20, 300])
|
|
36
|
-
if (result !== 300) { throw result }
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
{
|
|
40
|
-
const result = _.last([])
|
|
41
|
-
if (result !== undefined) {throw result}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
const result = _.head([1, 20, 300])
|
|
46
|
-
if (result === undefined) {throw result}
|
|
47
|
-
const str = stringify(result)
|
|
48
|
-
if (str !== '[1,20]') { throw str }
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
{
|
|
52
|
-
const result = _.head([])
|
|
53
|
-
if (result !== undefined) {throw result}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
const result = _.tail([1, 20, 300])
|
|
58
|
-
if (result === undefined) {throw result}
|
|
59
|
-
const str = stringify(result)
|
|
60
|
-
if (str !== '[20,300]') { throw str }
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
{
|
|
64
|
-
const result = _.tail([])
|
|
65
|
-
if (result !== undefined) {throw result}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
{
|
|
69
|
-
const result = _.splitFirst([1, 20, 300])
|
|
70
|
-
if (result === undefined) {throw result}
|
|
71
|
-
const str = stringify(result)
|
|
72
|
-
if (str !== '[1,[20,300]]') { throw str }
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
{
|
|
76
|
-
const result = _.splitFirst([])
|
|
77
|
-
if (result !== undefined) {throw result}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
{
|
|
81
|
-
const result = _.splitLast([1, 20, 300])
|
|
82
|
-
if (result === undefined) {throw result}
|
|
83
|
-
const str = stringify(result)
|
|
84
|
-
if (str !== '[[1,20],300]') { throw str }
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
{
|
|
88
|
-
const result = _.splitLast([])
|
|
89
|
-
if (result !== undefined) {throw result}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
module.exports = {}
|
|
@@ -17,7 +17,7 @@ const str = r => jsonStr(list.toArray(list.map(x => x[0])(r)))
|
|
|
17
17
|
/** @type {(i: string) => (m: btree.Node<string>) => string} */
|
|
18
18
|
const find = i => m => str(_.find(cmp(i))(m))
|
|
19
19
|
|
|
20
|
-
{
|
|
20
|
+
const test = () => {
|
|
21
21
|
/** @type {btree.Node<string>} */
|
|
22
22
|
let _map = ['1']
|
|
23
23
|
for (let i = 2; i <= 10; i++)
|
|
@@ -113,4 +113,4 @@ const find = i => m => str(_.find(cmp(i))(m))
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
module.exports =
|
|
116
|
+
module.exports = test
|
|
@@ -13,7 +13,7 @@ const remove = node => value => _.nodeRemove(cmp(value))(node)
|
|
|
13
13
|
|
|
14
14
|
const jsonStr = json.stringify(sort)
|
|
15
15
|
|
|
16
|
-
{
|
|
16
|
+
const test = () => {
|
|
17
17
|
/** @type {btree.Node<string> | undefined} */
|
|
18
18
|
let _map = ['1']
|
|
19
19
|
for (let i = 2; i <= 38; i++)
|
|
@@ -408,7 +408,7 @@ const jsonStr = json.stringify(sort)
|
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
|
|
411
|
-
{
|
|
411
|
+
const test2 = () => {
|
|
412
412
|
/** @type {btree.Node<string>|undefined} */
|
|
413
413
|
let _map = ['1']
|
|
414
414
|
for (let i = 2; i <= 10; i++)
|
|
@@ -486,4 +486,7 @@ const jsonStr = json.stringify(sort)
|
|
|
486
486
|
}
|
|
487
487
|
}
|
|
488
488
|
|
|
489
|
-
module.exports = {
|
|
489
|
+
module.exports = {
|
|
490
|
+
test,
|
|
491
|
+
test2,
|
|
492
|
+
}
|