functionalscript 0.1.596 → 0.1.598

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 (61) hide show
  1. package/README.md +0 -2
  2. package/com/cpp/module.f.d.mts +4 -4
  3. package/com/cpp/module.f.mjs +18 -18
  4. package/com/cs/module.f.mjs +1 -1
  5. package/com/rust/module.f.d.mts +7 -7
  6. package/com/rust/module.f.mjs +30 -30
  7. package/com/test/build.mjs +2 -2
  8. package/com/types/module.f.mjs +1 -1
  9. package/commonjs/module/module.f.mjs +1 -1
  10. package/commonjs/package/dependencies/module.f.d.mts +3 -3
  11. package/commonjs/package/dependencies/module.f.mjs +3 -3
  12. package/commonjs/package/module.f.d.mts +6 -6
  13. package/commonjs/package/module.f.mjs +4 -4
  14. package/commonjs/path/module.f.d.mts +7 -7
  15. package/commonjs/path/module.f.mjs +5 -5
  16. package/commonjs/path/test.f.mjs +7 -7
  17. package/commonjs/test.mjs +2 -2
  18. package/djs/module.f.mjs +1 -1
  19. package/djs/tokenizer/module.f.mjs +1 -1
  20. package/djs/tokenizer/test.f.mjs +1 -1
  21. package/html/module.f.mjs +1 -1
  22. package/js/tokenizer/test.f.mjs +3 -3
  23. package/json/parser/module.f.d.mts +3 -3
  24. package/json/parser/module.f.mjs +12 -12
  25. package/json/parser/test.f.mjs +2 -2
  26. package/json/serializer/module.f.mjs +2 -2
  27. package/json/tokenizer/module.f.d.mts +3 -3
  28. package/json/tokenizer/module.f.mjs +7 -7
  29. package/json/tokenizer/test.f.mjs +3 -3
  30. package/jsr.json +1 -1
  31. package/package.json +1 -1
  32. package/secp/module.f.d.mts +8 -8
  33. package/secp/module.f.mjs +6 -6
  34. package/secp/test.f.mjs +5 -5
  35. package/sha2/module.f.mjs +1 -1
  36. package/sha2/test.f.mjs +0 -1
  37. package/text/utf16/test.f.mjs +2 -2
  38. package/text/utf8/module.f.d.mts +2 -2
  39. package/text/utf8/module.f.mjs +2 -2
  40. package/types/bigint/module.f.d.mts +8 -8
  41. package/types/bigint/module.f.mjs +5 -5
  42. package/types/btree/find/module.f.mjs +4 -4
  43. package/types/btree/find/test.f.mjs +2 -2
  44. package/types/btree/remove/module.f.d.mts +7 -7
  45. package/types/btree/remove/module.f.mjs +12 -12
  46. package/types/btree/remove/test.f.mjs +5 -5
  47. package/types/btree/set/module.f.d.mts +3 -3
  48. package/types/btree/set/module.f.mjs +6 -6
  49. package/types/btree/set/test.f.mjs +32 -32
  50. package/types/btree/test.f.mjs +7 -11
  51. package/types/byte_set/module.f.mjs +2 -2
  52. package/types/byte_set/test.f.mjs +3 -3
  53. package/types/function/compare/module.f.d.mts +7 -7
  54. package/types/function/compare/module.f.mjs +4 -4
  55. package/types/map/module.f.d.mts +2 -2
  56. package/types/map/module.f.mjs +4 -4
  57. package/types/range_map/module.f.d.mts +2 -2
  58. package/types/range_map/module.f.mjs +5 -5
  59. package/types/range_map/test.f.mjs +2 -2
  60. package/types/sorted_list/test.f.mjs +2 -2
  61. package/types/sorted_set/test.f.mjs +1 -1
package/README.md CHANGED
@@ -14,8 +14,6 @@ FunctionalScript is a purely functional programming language and a strict subset
14
14
 
15
15
  [A brief description of FunctionalScript Programming Language](./doc/LANGUAGE.md).
16
16
 
