functionalscript 0.0.485 → 0.0.487
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/com/rust/module.f.cjs +13 -9
- package/com/types/module.f.cjs +1 -4
- package/commonjs/module.f.cjs +2 -2
- package/fsc/test.f.cjs +0 -1
- package/package.json +1 -1
- package/types/array/module.f.cjs +1 -1
- package/types/list/module.f.cjs +4 -4
package/com/rust/module.f.cjs
CHANGED
|
@@ -51,22 +51,26 @@ const this_ = ['this: &Object']
|
|
|
51
51
|
const rustType = n => `pub type ${n} = nanocom::${n}<Interface>;`
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
* @
|
|
55
|
-
*
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
* @template T
|
|
55
|
+
* @typedef {T|{}} OptionalProperty
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
/** @typedef {{readonly where: readonly string[]}} Where */
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @typedef {OptionalProperty<Where> & {readonly content: text.Block}} WhereContent
|
|
58
62
|
*/
|
|
59
63
|
|
|
60
64
|
/** @type {(h: string) => (wh: WhereContent) => text.Block} */
|
|
61
|
-
const whereContent = h =>
|
|
62
|
-
const w =
|
|
65
|
+
const whereContent = h => wh => {
|
|
66
|
+
const w = 'where' in wh ? [
|
|
63
67
|
h,
|
|
64
68
|
`where`,
|
|
65
|
-
mapComma(where),
|
|
69
|
+
mapComma(wh.where),
|
|
66
70
|
'{'
|
|
67
|
-
]
|
|
71
|
+
]: [`${h} {`]
|
|
68
72
|
const x = [
|
|
69
|
-
content,
|
|
73
|
+
wh.content,
|
|
70
74
|
'}',
|
|
71
75
|
]
|
|
72
76
|
return flat([w, x])
|
package/com/types/module.f.cjs
CHANGED
|
@@ -62,10 +62,7 @@ const filterParam = filter(isParam)
|
|
|
62
62
|
const paramList = compose(entries)(filterParam)
|
|
63
63
|
|
|
64
64
|
/** @type {<T>(v: T) => (f: (type: Type) => T) => (fa: FieldArray) => T} */
|
|
65
|
-
const result = v => f => fa =>
|
|
66
|
-
const type = fa._
|
|
67
|
-
return type === undefined ? v : f(type)
|
|
68
|
-
}
|
|
65
|
+
const result = v => f => fa => '_' in fa ? f(fa._) : v
|
|
69
66
|
|
|
70
67
|
module.exports = {
|
|
71
68
|
/** @readonly */
|
package/commonjs/module.f.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/** @typedef {(packageName: string) => PackageMap|Package|
|
|
1
|
+
/** @typedef {(packageName: string) => PackageMap|Package|null} PackageMap */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @typedef {readonly[
|
|
5
5
|
* string,
|
|
6
6
|
* PackageMap,
|
|
7
|
-
* (fileName: string) => string|
|
|
7
|
+
* (fileName: string) => string|null
|
|
8
8
|
* ]} Package
|
|
9
9
|
*/
|
|
10
10
|
|
package/fsc/test.f.cjs
CHANGED
package/package.json
CHANGED
package/types/array/module.f.cjs
CHANGED
|
@@ -85,7 +85,7 @@ const uncheckTail = a => a.slice(1)
|
|
|
85
85
|
const uncheckHead = a => a.slice(0, -1)
|
|
86
86
|
|
|
87
87
|
/** @type {<T>(a: T|undefined) => T|null} */
|
|
88
|
-
const undefinedToNull = a => a ===
|
|
88
|
+
const undefinedToNull = a => a === void 0 ? null : a
|
|
89
89
|
|
|
90
90
|
/** @type {<T>(_: readonly T[]) => T|null} */
|
|
91
91
|
const first = a => undefinedToNull(a[0])
|
package/types/list/module.f.cjs
CHANGED
|
@@ -23,9 +23,11 @@ const {
|
|
|
23
23
|
* } NotLazy
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
+
/** @typedef {undefined} Empty */
|
|
27
|
+
|
|
26
28
|
/**
|
|
27
29
|
* @template T
|
|
28
|
-
* @typedef {
|
|
30
|
+
* @typedef {Empty | NonEmpty<T>} Result
|
|
29
31
|
*/
|
|
30
32
|
|
|
31
33
|
/**
|
|
@@ -36,7 +38,6 @@ const {
|
|
|
36
38
|
/**
|
|
37
39
|
* @template T
|
|
38
40
|
* @typedef {{
|
|
39
|
-
* readonly isConcat?: undefined
|
|
40
41
|
* readonly first: T
|
|
41
42
|
* readonly tail: List<T>
|
|
42
43
|
* }} NonEmpty
|
|
@@ -45,7 +46,6 @@ const {
|
|
|
45
46
|
/**
|
|
46
47
|
* @template T
|
|
47
48
|
* @typedef {{
|
|
48
|
-
* readonly isConcat: true
|
|
49
49
|
* readonly a: List<T>
|
|
50
50
|
* readonly b: List<T>
|
|
51
51
|
* }} Concat
|
|
@@ -78,7 +78,7 @@ const next = list => {
|
|
|
78
78
|
|
|
79
79
|
if (a instanceof Array) {
|
|
80
80
|
a = fromArray(a)
|
|
81
|
-
} else if (a
|
|
81
|
+
} else if (a !== undefined && 'a' in a) {
|
|
82
82
|
[a, b] = [a.a, concat(a.b)(b)]
|
|
83
83
|
continue
|
|
84
84
|
}
|