functionalscript 0.3.3 → 0.3.4

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/test/build.ts CHANGED
@@ -7,7 +7,7 @@ import * as string from '../../types/string/module.f.ts'
7
7
  const { join } = string
8
8
  const { log, error } = console
9
9
  import * as sgr from '../../text/sgr/module.f.ts'
10
- const { bold, reset } = sgr.codes
10
+ const { bold, reset } = sgr
11
11
  import * as list from '../../types/list/module.f.ts'
12
12
 
13
13
  import { fileURLToPath } from 'node:url'
package/deno.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@functionalscript/functionalscript",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "license": "AGPL-3.0-only",
5
5
  "exports": {
6
6
  "./com/cpp": "./com/cpp/module.f.ts",
package/dev/module.ts CHANGED
@@ -88,7 +88,6 @@ export const loadModuleMap = async () => {
88
88
  name.endsWith('.f.js') ||
89
89
  (name.endsWith('.f.ts') && !existsSync(file.substring(0, file.length - 3) + '.js'))
90
90
  ) {
91
- console.log(file)
92
91
  const source = await import(`../${file}`)
93
92
  map.push([file, source.default])
94
93
  }
@@ -1,7 +1,7 @@
1
1
  import * as list from '../../types/list/module.f.ts'
2
2
  const { fold } = list
3
- import * as sgr from '../../text/sgr/module.f.ts'
4
- const { reset, fgGreen, fgRed, bold } = sgr.codes
3
+ import * as codes from '../../text/sgr/module.f.ts'
4
+ const { reset, fgGreen, fgRed, bold } = codes
5
5
  import * as Result from '../../types/result/module.f.ts'
6
6
 
7
7
  type DependencyMap = {
@@ -67,7 +67,7 @@ const {
67
67
  leftCurlyBracket,
68
68
  rightCurlyBracket,
69
69
  dollarSign
70
- } = ascii.ascii
70
+ } = ascii
71
71
 
72
72
  export type StringToken = {
73
73
  readonly kind: 'string'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "functionalscript",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "type": "module",
5
5
  "description": "FunctionalScript is a functional subset of JavaScript",
6
6
  "scripts": {
@@ -1,4 +1,4 @@
1
- import * as _range from '../../types/range/module.f.ts'
1
+ import { type Range } from '../../types/range/module.f.ts'
2
2
 
3
3
  const at
4
4
  : (s: string) => (i: number) => number
@@ -8,12 +8,10 @@ const at
8
8
  return r
9
9
  }
10
10
 
11
- export const one
12
- : (s: string) => number
13
- = s => at(s)(0)
11
+ export const one = (s: string): number => at(s)(0)
14
12
 
15
13
  export const range
16
- : (s: string) => _range.Range
14
+ : (s: string) => Range
17
15
  = s => {
18
16
  const f = at(s)
19
17
  const f0 = f(0)
@@ -21,202 +19,201 @@ export const range
21
19
  return [f0, f(1)]
22
20
  }
23
21
 
24
- export const ascii = {
25
- // 0x00..
22
+ // 0x00..
26
23
 
27
- /** @readonly 0x08 */
28
- backspace: one('\b'),
24
+ /** 0x08 */
25
+ export const backspace: number = one('\b')
29
26
 
30
- /** @readonly 0x09 */
31
- ht: one('\t'),
27
+ /** 0x09 */
28
+ export const ht: number = one('\t')
32
29
 
33
- /** @readonly 0x0A */
34
- lf: one('\n'),
30
+ /** 0x0A */
31
+ export const lf: number = one('\n')
35
32
 
36
- /** @readonly 0x0C */
37
- ff: one('\f'),
38
- /** @readonly 0x0D */
39
- cr: one('\r'),
33
+ /** 0x0C */
34
+ export const ff: number = one('\f')
40
35
 
41
- // 0x20..
36
+ /** 0x0D */
37
+ export const cr: number = one('\r')
42
38
 
43
- /** @readonly 0x20 */
44
- space: one(' '),
39
+ // 0x20..
45
40
 
46
- /** @readonly 0x21 */
47
- exclamationMark: one('!'),
41
+ /** 0x20 */
42
+ export const space: number = one(' ')
48
43
 
49
- /** @readonly 0x22 */
50
- quotationMark: one('"'),
44
+ /** 0x21 */
45
+ export const exclamationMark: number = one('!')
51
46
 
52
- /** @readonly 0x23 */
53
- numberSign: one('#'),
47
+ /** 0x22 */
48
+ export const quotationMark: number = one('"')
54
49
 
55
- /** @readonly 0x24 */
56
- dollarSign: one('$'),
50
+ /** 0x23 */
51
+ export const numberSign: number = one('#')
57
52
 
58
- /** @readonly 0x25 */
59
- percentSign: one('%'),
53
+ /** 0x24 */
54
+ export const dollarSign: number = one('$')
60
55
 
61
- /** @readonly 0x26 */
62
- ampersand: one('&'),
56
+ /** 0x25 */
57
+ export const percentSign: number = one('%')
63
58
 
64
- /** @readonly 0x27 */
65
- apostrophe: one("'"),
59
+ /** 0x26 */
60
+ export const ampersand: number = one('&')
66
61
 
67
- /** @readonly 0x28 */
68
- leftParenthesis: one('('),
62
+ /** 0x27 */
63
+ export const apostrophe: number = one("'")
69
64
 
70
- /** @readonly 0x29 */
71
- rightParenthesis: one(')'),
65
+ /** 0x28 */
66
+ export const leftParenthesis: number = one('(')
72
67
 
73
- /** @readonly 0x2A */
74
- asterisk: one('*'),
68
+ /** 0x29 */
69
+ export const rightParenthesis: number = one(')')
75
70
 
76
- /** @readonly 0x2B */
77
- plusSign: one('+'),
71
+ /** 0x2A */
72
+ export const asterisk: number = one('*')
78
73
 
79
- /** @readonly 0x2C */
80
- comma: one(','),
74
+ /** 0x2B */
75
+ export const plusSign: number = one('+')
81
76
 
82
- /** @readonly 0x2D */
83
- hyphenMinus: one('-'),
77
+ /** 0x2C */
78
+ export const comma: number = one(',')
84
79
 
85
- /** @readonly 0x2E */
86
- fullStop: one('.'),
80
+ /** 0x2D */
81
+ export const hyphenMinus: number = one('-')
87
82
 
88
- /** @readonly 0x2F */
89
- solidus: one('/'),
83
+ /** 0x2E */
84
+ export const fullStop: number = one('.')
90
85
 
91
- // 0x30..
86
+ /** 0x2F */
87
+ export const solidus: number = one('/')
92
88
 
93
- /** @readonly 0x30..0x39 */
94
- digitRange: range('09'),
89
+ // 0x30..
95
90
 
96
- /** @readonly 0x30 */
97
- digit0: one('0'),
91
+ /** 0x30..0x39 */
92
+ export const digitRange: Range = range('09')
98
93
 
99
- /** @readonly 0x31 */
100
- digit1: one('1'),
94
+ /** 0x30 */
95
+ export const digit0: number = one('0')
101
96
 
102
- /** @readonly 0x32 */
103
- digit2: one('2'),
97
+ /** 0x31 */
98
+ export const digit1: number = one('1')
104
99
 
105
- /** @readonly 0x33 */
106
- digit3: one('3'),
100
+ /** 0x32 */
101
+ export const digit2: number = one('2')
107
102
 
108
- /** @readonly 0x34 */
109
- digit4: one('4'),
103
+ /** 0x33 */
104
+ export const digit3: number = one('3')
110
105
 
111
- /** @readonly 0x35 */
112
- digit5: one('5'),
106
+ /** 0x34 */
107
+ export const digit4: number = one('4')
113
108
 
114
- /** @readonly 0x36 */
115
- digit6: one('6'),
109
+ /** 0x35 */
110
+ export const digit5: number = one('5')
116
111
 
117
- /** @readonly 0x37 */
118
- digit7: one('7'),
112
+ /** 0x36 */
113
+ export const digit6: number = one('6')
119
114
 
120
- /** @readonly 0x38 */
121
- digit8: one('8'),
115
+ /** 0x37 */
116
+ export const digit7: number = one('7')
122
117
 
123
- /** @readonly 0x39 */
124
- digit9: one('9'),
118
+ /** 0x38 */
119
+ export const digit8: number = one('8')
125
120
 
126
- /** @readonly 0x3A */
127
- colon: one(':'),
121
+ /** 0x39 */
122
+ export const digit9: number = one('9')
128
123
 
129
- /** @readonly 0x3B */
130
- semicolon: one(';'),
124
+ /** 0x3A */
125
+ export const colon: number = one(':')
131
126
 
132
- /** @readonly 0x3C */
133
- lessThanSign: one('<'),
127
+ /** 0x3B */
128
+ export const semicolon: number = one(';')
134
129
 
135
- /** @readonly 0x3D */
136
- equalsSign: one('='),
130
+ /** 0x3C */
131
+ export const lessThanSign: number = one('<')
137
132
 
138
- /** @readonly 0x3E */
139
- greaterThanSign: one('>'),
133
+ /** 0x3D */
134
+ export const equalsSign: number = one('=')
140
135
 
141
- /** @readonly 0x3F */
142
- questionMark: one('?'),
136
+ /** 0x3E */
137
+ export const greaterThanSign: number = one('>')
143
138
 
144
- // 0x40..
139
+ /** 0x3F */
140
+ export const questionMark: number = one('?')
145
141
 
146
- /** @readonly 0x40 */
147
- commercialAt: one('@'),
142
+ // 0x40..
148
143
 
149
- /** @readonly 0x41..0x5A */
150
- latinCapitalLetterRange: range('AZ'),
144
+ /** 0x40 */
145
+ export const commercialAt: number = one('@')
151
146
 
152
- /** @readonly 0x41 */
153
- latinCapitalLetterA: one('A'),
147
+ /** 0x41..0x5A */
148
+ export const latinCapitalLetterRange: Range = range('AZ')
154
149
 
155
- /** @readonly 0x45 */
156
- latinCapitalLetterE: one('E'),
150
+ /** 0x41 */
151
+ export const latinCapitalLetterA: number = one('A')
157
152
 
158
- /** @readonly 0x46 */
159
- latinCapitalLetterF: one('F'),
153
+ /** 0x45 */
154
+ export const latinCapitalLetterE: number = one('E')
160
155
 
161
- /** @readonly 0x5B */
162
- leftSquareBracket: one('['),
156
+ /** 0x46 */
157
+ export const latinCapitalLetterF: number = one('F')
163
158
 
164
- /** @readonly 0x5C */
165
- reverseSolidus: one('\\'),
159
+ /** 0x5B */
160
+ export const leftSquareBracket: number = one('[')
166
161
 
167
- /** @readonly 0x5D */
168
- rightSquareBracket: one(']'),
162
+ /** 0x5C */
163
+ export const reverseSolidus: number = one('\\')
169
164
 
170
- /** @readonly 0x5E */
171
- circumflexAccent: one('^'),
165
+ /** 0x5D */
166
+ export const rightSquareBracket: number = one(']')
172
167
 
173
- /** @readonly 0x5F */
174
- lowLine: one('_'),
168
+ /** 0x5E */
169
+ export const circumflexAccent: number = one('^')
175
170
 
176
- // 0x60..
171
+ /** 0x5F */
172
+ export const lowLine: number = one('_')
177
173
 
178
- /** @readonly 0x60 */
179
- graveAccent: one('`'),
174
+ // 0x60..
180
175
 
181
- /** @readonly 0x61..0x7A */
182
- latinSmallLetterRange: range('az'),
176
+ /** 0x60 */
177
+ export const graveAccent: number = one('`')
183
178
 
184
- /** @readonly 0x61 */
185
- latinSmallLetterA: one('a'),
179
+ /** 0x61..0x7A */
180
+ export const latinSmallLetterRange: Range = range('az')
186
181
 
187
- /** @readonly 0x62 */
188
- latinSmallLetterB: one('b'),
182
+ /** 0x61 */
183
+ export const latinSmallLetterA: number = one('a')
189
184
 
190
- /** @readonly 0x65 */
191
- latinSmallLetterE: one('e'),
185
+ /** 0x62 */
186
+ export const latinSmallLetterB: number = one('b')
192
187
 
193
- /** @readonly 0x66 */
194
- latinSmallLetterF: one('f'),
188
+ /** 0x65 */
189
+ export const latinSmallLetterE: number = one('e')
195
190
 
196
- /** @readonly 0x6E */
197
- latinSmallLetterN: one('n'),
191
+ /** 0x66 */
192
+ export const latinSmallLetterF: number = one('f')
198
193
 
199
- /** @readonly 0x72 */
200
- latinSmallLetterR: one('r'),
194
+ /** 0x6E */
195
+ export const latinSmallLetterN: number = one('n')
201
196
 
202
- /** @readonly 0x74 */
203
- latinSmallLetterT: one('t'),
197
+ /** 0x72 */
198
+ export const latinSmallLetterR: number = one('r')
204
199
 
205
- /** @readonly 0x75 */
206
- latinSmallLetterU: one('u'),
200
+ /** 0x74 */
201
+ export const latinSmallLetterT: number = one('t')
207
202
 
208
- /** @readonly 0x7A */
209
- latinSmallLetterZ: one('z'),
203
+ /** 0x75 */
204
+ export const latinSmallLetterU: number = one('u')
210
205
 
211
- /** @readonly 0x7B */
212
- leftCurlyBracket: one('{'),
206
+ /** 0x7A */
207
+ export const latinSmallLetterZ: number = one('z')
213
208
 
214
- /** @readonly 0x7C */
215
- verticalLine: one('|'),
209
+ /** 0x7B */
210
+ export const leftCurlyBracket: number = one('{')
216
211
 
217
- /** @readonly 0x7D */
218
- rightCurlyBracket: one('}'),
212
+ /** 0x7C */
213
+ export const verticalLine: number = one('|')
219
214
 
220
- /** @readonly 0x7E */
221
- tilde: one('~'),
222
- }
215
+ /** 0x7D */
216
+ export const rightCurlyBracket: number = one('}')
217
+
218
+ /** 0x7E */
219
+ export const tilde: number = one('~')
@@ -2,12 +2,10 @@
2
2
  * https://en.wikipedia.org/wiki/ANSI_escape_code#SGR
3
3
  */
4
4
  export const sgr
5
- : (c: number) => string
6
- = c => `\x1b[${c.toString()}m`
5
+ : (c: number) => string
6
+ = c => `\x1b[${c.toString()}m`
7
7
 
8
- export const codes = {
9
- reset: sgr(0),
10
- bold: sgr(1),
11
- fgRed: sgr(31),
12
- fgGreen: sgr(32),
13
- }
8
+ export const reset: string = sgr(0)
9
+ export const bold: string = sgr(1)
10
+ export const fgRed: string = sgr(31)
11
+ export const fgGreen: string = sgr(32)