17
- Create a new FunctionalScript repository on GitHub [here](https://github.com/functionalscript/template/generate).
18
-
19
17
  Learn more about
20
18
  - [Purely Functional Programming in JavaScript](https://medium.com/@sergeyshandar/purely-functional-programming-in-javascript-91114b1b2dff),
21
19
  - [FunctionalScript](https://medium.com/@sergeyshandar/functionalscript-5cf817345376).
@@ -2,7 +2,7 @@ declare namespace _default {
2
2
  export { cpp };
3
3
  }
4
4
  export default _default;
5
- /** @type {(name: string) => (lib: typesT.Library) => textT.Block} */
6
- declare const cpp: (name: string) => (lib: typesT.Library) => textT.Block;
7
- import * as typesT from '../types/module.f.mjs';
8
- import * as textT from '../../text/module.f.mjs';
5
+ /** @type {(name: string) => (lib: Types.Library) => Text.Block} */
6
+ declare const cpp: (name: string) => (lib: Types.Library) => Text.Block;
7
+ import * as Types from '../types/module.f.mjs';
8
+ import * as Text from '../../text/module.f.mjs';
@@ -1,6 +1,6 @@
1
- import types, * as typesT from '../types/module.f.mjs'
2
- import text, * as textT from '../../text/module.f.mjs'
3
- import obj, * as O from '../../types/object/module.f.mjs'
1
+ import types, * as Types from '../types/module.f.mjs'
2
+ import text, * as Text from '../../text/module.f.mjs'
3
+ import * as O from '../../types/object/module.f.mjs'
4
4
  import list from '../../types/list/module.f.mjs'
5
5
  import string from '../../types/string/module.f.mjs'
6
6
  const { join } = string
@@ -8,7 +8,7 @@ const { paramList } = types
8
8
  const { map, flatMap, flat } = list
9
9
  const { entries } = Object
10
10
 
11
- /** @type {(name: string) => (body: textT.Block) => textT.Block} */
11
+ /** @type {(name: string) => (body: Text.Block) => Text.Block} */
12
12
  const struct = name => body => [`struct ${name}`, '{', body, '};']
13
13
 
14
14
  const baseTypeMap = {
@@ -27,7 +27,7 @@ const baseTypeMap = {
27
27
  bool: 'bool',
28
28
  }
29
29
 
30
- /** @type {(t: typesT.BaseType) => string} */
30
+ /** @type {(t: Types.BaseType) => string} */
31
31
  const baseType = t => baseTypeMap[t]
32
32
 
33
33
  const resultVoid = types.result('void')
@@ -43,17 +43,17 @@ const ptr = id => `${id} const*`
43
43
  /** @type {(id: string) => string} */
44
44
  const ref = id => `${id} const&`
45
45
 
46
- /** @type {(p: typesT.Field) => string} */
46
+ /** @type {(p: Types.Field) => string} */
47
47
  const paramName = ([name]) => name
48
48
 
49
49
  const mapParamName = map(paramName)
50
50
 
51
51
  const joinComma = join(', ')
52
52
 
53
- /** @type {(name: string) => (lib: typesT.Library) => textT.Block} */
53
+ /** @type {(name: string) => (lib: Types.Library) => Text.Block} */
54
54
  const cpp = name => lib => {
55
55
 
56
- /** @type {(t: typesT.Type) => string|null} */
56
+ /** @type {(t: Types.Type) => string|null} */
57
57
  const interface_ = t => {
58
58
  if (!(t instanceof Array) || t.length !== 1) {
59
59
  return null
@@ -62,7 +62,7 @@ const cpp = name => lib => {
62
62
  return 'interface' in lib[name] ? name : null
63
63
  }
64
64
 
65
- /** @type {(i: (t: string) => string) => (t: typesT.Type) => string} */
65
+ /** @type {(i: (t: string) => string) => (t: Types.Type) => string} */
66
66
  const objectType = i => t => {
67
67
  if (typeof (t) === 'string') { return baseType(t) }
68
68
  if (t.length === 2) { return `${type(t[1])} const*` }
@@ -74,27 +74,27 @@ const cpp = name => lib => {
74
74
 
75
75
  const resultType = objectType(ptr)
76
76
 
77
- /** @type {(s: typesT.Field) => textT.Item} */
77
+ /** @type {(s: Types.Field) => Text.Item} */
78
78
  const field = ([name, t]) => `${type(t)} ${name};`
79
79
 
80
80
  const mapField = map(field)
81
81
 
82
- /** @type {(s: typesT.Struct) => textT.Block} */
82
+ /** @type {(s: Types.Struct) => Text.Block} */
83
83
  const defStruct = s => mapField(entries(s.struct))
84
84
 
85
- /** @type {(fa: typesT.FieldArray) => string} */
85
+ /** @type {(fa: Types.FieldArray) => string} */
86
86
  const cppResult = resultVoid(resultType)
87
87
 
88
- /** @type {(p: typesT.Field) => string} */
88
+ /** @type {(p: Types.Field) => string} */
89
89
  const param = ([name, t]) => `${objectType(ref)(t)} ${name}`
90
90
 
91
91
  const mapParam = map(param)
92
92
 
93
- /** @type {(result: string) => (paramArrayStr: string) => (name: string) => textT.Item} */
93
+ /** @type {(result: string) => (paramArrayStr: string) => (name: string) => Text.Item} */
94
94
  const methodHeader = result => paramArrayStr => name =>
95
95
  `virtual ${result} ${name}${paramArrayStr} const noexcept = 0;`
96
96
 
97
- /** @type {(m: typesT.Method) => readonly textT.Item[]} */
97
+ /** @type {(m: Types.Method) => readonly Text.Item[]} */
98
98
  const method = ([name, paramArray]) => {
99
99
  const result = cppResult(paramArray)
100
100
  const paramL = paramList(paramArray)
@@ -115,7 +115,7 @@ const cpp = name => lib => {
115
115
 
116
116
  const mapMethod = flatMap(method)
117
117
 
118
- /** @type {(i: typesT.Interface) => textT.Block} */
118
+ /** @type {(i: Types.Interface) => Text.Block} */
119
119
  const defInterface = ({ guid, interface: i }) => {
120
120
  const g = guid.replaceAll('-', '');
121
121
  const lo = g.substring(0, 16);
@@ -126,7 +126,7 @@ const cpp = name => lib => {
126
126
  ])
127
127
  }
128
128
 
129
- /** @type {(kv: O.Entry<typesT.Definition>) => textT.Block} */
129
+ /** @type {(kv: O.Entry<Types.Definition>) => Text.Block} */
130
130
  const def = ([name, d]) => 'interface' in d
131
131
  ? [
132
132
  `class ${name} : public ::nanocom::IUnknown`,
@@ -137,7 +137,7 @@ const cpp = name => lib => {
137
137
  ]
138
138
  : struct(name)(defStruct(d))
139
139
 
140
- /** @type {(kv: O.Entry<typesT.Definition>) => textT.Block} */
140
+ /** @type {(kv: O.Entry<Types.Definition>) => Text.Block} */
141
141
  const forward = ([name]) => [`struct ${name};`]
142
142
 
143
143
  const e = entries(lib)
@@ -6,7 +6,7 @@ import list, * as List from '../../types/list/module.f.mjs'
6
6
  const { flat, map, some, flatMap } = list
7
7
  import string from '../../types/string/module.f.mjs'
8
8
  const { join } = string
9
- import obj, * as O from '../../types/object/module.f.mjs'
9
+ import * as O from '../../types/object/module.f.mjs'
10
10
  const { entries } = Object
11
11
 
12
12
  /** @type {(v: string) => string} */
@@ -7,22 +7,22 @@ export type Where = {
7
7
  readonly where: readonly string[];
8
8
  };
9
9
  export type WhereContent = OptionalProperty<Where> & {
10
- readonly content: textT.Block;
10
+ readonly content: Text.Block;
11
11
  };
12
12
  export type Impl = {
13
13
  readonly param?: string;
14
14
  readonly trait: string;
15
15
  readonly type: string;
16
16
  readonly where?: readonly string[];
17
- readonly content: textT.Block;
17
+ readonly content: Text.Block;
18
18
  };
19
19
  export type Trait = {
20
20
  readonly pub?: true;
21
21
  readonly type: string;
22
22
  readonly where?: readonly string[];
23
- readonly content: textT.Block;
23
+ readonly content: Text.Block;
24
24
  };
25
- /** @type {(library: typesT.Library) => textT.Block} */
26
- declare const rust: (library: typesT.Library) => textT.Block;
27
- import * as textT from '../../text/module.f.mjs';
28
- import * as typesT from '../types/module.f.mjs';
25
+ /** @type {(library: Types.Library) => Text.Block} */
26
+ declare const rust: (library: Types.Library) => Text.Block;
27
+ import * as Text from '../../text/module.f.mjs';
28
+ import * as Types from '../types/module.f.mjs';
@@ -1,7 +1,7 @@
1
- import types, * as typesT from '../types/module.f.mjs'
1
+ import types, * as Types from '../types/module.f.mjs'
2
2
  const { paramList } = types
3
- import text, * as textT from '../../text/module.f.mjs'
4
- import object, * as O from '../../types/object/module.f.mjs'
3
+ import * as Text from '../../text/module.f.mjs'
4
+ import * as O from '../../types/object/module.f.mjs'
5
5
  import list, * as List from '../../types/list/module.f.mjs'
6
6
  const { flat, map, flatMap } = list
7
7
  const { entries } = Object
@@ -15,7 +15,7 @@ const rustField = field => `pub ${field},`
15
15
 
16
16
  const mapRustField = map(rustField)
17
17
 
18
- /** @type {(b: List.Thunk<string>) => (name: string) => textT.Block} */
18
+ /** @type {(b: List.Thunk<string>) => (name: string) => Text.Block} */
19
19
  const rustStruct = b => name => [`#[repr(C)]`, `pub struct ${name} {`, mapRustField(b), `}`]
20
20
 
21
21
  const commaJoin = join(', ')
@@ -28,21 +28,21 @@ const obj = name => `&${name}::Object`
28
28
 
29
29
  const self = ['&self']
30
30
 
31
- /** @type {(p: typesT.Field) => string} */
31
+ /** @type {(p: Types.Field) => string} */
32
32
  const paramName = ([n]) => n
33
33
 
34
- /** @type {(p: typesT.FieldArray) => List.Thunk<string>} */
34
+ /** @type {(p: Types.FieldArray) => List.Thunk<string>} */
35
35
  const callList = p => map(paramName)(paramList(p))
36
36
 
37
- /** @type {(p: typesT.FieldArray) => string} */
37
+ /** @type {(p: Types.FieldArray) => string} */
38
38
  const call = p => commaJoin(callList(p))
39
39
 
40
- /** @type {(p: typesT.FieldArray) => string} */
40
+ /** @type {(p: Types.FieldArray) => string} */
41
41
  const virtualCall = p => commaJoin(flat([['self'], callList(p)]))
42
42
 
43
43
  const super_ = 'super::'
44
44
 
45
- /** @type {(m: typesT.Method) => string} */
45
+ /** @type {(m: Types.Method) => string} */
46
46
  const assign = ([n]) => `${n}: Self::${n},`
47
47
 
48
48
  const mapAssign = map(assign)
@@ -60,10 +60,10 @@ const rustType = n => `pub type ${n} = nanocom::${n}<Interface>;`
60
60
  /** @typedef {{readonly where: readonly string[]}} Where */
61
61
 
62
62
  /**
63
- * @typedef {OptionalProperty<Where> & {readonly content: textT.Block}} WhereContent
63
+ * @typedef {OptionalProperty<Where> & {readonly content: Text.Block}} WhereContent
64
64
  */
65
65
 
66
- /** @type {(h: string) => (wh: WhereContent) => textT.Block} */
66
+ /** @type {(h: string) => (wh: WhereContent) => Text.Block} */
67
67
  const whereContent = h => wh => {
68
68
  const w = 'where' in wh ? [
69
69
  h,
@@ -84,11 +84,11 @@ const whereContent = h => wh => {
84
84
  * readonly trait: string
85
85
  * readonly type: string
86
86
  * readonly where?: readonly string[]
87
- * readonly content: textT.Block
87
+ * readonly content: Text.Block
88
88
  * }} Impl
89
89
  */
90
90
 
91
- /** @type {(impl: Impl) => textT.Block} */
91
+ /** @type {(impl: Impl) => Text.Block} */
92
92
  const rustImpl = i => {
93
93
  const p = 'param' in i ? `<${i.param}>` : ''
94
94
  const header = `impl${p} ${i.trait} for ${i.type}`
@@ -100,7 +100,7 @@ const rustImpl = i => {
100
100
  * readonly pub?: true
101
101
  * readonly type: string
102
102
  * readonly where?: readonly string[]
103
- * readonly content: textT.Block
103
+ * readonly content: Text.Block
104
104
  * }} Trait
105
105
  */
106
106
 
@@ -109,14 +109,14 @@ const comma = s => `${s},`
109
109
 
110
110
  const mapComma = map(comma)
111
111
 
112
- /** @type {(t: Trait) => textT.Block} */
112
+ /** @type {(t: Trait) => Text.Block} */
113
113
  const trait = t => {
114
114
  const p = t.pub === true ? 'pub ' : ''
115
115
  const h = `${p}trait ${t.type}`
116
116
  return whereContent(h)(t)
117
117
  }
118
118
 
119
- /** @type {(t: Trait) => textT.Block} */
119
+ /** @type {(t: Trait) => Text.Block} */
120
120
  const traitImpl = t => {
121
121
  const i = rustImpl({
122
122
  param: 'T',
@@ -130,12 +130,12 @@ const traitImpl = t => {
130
130
 
131
131
  const where = ['Self: nanocom::Class<Interface = Interface>', 'nanocom::CObject<Self>: Ex']
132
132
 
133
- /** @type {(library: typesT.Library) => textT.Block} */
133
+ /** @type {(library: Types.Library) => Text.Block} */
134
134
  const rust = library => {
135
135
 
136
- /** @type {(p: string) => (o: (_: string) => string) => (t: typesT.Type) => string} */
136
+ /** @type {(p: string) => (o: (_: string) => string) => (t: Types.Type) => string} */
137
137
  const type = p => {
138
- /** @type {(o: (_: string) => string) => (t: typesT.Type) => string} */
138
+ /** @type {(o: (_: string) => string) => (t: Types.Type) => string} */
139
139
  const f = o => t => {
140
140
  if (typeof t === 'string') { return t }
141
141
  if (t.length === 2) { return `*const ${f(ref)(t[1])}` }
@@ -146,7 +146,7 @@ const rust = library => {
146
146
  return f
147
147
  }
148
148
 
149
- /** @type {(p: string) => (o: (_: string) => string) => (f: typesT.Field) => string} */
149
+ /** @type {(p: string) => (o: (_: string) => string) => (f: Types.Field) => string} */
150
150
  const pf = p => o => ([name, t]) => `${name}: ${type(p)(o)(t)}`
151
151
 
152
152
  const param = pf(super_)(obj)
@@ -155,36 +155,36 @@ const rust = library => {
155
155
 
156
156
  const mapField = map(pf('')(ref))
157
157
 
158
- /** @type {(fa: typesT.FieldArray) => (name: string) => textT.Block} */
158
+ /** @type {(fa: Types.FieldArray) => (name: string) => Text.Block} */
159
159
  const struct = fn(entries)
160
160
  .then(mapField)
161
161
  .then(rustStruct)
162
162
  .result
163
163
 
164
- /** @type {(first: readonly string[]) => (p: typesT.FieldArray) => string} */
164
+ /** @type {(first: readonly string[]) => (p: Types.FieldArray) => string} */
165
165
  const func = first => p => {
166
166
  const resultStr = '_' in p ? ` -> ${type(super_)(ref)(p._)}` : ''
167
167
  const params = commaJoin(flat([first, mapParam(paramList(p))]))
168
168
  return `(${params})${resultStr}`
169
169
  }
170
170
 
171
- /** @type {(n: string) => (p: typesT.FieldArray) => string} */
171
+ /** @type {(n: string) => (p: Types.FieldArray) => string} */
172
172
  const virtualFnType = n => p => `extern "system" fn${n}${func(this_)(p)}`
173
173
 
174
- /** @type {(m: typesT.Method) => string} */
174
+ /** @type {(m: Types.Method) => string} */
175
175
  const virtualFn = ([n, p]) => `${n}: unsafe ${virtualFnType('')(p)}`
176
176
 
177
177
  const mapVirtualFn = map(virtualFn)
178
178
 
179
- /** @type {(m: typesT.Method) => string} */
179
+ /** @type {(m: Types.Method) => string} */
180
180
  const headerFn = ([n, p]) => `fn ${n}${func(self)(p)}`
181
181
 
182
- /** @type {(m: typesT.Method) => string} */
182
+ /** @type {(m: Types.Method) => string} */
183
183
  const traitFn = m => `${headerFn(m)};`
184
184
 
185
185
  const mapTraitFn = map(traitFn)
186
186
 
187
- /** @type {(m: typesT.Method) => textT.Block} */
187
+ /** @type {(m: Types.Method) => Text.Block} */
188
188
  const implFn = m => {
189
189
  const [n, p] = m
190
190
  return [
@@ -196,7 +196,7 @@ const rust = library => {
196
196
 
197
197
  const flatMapImplFn = flatMap(implFn)
198
198
 
199
- /** @type {(m: typesT.Method) => textT.Block} */
199
+ /** @type {(m: Types.Method) => Text.Block} */
200
200
  const impl = ([n, p]) => {
201
201
  const type = virtualFnType(` ${n}`)(p)
202
202
  return [
@@ -208,7 +208,7 @@ const rust = library => {
208
208
 
209
209
  const flatMapImpl = flatMap(impl)
210
210
 
211
- /** @type {(i: typesT.Interface) => (name: string) => textT.Block} */
211
+ /** @type {(i: Types.Interface) => (name: string) => Text.Block} */
212
212
  const interface_ = ({ interface: i, guid }) => name => {
213
213
 
214
214
  const e = entries(i)
@@ -252,7 +252,7 @@ const rust = library => {
252
252
  ]
253
253
  }
254
254
 
255
- /** @type {(type: O.Entry<typesT.Definition>) => textT.Block} */
255
+ /** @type {(type: O.Entry<Types.Definition>) => Text.Block} */
256
256
  const def = ([name, type]) => ('interface' in type ? interface_(type) : struct(type.struct))(name)
257
257
 
258
258
  return flat([['#![allow(non_snake_case)]'], flatMap(def)(entries(library))])
@@ -1,7 +1,7 @@
1
1
  import { writeFileSync } from 'node:fs'
2
2
  import { execSync } from 'node:child_process'
3
3
  import { platform, exit } from 'node:process'
4
- import build, * as buildT from './build.f.mjs'
4
+ import build, * as Build from './build.f.mjs'
5
5
  const { cpp, cs, rust } = build
6
6
  import string from '../../types/string/module.f.mjs'
7
7
  const { join } = string
@@ -21,7 +21,7 @@ const nodeJs = {
21
21
  platform,
22
22
  }
23
23
 
24
- /** @type {(f: buildT.Func) => void} */
24
+ /** @type {(f: Build.Func) => void} */
25
25
  const run = f => {
26
26
  const { file: { name, content }, line } = f(nodeJs)
27
27
  log(`${bold}writing: ${name}${reset}`)
@@ -1,4 +1,4 @@
1
- import obj, * as O from '../../types/object/module.f.mjs'
1
+ import * as O from '../../types/object/module.f.mjs'
2
2
  import list, * as List from '../../types/list/module.f.mjs'
3
3
  import f from '../../types/function/module.f.mjs'
4
4
  const { compose } = f
@@ -1,4 +1,4 @@
1
- import object, * as O from '../../types/object/module.f.mjs'
1
+ import * as O from '../../types/object/module.f.mjs'
2
2
 
3
3
  /**
4
4
  * @template M
@@ -5,6 +5,6 @@ export default _default;
5
5
  export type DependencyJson = readonly [string, string];
6
6
  export type DependencyMapJson = { readonly [k in string]: string; };
7
7
  export type DependenciesJson = DependencyMapJson | null;
8
- /** @type {(j: jsonT.Unknown) => j is DependenciesJson} */
9
- declare const isDependenciesJson: (j: jsonT.Unknown) => j is DependenciesJson;
10
- import * as jsonT from '../../../json/module.f.mjs';
8
+ /** @type {(j: Json.Unknown) => j is DependenciesJson} */
9
+ declare const isDependenciesJson: (j: Json.Unknown) => j is DependenciesJson;
10
+ import * as Json from '../../../json/module.f.mjs';
@@ -1,4 +1,4 @@
1
- import json, * as jsonT from '../../../json/module.f.mjs'
1
+ import json, * as Json from '../../../json/module.f.mjs'
2
2
  const { isObject } = json
3
3
  import list from '../../../types/list/module.f.mjs'
4
4
  const { map, every } = list
@@ -10,10 +10,10 @@ const { entries } = Object
10
10
 
11
11
  /** @typedef {DependencyMapJson|null} DependenciesJson */
12
12
 
13
- /** @type {(entry: jsonT.Entry) => boolean} */
13
+ /** @type {(entry: Json.Entry) => boolean} */
14
14
  const isDependencyJson = ([, v]) => typeof v === 'string'
15
15
 
16
- /** @type {(j: jsonT.Unknown) => j is DependenciesJson} */
16
+ /** @type {(j: Json.Unknown) => j is DependenciesJson} */
17
17
  const isDependenciesJson = j => {
18
18
  if (j === null) { return true }
19
19
  if (!isObject(j)) { return false }
@@ -6,7 +6,7 @@ export default _default;
6
6
  export type PackageJson = {
7
7
  readonly name: string;
8
8
  readonly version: string;
9
- readonly dependencies?: dependenciesT.DependenciesJson;
9
+ readonly dependencies?: Dependencies.DependenciesJson;
10
10
  };
11
11
  export type Package = {
12
12
  readonly dependency: (localPackageId: string) => string | null;
@@ -18,10 +18,10 @@ import dependencies from './dependencies/module.f.mjs';
18
18
  * @typedef {{
19
19
  * readonly name: string
20
20
  * readonly version: string
21
- * readonly dependencies?: dependenciesT.DependenciesJson
21
+ * readonly dependencies?: Dependencies.DependenciesJson
22
22
  * }} PackageJson
23
23
  */
24
- /** @type {(j: jsonT.Unknown) => j is PackageJson} */
25
- declare const isPackageJson: (j: jsonT.Unknown) => j is PackageJson;
26
- import * as dependenciesT from './dependencies/module.f.mjs';
27
- import * as jsonT from '../../json/module.f.mjs';
24
+ /** @type {(j: Json.Unknown) => j is PackageJson} */
25
+ declare const isPackageJson: (j: Json.Unknown) => j is PackageJson;
26
+ import * as Dependencies from './dependencies/module.f.mjs';
27
+ import * as Json from '../../json/module.f.mjs';
@@ -1,6 +1,6 @@
1
- import json, * as jsonT from '../../json/module.f.mjs'
1
+ import json, * as Json from '../../json/module.f.mjs'
2
2
  const { isObject } = json
3
- import dependencies, * as dependenciesT from './dependencies/module.f.mjs'
3
+ import dependencies, * as Dependencies from './dependencies/module.f.mjs'
4
4
  const { isDependenciesJson } = dependencies
5
5
  import o from '../../types/object/module.f.mjs'
6
6
  const { at } = o
@@ -9,11 +9,11 @@ const { at } = o
9
9
  * @typedef {{
10
10
  * readonly name: string
11
11
  * readonly version: string
12
- * readonly dependencies?: dependenciesT.DependenciesJson
12
+ * readonly dependencies?: Dependencies.DependenciesJson
13
13
  * }} PackageJson
14
14
  */
15
15
 
16
- /** @type {(j: jsonT.Unknown) => j is PackageJson} */
16
+ /** @type {(j: Json.Unknown) => j is PackageJson} */
17
17
  const isPackageJson = j => {
18
18
  if (!isObject(j)) { return false }
19
19
  if (typeof j.name !== 'string') { return false }
@@ -19,7 +19,7 @@ export type Path = {
19
19
  readonly dir: boolean;
20
20
  };
21
21
  export type FoundResult = {
22
- readonly id: moduleT.Id;
22
+ readonly id: Module.Id;
23
23
  readonly source: string;
24
24
  };
25
25
  export type Result = FoundResult | null;
@@ -49,19 +49,19 @@ declare const parseGlobal: (d: (local: string) => string | null) => (dir: boolea
49
49
  declare const parse: (packageId: string) => (dependencies: (local: string) => string | null) => (local: string) => (path: string) => Path | null;
50
50
  /**
51
51
  * @typedef {{
52
- * readonly id: moduleT.Id
52
+ * readonly id: Module.Id
53
53
  * readonly source: string
54
54
  * }} FoundResult
55
55
  */
56
56
  /** @typedef {FoundResult| null} Result */
57
57
  /**
58
- * @type {(packageGet: packageT.Get) =>
59
- * (moduleId: moduleT.Id) =>
58
+ * @type {(packageGet: Package.Get) =>
59
+ * (moduleId: Module.Id) =>
60
60
  * (path: string) =>
61
61
  * Result
62
62
  * }
63
63
  */
64
- declare const parseAndFind: (packageGet: packageT.Get) => (moduleId: moduleT.Id) => (path: string) => Result;
64
+ declare const parseAndFind: (packageGet: Package.Get) => (moduleId: Module.Id) => (path: string) => Result;
65
65
  import * as List from '../../types/list/module.f.mjs';
66
- import * as moduleT from '../module/module.f.mjs';
67
- import * as packageT from '../package/module.f.mjs';
66
+ import * as Module from '../module/module.f.mjs';
67
+ import * as Package from '../package/module.f.mjs';
@@ -2,8 +2,8 @@ import list, * as List from '../../types/list/module.f.mjs'
2
2
  const { next, fold, reverse, first, flat, toArray, filterMap, isEmpty, concat } = list
3
3
  import string from '../../types/string/module.f.mjs'
4
4
  const { join } = string
5
- import package_, * as packageT from '../package/module.f.mjs'
6
- import module_, * as moduleT from '../module/module.f.mjs'
5
+ import * as Package from '../package/module.f.mjs'
6
+ import * as Module from '../module/module.f.mjs'
7
7
 
8
8
  /** @typedef {readonly string[]} Items */
9
9
 
@@ -132,7 +132,7 @@ const parse = packageId => dependencies => {
132
132
 
133
133
  /**
134
134
  * @typedef {{
135
- * readonly id: moduleT.Id
135
+ * readonly id: Module.Id
136
136
  * readonly source: string
137
137
  * }} FoundResult
138
138
  */
@@ -140,8 +140,8 @@ const parse = packageId => dependencies => {
140
140
  /** @typedef {FoundResult| null} Result */
141
141
 
142
142
  /**
143
- * @type {(packageGet: packageT.Get) =>
144
- * (moduleId: moduleT.Id) =>
143
+ * @type {(packageGet: Package.Get) =>
144
+ * (moduleId: Module.Id) =>
145
145
  * (path: string) =>
146
146
  * Result
147
147
  * }
@@ -1,17 +1,17 @@
1
1
  import _ from './module.f.mjs'
2
2
  import dev from '../../dev/module.f.mjs'
3
3
  const { todo } = dev
4
- import json, * as jsonT from '../../json/module.f.mjs'
4
+ import json, * as Json from '../../json/module.f.mjs'
5
5
  import f from '../../types/function/module.f.mjs'
6
6
  const { identity } = f
7
7
  import object, * as O from '../../types/object/module.f.mjs'
8
8
  const { at } = object
9
- import * as packageT from '../package/module.f.mjs'
9
+ import * as Package from '../package/module.f.mjs'
10
10
 
11
11
  /** @type {<T>(o: O.Map<T>) => (s: string) => T|null} */
12
12
  const i = o => s => at(s)(o)
13
13
 
14
- /** @type {(g: jsonT.Unknown) => string} */
14
+ /** @type {(g: Json.Unknown) => string} */
15
15
  const stringify = json.stringify(identity)
16
16
 
17
17
  export default {
@@ -70,7 +70,7 @@ export default {
70
70
  },
71
71
  },
72
72
  9: () => {
73
- /** @type {O.Map<packageT.Package>} */
73
+ /** @type {O.Map<Package.Package>} */
74
74
  const packages = {
75
75
  '': {
76
76
  dependency: () => todo(),
@@ -81,7 +81,7 @@ export default {
81
81
  if (result !== '{"id":{"package":"","path":["a","c"]},"source":"return \\"a/c\\""}') { throw result }
82
82
  },
83
83
  10: () => {
84
- /** @type {O.Map<packageT.Package>} */
84
+ /** @type {O.Map<Package.Package>} */
85
85
  const packages = {
86
86
  '': {
87
87
  dependency: x => {
@@ -131,7 +131,7 @@ export default {
131
131
  }
132
132
  },
133
133
  11: () => {
134
- /** @type {O.Map<packageT.Package>} */
134
+ /** @type {O.Map<Package.Package>} */
135
135
  const packages = {
136
136
  '': {
137
137
  dependency: x => {
@@ -158,7 +158,7 @@ export default {
158
158
  }
159
159
  },
160
160
  12: () => {
161
- /** @type {O.Map<packageT.Package>} */
161
+ /** @type {O.Map<Package.Package>} */
162
162
  const packages = {
163
163
  '': {
164
164
  dependency: x => {
package/commonjs/test.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import _ from './module.mjs'
2
- import run, * as runT from './module/function/module.f.mjs'
2
+ import * as Run from './module/function/module.f.mjs'
3
3
 
4
4
  export default {
5
5
  ok: () => {
@@ -32,7 +32,7 @@ export default {
32
32
  const d = _.compile(depSource)
33
33
  if (d[0] !== 'ok') { throw d }
34
34
 
35
- /** @type {runT.Require<number>} */
35
+ /** @type {Run.Require<number>} */
36
36
  const req = path => prior => {
37
37
  if (path !== 'm') { throw path }
38
38
  return d[1](req)(prior + 1)
package/djs/module.f.mjs CHANGED
@@ -2,7 +2,7 @@ import list, * as List from '../types/list/module.f.mjs'
2
2
  const { flat, map } = list
3
3
  import string from '../types/string/module.f.mjs'
4
4
  const { concat } = string
5
- import object, * as O from '../types/object/module.f.mjs'
5
+ import * as O from '../types/object/module.f.mjs'
6
6
  import f from '../types/function/module.f.mjs'
7
7
  const { compose, fn } = f
8
8
  const { entries } = Object
@@ -1,4 +1,4 @@
1
- import operator, * as Operator from '../../types/function/operator/module.f.mjs'
1
+ import * as Operator from '../../types/function/operator/module.f.mjs'
2
2
  import list, * as List from '../../types/list/module.f.mjs'
3
3
  const { empty, flat, stateScan } = list
4
4
  import bf from '../../types/bigfloat/module.f.mjs'
@@ -1,6 +1,6 @@
1
1
  import tokenizer, * as tokenizerT from './module.f.mjs'
2
2
  import list from '../../types/list/module.f.mjs'
3
- const { toArray, countdown } = list
3
+ const { toArray } = list
4
4
  import djs from '../module.f.mjs'
5
5
  import o from '../../types/object/module.f.mjs'
6
6
  const { sort } = o