firefly-compiler 0.4.6 → 0.4.8
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/compiler/Compiler.ff +2 -0
- package/compiler/Deriver.ff +7 -0
- package/core/Array.ff +17 -4
- package/core/AssetSystem.ff +1 -1
- package/core/BrowserSystem.ff +27 -0
- package/core/List.ff +4 -0
- package/core/Lock.ff +2 -2
- package/core/Random.ff +148 -0
- package/core/SourceLocation.ff +27 -0
- package/core/Task.ff +3 -0
- package/core/WebSocket.ff +127 -0
- package/httpserver/HttpServer.ff +1 -1
- package/lux/Css.ff +648 -0
- package/lux/CssTest.ff +48 -0
- package/lux/Lux.ff +33 -18
- package/lux/Main.ff +4 -1
- package/output/js/ff/compiler/Builder.mjs +448 -444
- package/output/js/ff/compiler/Compiler.mjs +420 -416
- package/output/js/ff/compiler/Dependencies.mjs +393 -389
- package/output/js/ff/compiler/Deriver.mjs +1178 -1170
- package/output/js/ff/compiler/Dictionaries.mjs +1315 -1309
- package/output/js/ff/compiler/Environment.mjs +1025 -1015
- package/output/js/ff/compiler/Inference.mjs +4272 -4268
- package/output/js/ff/compiler/JsEmitter.mjs +5405 -5391
- package/output/js/ff/compiler/JsImporter.mjs +270 -266
- package/output/js/ff/compiler/LspHook.mjs +799 -793
- package/output/js/ff/compiler/Main.mjs +1691 -1675
- package/output/js/ff/compiler/Parser.mjs +4016 -4008
- package/output/js/ff/compiler/Patterns.mjs +935 -927
- package/output/js/ff/compiler/Resolver.mjs +2311 -2307
- package/output/js/ff/compiler/Substitution.mjs +1154 -1150
- package/output/js/ff/compiler/Syntax.mjs +12566 -12434
- package/output/js/ff/compiler/Token.mjs +3152 -3096
- package/output/js/ff/compiler/Tokenizer.mjs +597 -593
- package/output/js/ff/compiler/Unification.mjs +1762 -1752
- package/output/js/ff/compiler/Wildcards.mjs +612 -608
- package/output/js/ff/compiler/Workspace.mjs +695 -687
- package/output/js/ff/core/Any.mjs +147 -143
- package/output/js/ff/core/Array.mjs +573 -547
- package/output/js/ff/core/AssetSystem.mjs +278 -274
- package/output/js/ff/core/Atomic.mjs +158 -154
- package/output/js/ff/core/Bool.mjs +156 -152
- package/output/js/ff/core/Box.mjs +116 -112
- package/output/js/ff/core/BrowserSystem.mjs +181 -126
- package/output/js/ff/core/Buffer.mjs +399 -395
- package/output/js/ff/core/BuildSystem.mjs +300 -296
- package/output/js/ff/core/Channel.mjs +193 -189
- package/output/js/ff/core/Char.mjs +153 -149
- package/output/js/ff/core/Core.mjs +304 -300
- package/output/js/ff/core/Duration.mjs +120 -116
- package/output/js/ff/core/Equal.mjs +183 -179
- package/output/js/ff/core/Error.mjs +146 -142
- package/output/js/ff/core/FileHandle.mjs +154 -150
- package/output/js/ff/core/Float.mjs +229 -225
- package/output/js/ff/core/HttpClient.mjs +195 -191
- package/output/js/ff/core/Instant.mjs +113 -109
- package/output/js/ff/core/Int.mjs +269 -265
- package/output/js/ff/core/IntMap.mjs +284 -280
- package/output/js/ff/core/JsSystem.mjs +242 -238
- package/output/js/ff/core/JsValue.mjs +712 -708
- package/output/js/ff/core/List.mjs +2346 -2334
- package/output/js/ff/core/Lock.mjs +235 -231
- package/output/js/ff/core/Log.mjs +167 -163
- package/output/js/ff/core/Map.mjs +366 -362
- package/output/js/ff/core/NodeSystem.mjs +298 -294
- package/output/js/ff/core/Nothing.mjs +108 -104
- package/output/js/ff/core/Option.mjs +1023 -1015
- package/output/js/ff/core/Ordering.mjs +734 -730
- package/output/js/ff/core/Pair.mjs +337 -331
- package/output/js/ff/core/Path.mjs +549 -545
- package/output/js/ff/core/Random.mjs +340 -0
- package/output/js/ff/core/RbMap.mjs +1944 -1940
- package/output/js/ff/core/Serializable.mjs +432 -428
- package/output/js/ff/core/Set.mjs +258 -254
- package/output/js/ff/core/Show.mjs +209 -205
- package/output/js/ff/core/SourceLocation.mjs +273 -229
- package/output/js/ff/core/Stack.mjs +533 -529
- package/output/js/ff/core/Stream.mjs +1308 -1304
- package/output/js/ff/core/String.mjs +369 -365
- package/output/js/ff/core/StringMap.mjs +284 -280
- package/output/js/ff/core/Task.mjs +325 -319
- package/output/js/ff/core/Try.mjs +511 -507
- package/output/js/ff/core/Unit.mjs +155 -151
- package/output/js/ff/core/WebSocket.mjs +198 -0
- package/package.json +1 -1
- package/vscode/package.json +1 -1
- package/webserver/.firefly/include/package-lock.json +16 -0
- package/webserver/.firefly/include/package.json +5 -0
- package/webserver/.firefly/package.ff +2 -0
- package/webserver/WebServer.ff +608 -0
|
@@ -1,112 +1,116 @@
|
|
|
1
|
-
import * as import$0 from 'fs';
|
|
2
|
-
|
|
3
|
-
import * as import$1 from 'fs/promises';
|
|
4
|
-
|
|
5
|
-
import * as import$2 from 'path';
|
|
6
|
-
|
|
7
|
-
import * as import$3 from 'url';
|
|
8
|
-
|
|
9
|
-
import * as ff_core_Any from "../../ff/core/Any.mjs"
|
|
10
|
-
|
|
11
|
-
import * as ff_core_Array from "../../ff/core/Array.mjs"
|
|
12
|
-
|
|
13
|
-
import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
|
|
14
|
-
|
|
15
|
-
import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
16
|
-
|
|
17
|
-
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
18
|
-
|
|
19
|
-
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
20
|
-
|
|
21
|
-
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
22
|
-
|
|
23
|
-
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
24
|
-
|
|
25
|
-
import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
|
|
26
|
-
|
|
27
|
-
import * as ff_core_Channel from "../../ff/core/Channel.mjs"
|
|
28
|
-
|
|
29
|
-
import * as ff_core_Char from "../../ff/core/Char.mjs"
|
|
30
|
-
|
|
31
|
-
import * as ff_core_Core from "../../ff/core/Core.mjs"
|
|
32
|
-
|
|
33
|
-
import * as ff_core_Duration from "../../ff/core/Duration.mjs"
|
|
34
|
-
|
|
35
|
-
import * as ff_core_Equal from "../../ff/core/Equal.mjs"
|
|
36
|
-
|
|
37
|
-
import * as ff_core_Error from "../../ff/core/Error.mjs"
|
|
38
|
-
|
|
39
|
-
import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
|
|
40
|
-
|
|
41
|
-
import * as ff_core_Float from "../../ff/core/Float.mjs"
|
|
42
|
-
|
|
43
|
-
import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
|
|
44
|
-
|
|
45
|
-
import * as ff_core_Instant from "../../ff/core/Instant.mjs"
|
|
46
|
-
|
|
47
|
-
import * as ff_core_Int from "../../ff/core/Int.mjs"
|
|
48
|
-
|
|
49
|
-
import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
|
|
50
|
-
|
|
51
|
-
import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
|
|
52
|
-
|
|
53
|
-
import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
|
|
54
|
-
|
|
55
|
-
import * as ff_core_List from "../../ff/core/List.mjs"
|
|
56
|
-
|
|
57
|
-
import * as ff_core_Lock from "../../ff/core/Lock.mjs"
|
|
58
|
-
|
|
59
|
-
import * as ff_core_Log from "../../ff/core/Log.mjs"
|
|
60
|
-
|
|
61
|
-
import * as ff_core_Map from "../../ff/core/Map.mjs"
|
|
62
|
-
|
|
63
|
-
import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
|
|
64
|
-
|
|
65
|
-
import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
|
|
66
|
-
|
|
67
|
-
import * as ff_core_Option from "../../ff/core/Option.mjs"
|
|
68
|
-
|
|
69
|
-
import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
|
|
70
|
-
|
|
71
|
-
import * as ff_core_Pair from "../../ff/core/Pair.mjs"
|
|
72
|
-
|
|
73
|
-
import * as ff_core_Path from "../../ff/core/Path.mjs"
|
|
74
|
-
|
|
75
|
-
import * as
|
|
76
|
-
|
|
77
|
-
import * as
|
|
78
|
-
|
|
79
|
-
import * as
|
|
80
|
-
|
|
81
|
-
import * as
|
|
82
|
-
|
|
83
|
-
import * as
|
|
84
|
-
|
|
85
|
-
import * as
|
|
86
|
-
|
|
87
|
-
import * as
|
|
88
|
-
|
|
89
|
-
import * as
|
|
90
|
-
|
|
91
|
-
import * as
|
|
92
|
-
|
|
93
|
-
import * as
|
|
94
|
-
|
|
95
|
-
import * as
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
export
|
|
1
|
+
import * as import$0 from 'fs';
|
|
2
|
+
|
|
3
|
+
import * as import$1 from 'fs/promises';
|
|
4
|
+
|
|
5
|
+
import * as import$2 from 'path';
|
|
6
|
+
|
|
7
|
+
import * as import$3 from 'url';
|
|
8
|
+
|
|
9
|
+
import * as ff_core_Any from "../../ff/core/Any.mjs"
|
|
10
|
+
|
|
11
|
+
import * as ff_core_Array from "../../ff/core/Array.mjs"
|
|
12
|
+
|
|
13
|
+
import * as ff_core_AssetSystem from "../../ff/core/AssetSystem.mjs"
|
|
14
|
+
|
|
15
|
+
import * as ff_core_Atomic from "../../ff/core/Atomic.mjs"
|
|
16
|
+
|
|
17
|
+
import * as ff_core_Bool from "../../ff/core/Bool.mjs"
|
|
18
|
+
|
|
19
|
+
import * as ff_core_Box from "../../ff/core/Box.mjs"
|
|
20
|
+
|
|
21
|
+
import * as ff_core_BrowserSystem from "../../ff/core/BrowserSystem.mjs"
|
|
22
|
+
|
|
23
|
+
import * as ff_core_Buffer from "../../ff/core/Buffer.mjs"
|
|
24
|
+
|
|
25
|
+
import * as ff_core_BuildSystem from "../../ff/core/BuildSystem.mjs"
|
|
26
|
+
|
|
27
|
+
import * as ff_core_Channel from "../../ff/core/Channel.mjs"
|
|
28
|
+
|
|
29
|
+
import * as ff_core_Char from "../../ff/core/Char.mjs"
|
|
30
|
+
|
|
31
|
+
import * as ff_core_Core from "../../ff/core/Core.mjs"
|
|
32
|
+
|
|
33
|
+
import * as ff_core_Duration from "../../ff/core/Duration.mjs"
|
|
34
|
+
|
|
35
|
+
import * as ff_core_Equal from "../../ff/core/Equal.mjs"
|
|
36
|
+
|
|
37
|
+
import * as ff_core_Error from "../../ff/core/Error.mjs"
|
|
38
|
+
|
|
39
|
+
import * as ff_core_FileHandle from "../../ff/core/FileHandle.mjs"
|
|
40
|
+
|
|
41
|
+
import * as ff_core_Float from "../../ff/core/Float.mjs"
|
|
42
|
+
|
|
43
|
+
import * as ff_core_HttpClient from "../../ff/core/HttpClient.mjs"
|
|
44
|
+
|
|
45
|
+
import * as ff_core_Instant from "../../ff/core/Instant.mjs"
|
|
46
|
+
|
|
47
|
+
import * as ff_core_Int from "../../ff/core/Int.mjs"
|
|
48
|
+
|
|
49
|
+
import * as ff_core_IntMap from "../../ff/core/IntMap.mjs"
|
|
50
|
+
|
|
51
|
+
import * as ff_core_JsSystem from "../../ff/core/JsSystem.mjs"
|
|
52
|
+
|
|
53
|
+
import * as ff_core_JsValue from "../../ff/core/JsValue.mjs"
|
|
54
|
+
|
|
55
|
+
import * as ff_core_List from "../../ff/core/List.mjs"
|
|
56
|
+
|
|
57
|
+
import * as ff_core_Lock from "../../ff/core/Lock.mjs"
|
|
58
|
+
|
|
59
|
+
import * as ff_core_Log from "../../ff/core/Log.mjs"
|
|
60
|
+
|
|
61
|
+
import * as ff_core_Map from "../../ff/core/Map.mjs"
|
|
62
|
+
|
|
63
|
+
import * as ff_core_NodeSystem from "../../ff/core/NodeSystem.mjs"
|
|
64
|
+
|
|
65
|
+
import * as ff_core_Nothing from "../../ff/core/Nothing.mjs"
|
|
66
|
+
|
|
67
|
+
import * as ff_core_Option from "../../ff/core/Option.mjs"
|
|
68
|
+
|
|
69
|
+
import * as ff_core_Ordering from "../../ff/core/Ordering.mjs"
|
|
70
|
+
|
|
71
|
+
import * as ff_core_Pair from "../../ff/core/Pair.mjs"
|
|
72
|
+
|
|
73
|
+
import * as ff_core_Path from "../../ff/core/Path.mjs"
|
|
74
|
+
|
|
75
|
+
import * as ff_core_Random from "../../ff/core/Random.mjs"
|
|
76
|
+
|
|
77
|
+
import * as ff_core_Serializable from "../../ff/core/Serializable.mjs"
|
|
78
|
+
|
|
79
|
+
import * as ff_core_Set from "../../ff/core/Set.mjs"
|
|
80
|
+
|
|
81
|
+
import * as ff_core_Show from "../../ff/core/Show.mjs"
|
|
82
|
+
|
|
83
|
+
import * as ff_core_SourceLocation from "../../ff/core/SourceLocation.mjs"
|
|
84
|
+
|
|
85
|
+
import * as ff_core_Stack from "../../ff/core/Stack.mjs"
|
|
86
|
+
|
|
87
|
+
import * as ff_core_Stream from "../../ff/core/Stream.mjs"
|
|
88
|
+
|
|
89
|
+
import * as ff_core_String from "../../ff/core/String.mjs"
|
|
90
|
+
|
|
91
|
+
import * as ff_core_StringMap from "../../ff/core/StringMap.mjs"
|
|
92
|
+
|
|
93
|
+
import * as ff_core_Task from "../../ff/core/Task.mjs"
|
|
94
|
+
|
|
95
|
+
import * as ff_core_Try from "../../ff/core/Try.mjs"
|
|
96
|
+
|
|
97
|
+
import * as ff_core_Unit from "../../ff/core/Unit.mjs"
|
|
98
|
+
|
|
99
|
+
import * as ff_core_WebSocket from "../../ff/core/WebSocket.mjs"
|
|
100
|
+
|
|
101
|
+
// type Path
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
// type PathEntry
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
export function internalReadStream_(createReadStream_) {
|
|
110
|
+
throw new Error('Function internalReadStream is missing on this target in sync context.');
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export async function internalReadStream_$(createReadStream_, $task) {
|
|
110
114
|
|
|
111
115
|
let task = null
|
|
112
116
|
let readable = null
|
|
@@ -149,209 +153,209 @@ export async function internalReadStream_$(createReadStream_, $task) {
|
|
|
149
153
|
}).then(() => go($task))
|
|
150
154
|
return await promise
|
|
151
155
|
}, abort)
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
export function Path_exists(self_, checkReadable_ = false, checkWritable_ = false, checkExecutable_ = false) {
|
|
156
|
-
throw new Error('Function Path_exists is missing on this target in sync context.');
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
export function Path_isReadable(self_) {
|
|
160
|
-
return ff_core_Path.Path_exists(self_, true, false, false)
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export function Path_isWritable(self_) {
|
|
164
|
-
return ff_core_Path.Path_exists(self_, false, true, false)
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export function Path_isExecutable(self_) {
|
|
168
|
-
return ff_core_Path.Path_exists(self_, false, false, true)
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export function Path_isDirectory(self_) {
|
|
172
|
-
throw new Error('Function Path_isDirectory is missing on this target in sync context.');
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export function Path_isFile(self_) {
|
|
176
|
-
throw new Error('Function Path_isFile is missing on this target in sync context.');
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
export function Path_isSymbolicLink(self_) {
|
|
180
|
-
throw new Error('Function Path_isSymbolicLink is missing on this target in sync context.');
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
export function Path_isInsideOf(self_, path_) {
|
|
184
|
-
throw new Error('Function Path_isInsideOf is missing on this target in sync context.');
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export function Path_size(self_) {
|
|
188
|
-
throw new Error('Function Path_size is missing on this target in sync context.');
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export function Path_modified(self_) {
|
|
192
|
-
throw new Error('Function Path_modified is missing on this target in sync context.');
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
export function Path_entries(self_) {
|
|
196
|
-
throw new Error('Function Path_entries is missing on this target in sync context.');
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
export function Path_absolute(self_) {
|
|
200
|
-
throw new Error('Function Path_absolute is missing on this target in sync context.');
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export function Path_relativeTo(self_, path_) {
|
|
204
|
-
throw new Error('Function Path_relativeTo is missing on this target in sync context.');
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
export function Path_endsWith(self_, parts_) {
|
|
208
|
-
function go_(pathOption_, reversed_) {
|
|
209
|
-
{
|
|
210
|
-
const pathOption_a = pathOption_;
|
|
211
|
-
const reversed_a = reversed_;
|
|
212
|
-
{
|
|
213
|
-
if(reversed_a.Empty) {
|
|
214
|
-
return true
|
|
215
|
-
return
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
{
|
|
219
|
-
if(pathOption_a.Some) {
|
|
220
|
-
const path_ = pathOption_a.value_;
|
|
221
|
-
if(reversed_a.Link) {
|
|
222
|
-
const p_ = reversed_a.head_;
|
|
223
|
-
const ps_ = reversed_a.tail_;
|
|
224
|
-
return ((ff_core_Path.Path_base(path_) === p_) && go_(ff_core_Path.Path_parent(path_), ps_))
|
|
225
|
-
return
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
{
|
|
230
|
-
if(pathOption_a.None) {
|
|
231
|
-
return false
|
|
232
|
-
return
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
return go_(ff_core_Option.Some(self_), ff_core_List.List_reverse(parts_))
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
export function Path_base(self_) {
|
|
241
|
-
throw new Error('Function Path_base is missing on this target in sync context.');
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
export function Path_extension(self_) {
|
|
245
|
-
throw new Error('Function Path_extension is missing on this target in sync context.');
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
export function Path_url(self_) {
|
|
249
|
-
throw new Error('Function Path_url is missing on this target in sync context.');
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
export function Path_delimiter(self_) {
|
|
253
|
-
throw new Error('Function Path_delimiter is missing on this target in sync context.');
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
export function Path_separator(self_) {
|
|
257
|
-
throw new Error('Function Path_separator is missing on this target in sync context.');
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
export function Path_parent(self_) {
|
|
261
|
-
throw new Error('Function Path_parent is missing on this target in sync context.');
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
export function Path_slash(self_, relativePath_) {
|
|
265
|
-
throw new Error('Function Path_slash is missing on this target in sync context.');
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export function Path_path(self_, absoluteOrRelativePath_) {
|
|
269
|
-
throw new Error('Function Path_path is missing on this target in sync context.');
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
export function Path_copyTo(self_, path_, retries_ = 0, retryDelay_ = 100) {
|
|
273
|
-
if(ff_core_Path.Path_isDirectory(self_)) {
|
|
274
|
-
if(ff_core_Path.Path_exists(path_, false, false, false)) {
|
|
275
|
-
ff_core_Path.Path_delete(path_, retries_, retryDelay_)
|
|
276
|
-
};
|
|
277
|
-
ff_core_Path.Path_createDirectory(path_, false);
|
|
278
|
-
ff_core_Stream.Stream_each(ff_core_Path.Path_entries(self_), ((file_) => {
|
|
279
|
-
ff_core_Path.Path_copyTo(ff_core_Path.PathEntry_path(file_), ff_core_Path.Path_slash(path_, ff_core_Path.Path_relativeTo(ff_core_Path.PathEntry_path(file_), self_)), retries_, retryDelay_)
|
|
280
|
-
}))
|
|
281
|
-
} else {
|
|
282
|
-
ff_core_Path.Path_writeStream(path_, ff_core_Path.Path_readStream(self_), false)
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
export function Path_createDirectory(self_, createParentDirectories_ = false) {
|
|
287
|
-
throw new Error('Function Path_createDirectory is missing on this target in sync context.');
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
export function Path_createSymlinkTo(self_, path_) {
|
|
291
|
-
throw new Error('Function Path_createSymlinkTo is missing on this target in sync context.');
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
export function Path_delete(self_, retries_ = 0, retryDelay_ = 100) {
|
|
295
|
-
throw new Error('Function Path_delete is missing on this target in sync context.');
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
export function Path_truncate(self_, length_ = 0) {
|
|
299
|
-
throw new Error('Function Path_truncate is missing on this target in sync context.');
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
export function Path_renameTo(self_, path_) {
|
|
303
|
-
throw new Error('Function Path_renameTo is missing on this target in sync context.');
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
export function Path_readText(self_) {
|
|
307
|
-
throw new Error('Function Path_readText is missing on this target in sync context.');
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
export function Path_writeText(self_, text_) {
|
|
311
|
-
throw new Error('Function Path_writeText is missing on this target in sync context.');
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
export function Path_appendText(self_, text_) {
|
|
315
|
-
throw new Error('Function Path_appendText is missing on this target in sync context.');
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
export function Path_readBuffer(self_) {
|
|
319
|
-
return ff_core_Stream.Stream_toBuffer(ff_core_Path.Path_readStream(self_))
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
export function Path_writeBuffer(self_, buffer_) {
|
|
323
|
-
ff_core_Path.Path_writeStream(self_, ff_core_List.List_toStream(ff_core_List.Link(buffer_, ff_core_List.Empty()), false), false)
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
export function Path_appendBuffer(self_, buffer_) {
|
|
327
|
-
ff_core_Path.Path_appendStream(self_, ff_core_List.List_toStream(ff_core_List.Link(buffer_, ff_core_List.Empty()), false))
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
export function Path_readStream(self_) {
|
|
331
|
-
throw new Error('Function Path_readStream is missing on this target in sync context.');
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
export function Path_writeStream(self_, stream_, createOnly_ = false) {
|
|
335
|
-
throw new Error('Function Path_writeStream is missing on this target in sync context.');
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
export function Path_appendStream(self_, stream_) {
|
|
339
|
-
throw new Error('Function Path_appendStream is missing on this target in sync context.');
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
export function Path_readHandle(self_, alsoWrite_ = false) {
|
|
343
|
-
throw new Error('Function Path_readHandle is missing on this target in sync context.');
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
export function Path_writeHandle(self_, alsoRead_ = false, mustCreate_ = false) {
|
|
347
|
-
throw new Error('Function Path_writeHandle is missing on this target in sync context.');
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
export function Path_appendHandle(self_, alsoRead_ = false, mustCreate_ = false) {
|
|
351
|
-
throw new Error('Function Path_appendHandle is missing on this target in sync context.');
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
export async function Path_exists$(self_, checkReadable_ = false, checkWritable_ = false, checkExecutable_ = false, $task) {
|
|
156
|
+
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export function Path_exists(self_, checkReadable_ = false, checkWritable_ = false, checkExecutable_ = false) {
|
|
160
|
+
throw new Error('Function Path_exists is missing on this target in sync context.');
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export function Path_isReadable(self_) {
|
|
164
|
+
return ff_core_Path.Path_exists(self_, true, false, false)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function Path_isWritable(self_) {
|
|
168
|
+
return ff_core_Path.Path_exists(self_, false, true, false)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export function Path_isExecutable(self_) {
|
|
172
|
+
return ff_core_Path.Path_exists(self_, false, false, true)
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export function Path_isDirectory(self_) {
|
|
176
|
+
throw new Error('Function Path_isDirectory is missing on this target in sync context.');
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function Path_isFile(self_) {
|
|
180
|
+
throw new Error('Function Path_isFile is missing on this target in sync context.');
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export function Path_isSymbolicLink(self_) {
|
|
184
|
+
throw new Error('Function Path_isSymbolicLink is missing on this target in sync context.');
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export function Path_isInsideOf(self_, path_) {
|
|
188
|
+
throw new Error('Function Path_isInsideOf is missing on this target in sync context.');
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export function Path_size(self_) {
|
|
192
|
+
throw new Error('Function Path_size is missing on this target in sync context.');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
export function Path_modified(self_) {
|
|
196
|
+
throw new Error('Function Path_modified is missing on this target in sync context.');
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export function Path_entries(self_) {
|
|
200
|
+
throw new Error('Function Path_entries is missing on this target in sync context.');
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export function Path_absolute(self_) {
|
|
204
|
+
throw new Error('Function Path_absolute is missing on this target in sync context.');
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export function Path_relativeTo(self_, path_) {
|
|
208
|
+
throw new Error('Function Path_relativeTo is missing on this target in sync context.');
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export function Path_endsWith(self_, parts_) {
|
|
212
|
+
function go_(pathOption_, reversed_) {
|
|
213
|
+
{
|
|
214
|
+
const pathOption_a = pathOption_;
|
|
215
|
+
const reversed_a = reversed_;
|
|
216
|
+
{
|
|
217
|
+
if(reversed_a.Empty) {
|
|
218
|
+
return true
|
|
219
|
+
return
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
{
|
|
223
|
+
if(pathOption_a.Some) {
|
|
224
|
+
const path_ = pathOption_a.value_;
|
|
225
|
+
if(reversed_a.Link) {
|
|
226
|
+
const p_ = reversed_a.head_;
|
|
227
|
+
const ps_ = reversed_a.tail_;
|
|
228
|
+
return ((ff_core_Path.Path_base(path_) === p_) && go_(ff_core_Path.Path_parent(path_), ps_))
|
|
229
|
+
return
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
{
|
|
234
|
+
if(pathOption_a.None) {
|
|
235
|
+
return false
|
|
236
|
+
return
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return go_(ff_core_Option.Some(self_), ff_core_List.List_reverse(parts_))
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export function Path_base(self_) {
|
|
245
|
+
throw new Error('Function Path_base is missing on this target in sync context.');
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export function Path_extension(self_) {
|
|
249
|
+
throw new Error('Function Path_extension is missing on this target in sync context.');
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
export function Path_url(self_) {
|
|
253
|
+
throw new Error('Function Path_url is missing on this target in sync context.');
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
export function Path_delimiter(self_) {
|
|
257
|
+
throw new Error('Function Path_delimiter is missing on this target in sync context.');
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export function Path_separator(self_) {
|
|
261
|
+
throw new Error('Function Path_separator is missing on this target in sync context.');
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export function Path_parent(self_) {
|
|
265
|
+
throw new Error('Function Path_parent is missing on this target in sync context.');
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
export function Path_slash(self_, relativePath_) {
|
|
269
|
+
throw new Error('Function Path_slash is missing on this target in sync context.');
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export function Path_path(self_, absoluteOrRelativePath_) {
|
|
273
|
+
throw new Error('Function Path_path is missing on this target in sync context.');
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export function Path_copyTo(self_, path_, retries_ = 0, retryDelay_ = 100) {
|
|
277
|
+
if(ff_core_Path.Path_isDirectory(self_)) {
|
|
278
|
+
if(ff_core_Path.Path_exists(path_, false, false, false)) {
|
|
279
|
+
ff_core_Path.Path_delete(path_, retries_, retryDelay_)
|
|
280
|
+
};
|
|
281
|
+
ff_core_Path.Path_createDirectory(path_, false);
|
|
282
|
+
ff_core_Stream.Stream_each(ff_core_Path.Path_entries(self_), ((file_) => {
|
|
283
|
+
ff_core_Path.Path_copyTo(ff_core_Path.PathEntry_path(file_), ff_core_Path.Path_slash(path_, ff_core_Path.Path_relativeTo(ff_core_Path.PathEntry_path(file_), self_)), retries_, retryDelay_)
|
|
284
|
+
}))
|
|
285
|
+
} else {
|
|
286
|
+
ff_core_Path.Path_writeStream(path_, ff_core_Path.Path_readStream(self_), false)
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export function Path_createDirectory(self_, createParentDirectories_ = false) {
|
|
291
|
+
throw new Error('Function Path_createDirectory is missing on this target in sync context.');
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export function Path_createSymlinkTo(self_, path_) {
|
|
295
|
+
throw new Error('Function Path_createSymlinkTo is missing on this target in sync context.');
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export function Path_delete(self_, retries_ = 0, retryDelay_ = 100) {
|
|
299
|
+
throw new Error('Function Path_delete is missing on this target in sync context.');
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export function Path_truncate(self_, length_ = 0) {
|
|
303
|
+
throw new Error('Function Path_truncate is missing on this target in sync context.');
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export function Path_renameTo(self_, path_) {
|
|
307
|
+
throw new Error('Function Path_renameTo is missing on this target in sync context.');
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export function Path_readText(self_) {
|
|
311
|
+
throw new Error('Function Path_readText is missing on this target in sync context.');
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
export function Path_writeText(self_, text_) {
|
|
315
|
+
throw new Error('Function Path_writeText is missing on this target in sync context.');
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
export function Path_appendText(self_, text_) {
|
|
319
|
+
throw new Error('Function Path_appendText is missing on this target in sync context.');
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
export function Path_readBuffer(self_) {
|
|
323
|
+
return ff_core_Stream.Stream_toBuffer(ff_core_Path.Path_readStream(self_))
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export function Path_writeBuffer(self_, buffer_) {
|
|
327
|
+
ff_core_Path.Path_writeStream(self_, ff_core_List.List_toStream(ff_core_List.Link(buffer_, ff_core_List.Empty()), false), false)
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
export function Path_appendBuffer(self_, buffer_) {
|
|
331
|
+
ff_core_Path.Path_appendStream(self_, ff_core_List.List_toStream(ff_core_List.Link(buffer_, ff_core_List.Empty()), false))
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export function Path_readStream(self_) {
|
|
335
|
+
throw new Error('Function Path_readStream is missing on this target in sync context.');
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export function Path_writeStream(self_, stream_, createOnly_ = false) {
|
|
339
|
+
throw new Error('Function Path_writeStream is missing on this target in sync context.');
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export function Path_appendStream(self_, stream_) {
|
|
343
|
+
throw new Error('Function Path_appendStream is missing on this target in sync context.');
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export function Path_readHandle(self_, alsoWrite_ = false) {
|
|
347
|
+
throw new Error('Function Path_readHandle is missing on this target in sync context.');
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export function Path_writeHandle(self_, alsoRead_ = false, mustCreate_ = false) {
|
|
351
|
+
throw new Error('Function Path_writeHandle is missing on this target in sync context.');
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export function Path_appendHandle(self_, alsoRead_ = false, mustCreate_ = false) {
|
|
355
|
+
throw new Error('Function Path_appendHandle is missing on this target in sync context.');
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export async function Path_exists$(self_, checkReadable_ = false, checkWritable_ = false, checkExecutable_ = false, $task) {
|
|
355
359
|
|
|
356
360
|
const fs = import$0
|
|
357
361
|
const fsPromises = import$1
|
|
@@ -365,22 +369,22 @@ export async function Path_exists$(self_, checkReadable_ = false, checkWritable_
|
|
|
365
369
|
} catch(e) {
|
|
366
370
|
return false
|
|
367
371
|
}
|
|
368
|
-
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
export async function Path_isReadable$(self_, $task) {
|
|
372
|
-
return (await ff_core_Path.Path_exists$(self_, true, false, false, $task))
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
export async function Path_isWritable$(self_, $task) {
|
|
376
|
-
return (await ff_core_Path.Path_exists$(self_, false, true, false, $task))
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
export async function Path_isExecutable$(self_, $task) {
|
|
380
|
-
return (await ff_core_Path.Path_exists$(self_, false, false, true, $task))
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
export async function Path_isDirectory$(self_, $task) {
|
|
372
|
+
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
export async function Path_isReadable$(self_, $task) {
|
|
376
|
+
return (await ff_core_Path.Path_exists$(self_, true, false, false, $task))
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export async function Path_isWritable$(self_, $task) {
|
|
380
|
+
return (await ff_core_Path.Path_exists$(self_, false, true, false, $task))
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export async function Path_isExecutable$(self_, $task) {
|
|
384
|
+
return (await ff_core_Path.Path_exists$(self_, false, false, true, $task))
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export async function Path_isDirectory$(self_, $task) {
|
|
384
388
|
|
|
385
389
|
const fsPromises = import$1
|
|
386
390
|
try {
|
|
@@ -388,10 +392,10 @@ export async function Path_isDirectory$(self_, $task) {
|
|
|
388
392
|
} catch(e) {
|
|
389
393
|
return false;
|
|
390
394
|
}
|
|
391
|
-
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
export async function Path_isFile$(self_, $task) {
|
|
395
|
+
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export async function Path_isFile$(self_, $task) {
|
|
395
399
|
|
|
396
400
|
const fsPromises = import$1
|
|
397
401
|
try {
|
|
@@ -399,10 +403,10 @@ export async function Path_isFile$(self_, $task) {
|
|
|
399
403
|
} catch(e) {
|
|
400
404
|
return false;
|
|
401
405
|
}
|
|
402
|
-
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
export async function Path_isSymbolicLink$(self_, $task) {
|
|
406
|
+
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
export async function Path_isSymbolicLink$(self_, $task) {
|
|
406
410
|
|
|
407
411
|
const fsPromises = import$1
|
|
408
412
|
try {
|
|
@@ -410,32 +414,32 @@ export async function Path_isSymbolicLink$(self_, $task) {
|
|
|
410
414
|
} catch(e) {
|
|
411
415
|
return false;
|
|
412
416
|
}
|
|
413
|
-
|
|
414
|
-
}
|
|
415
|
-
|
|
416
|
-
export async function Path_isInsideOf$(self_, path_, $task) {
|
|
417
|
+
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export async function Path_isInsideOf$(self_, path_, $task) {
|
|
417
421
|
|
|
418
422
|
const path = import$2
|
|
419
423
|
if(path_ === '/') return true
|
|
420
424
|
const childPath = path.resolve(self_)
|
|
421
425
|
const parentPath = path.resolve(path_)
|
|
422
426
|
return childPath.startsWith(parentPath + path.sep) || childPath === parentPath
|
|
423
|
-
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
export async function Path_size$(self_, $task) {
|
|
427
|
+
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export async function Path_size$(self_, $task) {
|
|
427
431
|
|
|
428
432
|
return (await fs.promises.stat(file)).size
|
|
429
|
-
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
export async function Path_modified$(self_, $task) {
|
|
433
|
+
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
export async function Path_modified$(self_, $task) {
|
|
433
437
|
|
|
434
438
|
return (await fs.promises.stat(file)).mtimeMs * 0.001
|
|
435
|
-
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
export async function Path_entries$(self_, $task) {
|
|
439
|
+
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export async function Path_entries$(self_, $task) {
|
|
439
443
|
|
|
440
444
|
const fsPromises = import$1
|
|
441
445
|
let dir = null
|
|
@@ -451,165 +455,165 @@ export async function Path_entries$(self_, $task) {
|
|
|
451
455
|
if(dir !== null) await dir.close()
|
|
452
456
|
}
|
|
453
457
|
)
|
|
454
|
-
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
export async function Path_absolute$(self_, $task) {
|
|
458
|
+
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
export async function Path_absolute$(self_, $task) {
|
|
458
462
|
|
|
459
463
|
const path = import$2
|
|
460
464
|
return path.resolve(self_)
|
|
461
|
-
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
export async function Path_relativeTo$(self_, path_, $task) {
|
|
465
|
+
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
export async function Path_relativeTo$(self_, path_, $task) {
|
|
465
469
|
|
|
466
470
|
const path = import$2;
|
|
467
471
|
return path.relative(path_, self_);
|
|
468
|
-
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
export async function Path_endsWith$(self_, parts_, $task) {
|
|
472
|
-
async function go_$(pathOption_, reversed_, $task) {
|
|
473
|
-
{
|
|
474
|
-
const pathOption_a = pathOption_;
|
|
475
|
-
const reversed_a = reversed_;
|
|
476
|
-
{
|
|
477
|
-
if(reversed_a.Empty) {
|
|
478
|
-
return true
|
|
479
|
-
return
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
{
|
|
483
|
-
if(pathOption_a.Some) {
|
|
484
|
-
const path_ = pathOption_a.value_;
|
|
485
|
-
if(reversed_a.Link) {
|
|
486
|
-
const p_ = reversed_a.head_;
|
|
487
|
-
const ps_ = reversed_a.tail_;
|
|
488
|
-
return (((await ff_core_Path.Path_base$(path_, $task)) === p_) && (await go_$((await ff_core_Path.Path_parent$(path_, $task)), ps_, $task)))
|
|
489
|
-
return
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
{
|
|
494
|
-
if(pathOption_a.None) {
|
|
495
|
-
return false
|
|
496
|
-
return
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
return (await go_$(ff_core_Option.Some(self_), ff_core_List.List_reverse(parts_), $task))
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
export async function Path_base$(self_, $task) {
|
|
472
|
+
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
export async function Path_endsWith$(self_, parts_, $task) {
|
|
476
|
+
async function go_$(pathOption_, reversed_, $task) {
|
|
477
|
+
{
|
|
478
|
+
const pathOption_a = pathOption_;
|
|
479
|
+
const reversed_a = reversed_;
|
|
480
|
+
{
|
|
481
|
+
if(reversed_a.Empty) {
|
|
482
|
+
return true
|
|
483
|
+
return
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
{
|
|
487
|
+
if(pathOption_a.Some) {
|
|
488
|
+
const path_ = pathOption_a.value_;
|
|
489
|
+
if(reversed_a.Link) {
|
|
490
|
+
const p_ = reversed_a.head_;
|
|
491
|
+
const ps_ = reversed_a.tail_;
|
|
492
|
+
return (((await ff_core_Path.Path_base$(path_, $task)) === p_) && (await go_$((await ff_core_Path.Path_parent$(path_, $task)), ps_, $task)))
|
|
493
|
+
return
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
{
|
|
498
|
+
if(pathOption_a.None) {
|
|
499
|
+
return false
|
|
500
|
+
return
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
return (await go_$(ff_core_Option.Some(self_), ff_core_List.List_reverse(parts_), $task))
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
export async function Path_base$(self_, $task) {
|
|
505
509
|
|
|
506
510
|
const path = import$2
|
|
507
511
|
return path.basename(self_)
|
|
508
|
-
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
export async function Path_extension$(self_, $task) {
|
|
512
|
+
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
export async function Path_extension$(self_, $task) {
|
|
512
516
|
|
|
513
517
|
const path = import$2
|
|
514
518
|
return path.extname(self_)
|
|
515
|
-
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
export async function Path_url$(self_, $task) {
|
|
519
|
+
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
export async function Path_url$(self_, $task) {
|
|
519
523
|
|
|
520
524
|
const url = import$3;
|
|
521
525
|
return '' + url.pathToFileURL(self_);
|
|
522
|
-
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
export async function Path_delimiter$(self_, $task) {
|
|
526
|
+
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
export async function Path_delimiter$(self_, $task) {
|
|
526
530
|
|
|
527
531
|
const path = import$2;
|
|
528
532
|
return path.delimiter(self_);
|
|
529
|
-
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
export async function Path_separator$(self_, $task) {
|
|
533
|
+
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
export async function Path_separator$(self_, $task) {
|
|
533
537
|
|
|
534
538
|
const path = import$2;
|
|
535
539
|
return path.separator();
|
|
536
|
-
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
export async function Path_parent$(self_, $task) {
|
|
540
|
+
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export async function Path_parent$(self_, $task) {
|
|
540
544
|
|
|
541
545
|
const path = import$2
|
|
542
546
|
const result = path.dirname(self_)
|
|
543
547
|
return result !== "" && result !== self_
|
|
544
548
|
? ff_core_Option.Some(result)
|
|
545
549
|
: ff_core_Option.None()
|
|
546
|
-
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
export async function Path_slash$(self_, relativePath_, $task) {
|
|
550
|
+
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
export async function Path_slash$(self_, relativePath_, $task) {
|
|
550
554
|
|
|
551
555
|
const path = import$2
|
|
552
556
|
return path.join(self_, relativePath_)
|
|
553
|
-
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
export async function Path_path$(self_, absoluteOrRelativePath_, $task) {
|
|
557
|
+
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
export async function Path_path$(self_, absoluteOrRelativePath_, $task) {
|
|
557
561
|
|
|
558
562
|
const path = import$2
|
|
559
563
|
return path.resolve(self_, absoluteOrRelativePath_)
|
|
560
|
-
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
export async function Path_copyTo$(self_, path_, retries_ = 0, retryDelay_ = 100, $task) {
|
|
564
|
-
if((await ff_core_Path.Path_isDirectory$(self_, $task))) {
|
|
565
|
-
if((await ff_core_Path.Path_exists$(path_, false, false, false, $task))) {
|
|
566
|
-
(await ff_core_Path.Path_delete$(path_, retries_, retryDelay_, $task))
|
|
567
|
-
};
|
|
568
|
-
(await ff_core_Path.Path_createDirectory$(path_, false, $task));
|
|
569
|
-
(await ff_core_Stream.Stream_each$((await ff_core_Path.Path_entries$(self_, $task)), (async (file_, $task) => {
|
|
570
|
-
(await ff_core_Path.Path_copyTo$((await ff_core_Path.PathEntry_path$(file_, $task)), (await ff_core_Path.Path_slash$(path_, (await ff_core_Path.Path_relativeTo$((await ff_core_Path.PathEntry_path$(file_, $task)), self_, $task)), $task)), retries_, retryDelay_, $task))
|
|
571
|
-
}), $task))
|
|
572
|
-
} else {
|
|
573
|
-
(await ff_core_Path.Path_writeStream$(path_, (await ff_core_Path.Path_readStream$(self_, $task)), false, $task))
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
export async function Path_createDirectory$(self_, createParentDirectories_ = false, $task) {
|
|
564
|
+
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
export async function Path_copyTo$(self_, path_, retries_ = 0, retryDelay_ = 100, $task) {
|
|
568
|
+
if((await ff_core_Path.Path_isDirectory$(self_, $task))) {
|
|
569
|
+
if((await ff_core_Path.Path_exists$(path_, false, false, false, $task))) {
|
|
570
|
+
(await ff_core_Path.Path_delete$(path_, retries_, retryDelay_, $task))
|
|
571
|
+
};
|
|
572
|
+
(await ff_core_Path.Path_createDirectory$(path_, false, $task));
|
|
573
|
+
(await ff_core_Stream.Stream_each$((await ff_core_Path.Path_entries$(self_, $task)), (async (file_, $task) => {
|
|
574
|
+
(await ff_core_Path.Path_copyTo$((await ff_core_Path.PathEntry_path$(file_, $task)), (await ff_core_Path.Path_slash$(path_, (await ff_core_Path.Path_relativeTo$((await ff_core_Path.PathEntry_path$(file_, $task)), self_, $task)), $task)), retries_, retryDelay_, $task))
|
|
575
|
+
}), $task))
|
|
576
|
+
} else {
|
|
577
|
+
(await ff_core_Path.Path_writeStream$(path_, (await ff_core_Path.Path_readStream$(self_, $task)), false, $task))
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
export async function Path_createDirectory$(self_, createParentDirectories_ = false, $task) {
|
|
578
582
|
|
|
579
583
|
const fsPromises = import$1
|
|
580
584
|
await fsPromises.mkdir(self_, {recursive: createParentDirectories_})
|
|
581
|
-
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
export async function Path_createSymlinkTo$(self_, path_, $task) {
|
|
585
|
+
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
export async function Path_createSymlinkTo$(self_, path_, $task) {
|
|
585
589
|
|
|
586
590
|
const fsPromises = import$1
|
|
587
591
|
await fsPromises.symlink(path_, self_)
|
|
588
|
-
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
export async function Path_delete$(self_, retries_ = 0, retryDelay_ = 100, $task) {
|
|
592
|
+
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
export async function Path_delete$(self_, retries_ = 0, retryDelay_ = 100, $task) {
|
|
592
596
|
|
|
593
597
|
const fsPromises = import$1
|
|
594
598
|
await fsPromises.rm(self_, {recursive: true, retries: retries_, retryDelay: retryDelay_})
|
|
595
|
-
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
export async function Path_truncate$(self_, length_ = 0, $task) {
|
|
599
|
+
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
export async function Path_truncate$(self_, length_ = 0, $task) {
|
|
599
603
|
|
|
600
604
|
const fsPromises = import$1
|
|
601
605
|
await fsPromises.truncate(self_, length_)
|
|
602
|
-
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
export async function Path_renameTo$(self_, path_, $task) {
|
|
606
|
+
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
export async function Path_renameTo$(self_, path_, $task) {
|
|
606
610
|
|
|
607
611
|
const fsPromises = import$1
|
|
608
612
|
await fsPromises.rename(self_, path_)
|
|
609
|
-
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
export async function Path_readText$(self_, $task) {
|
|
613
|
+
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
export async function Path_readText$(self_, $task) {
|
|
613
617
|
|
|
614
618
|
const fsPromises = import$1
|
|
615
619
|
try {
|
|
@@ -617,10 +621,10 @@ export async function Path_readText$(self_, $task) {
|
|
|
617
621
|
} finally {
|
|
618
622
|
if($task.controller.signal.aborted) $task.controller = new AbortController()
|
|
619
623
|
}
|
|
620
|
-
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
export async function Path_writeText$(self_, text_, $task) {
|
|
624
|
+
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
export async function Path_writeText$(self_, text_, $task) {
|
|
624
628
|
|
|
625
629
|
const fsPromises = import$1
|
|
626
630
|
try {
|
|
@@ -628,10 +632,10 @@ export async function Path_writeText$(self_, text_, $task) {
|
|
|
628
632
|
} finally {
|
|
629
633
|
if($task.controller.signal.aborted) $task.controller = new AbortController()
|
|
630
634
|
}
|
|
631
|
-
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
export async function Path_appendText$(self_, text_, $task) {
|
|
635
|
+
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
export async function Path_appendText$(self_, text_, $task) {
|
|
635
639
|
|
|
636
640
|
const fsPromises = import$1
|
|
637
641
|
try {
|
|
@@ -639,29 +643,29 @@ export async function Path_appendText$(self_, text_, $task) {
|
|
|
639
643
|
} finally {
|
|
640
644
|
if($task.controller.signal.aborted) $task.controller = new AbortController()
|
|
641
645
|
}
|
|
642
|
-
|
|
643
|
-
}
|
|
644
|
-
|
|
645
|
-
export async function Path_readBuffer$(self_, $task) {
|
|
646
|
-
return (await ff_core_Stream.Stream_toBuffer$((await ff_core_Path.Path_readStream$(self_, $task)), $task))
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
export async function Path_writeBuffer$(self_, buffer_, $task) {
|
|
650
|
-
(await ff_core_Path.Path_writeStream$(self_, (await ff_core_List.List_toStream$(ff_core_List.Link(buffer_, ff_core_List.Empty()), false, $task)), false, $task))
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
export async function Path_appendBuffer$(self_, buffer_, $task) {
|
|
654
|
-
(await ff_core_Path.Path_appendStream$(self_, (await ff_core_List.List_toStream$(ff_core_List.Link(buffer_, ff_core_List.Empty()), false, $task)), $task))
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
export async function Path_readStream$(self_, $task) {
|
|
646
|
+
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
export async function Path_readBuffer$(self_, $task) {
|
|
650
|
+
return (await ff_core_Stream.Stream_toBuffer$((await ff_core_Path.Path_readStream$(self_, $task)), $task))
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
export async function Path_writeBuffer$(self_, buffer_, $task) {
|
|
654
|
+
(await ff_core_Path.Path_writeStream$(self_, (await ff_core_List.List_toStream$(ff_core_List.Link(buffer_, ff_core_List.Empty()), false, $task)), false, $task))
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
export async function Path_appendBuffer$(self_, buffer_, $task) {
|
|
658
|
+
(await ff_core_Path.Path_appendStream$(self_, (await ff_core_List.List_toStream$(ff_core_List.Link(buffer_, ff_core_List.Empty()), false, $task)), $task))
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
export async function Path_readStream$(self_, $task) {
|
|
658
662
|
|
|
659
663
|
const fs = import$0
|
|
660
664
|
return ff_core_Path.internalReadStream_$(() => fs.createReadStream(self_))
|
|
661
|
-
|
|
662
|
-
}
|
|
663
|
-
|
|
664
|
-
export async function Path_writeStream$(self_, stream_, createOnly_ = false, $task) {
|
|
665
|
+
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
export async function Path_writeStream$(self_, stream_, createOnly_ = false, $task) {
|
|
665
669
|
|
|
666
670
|
const fs = import$0
|
|
667
671
|
let writeable = fs.createWriteStream(self_, {flags: createOnly_ ? 'wx' : 'w'})
|
|
@@ -680,10 +684,10 @@ export async function Path_writeStream$(self_, stream_, createOnly_ = false, $ta
|
|
|
680
684
|
} finally {
|
|
681
685
|
writeable.close()
|
|
682
686
|
}
|
|
683
|
-
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
export async function Path_appendStream$(self_, stream_, $task) {
|
|
687
|
+
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
export async function Path_appendStream$(self_, stream_, $task) {
|
|
687
691
|
|
|
688
692
|
const fs = import$0
|
|
689
693
|
let writeable = fs.createWriteStream(self_, {flags: 'a'})
|
|
@@ -702,71 +706,71 @@ export async function Path_appendStream$(self_, stream_, $task) {
|
|
|
702
706
|
} finally {
|
|
703
707
|
writeable.close()
|
|
704
708
|
}
|
|
705
|
-
|
|
706
|
-
}
|
|
707
|
-
|
|
708
|
-
export async function Path_readHandle$(self_, alsoWrite_ = false, $task) {
|
|
709
|
+
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
export async function Path_readHandle$(self_, alsoWrite_ = false, $task) {
|
|
709
713
|
|
|
710
714
|
const fsPromises = import$1
|
|
711
715
|
return await fsPromises.open(self_, alsoWrite_ ? 'r+' : 'r')
|
|
712
|
-
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
export async function Path_writeHandle$(self_, alsoRead_ = false, mustCreate_ = false, $task) {
|
|
716
|
+
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
export async function Path_writeHandle$(self_, alsoRead_ = false, mustCreate_ = false, $task) {
|
|
716
720
|
|
|
717
721
|
const fsPromises = import$1
|
|
718
722
|
return await fsPromises.open(self_, (mustCreate_ ? 'wx' : 'w') + (alsoRead_ ? '+' : ''))
|
|
719
|
-
|
|
720
|
-
}
|
|
721
|
-
|
|
722
|
-
export async function Path_appendHandle$(self_, alsoRead_ = false, mustCreate_ = false, $task) {
|
|
723
|
+
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
export async function Path_appendHandle$(self_, alsoRead_ = false, mustCreate_ = false, $task) {
|
|
723
727
|
|
|
724
728
|
const fsPromises = import$1
|
|
725
729
|
return await fsPromises.open(self_, (mustCreate_ ? 'wx' : 'w') + (alsoRead_ ? '+' : ''))
|
|
726
|
-
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
export function PathEntry_path(self_) {
|
|
730
|
-
throw new Error('Function PathEntry_path is missing on this target in sync context.');
|
|
731
|
-
}
|
|
732
|
-
|
|
733
|
-
export function PathEntry_isDirectory(self_) {
|
|
734
|
-
throw new Error('Function PathEntry_isDirectory is missing on this target in sync context.');
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
export function PathEntry_isFile(self_) {
|
|
738
|
-
throw new Error('Function PathEntry_isFile is missing on this target in sync context.');
|
|
739
|
-
}
|
|
740
|
-
|
|
741
|
-
export function PathEntry_isSymbolicLink(self_) {
|
|
742
|
-
throw new Error('Function PathEntry_isSymbolicLink is missing on this target in sync context.');
|
|
743
|
-
}
|
|
744
|
-
|
|
745
|
-
export async function PathEntry_path$(self_, $task) {
|
|
730
|
+
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
export function PathEntry_path(self_) {
|
|
734
|
+
throw new Error('Function PathEntry_path is missing on this target in sync context.');
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
export function PathEntry_isDirectory(self_) {
|
|
738
|
+
throw new Error('Function PathEntry_isDirectory is missing on this target in sync context.');
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
export function PathEntry_isFile(self_) {
|
|
742
|
+
throw new Error('Function PathEntry_isFile is missing on this target in sync context.');
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
export function PathEntry_isSymbolicLink(self_) {
|
|
746
|
+
throw new Error('Function PathEntry_isSymbolicLink is missing on this target in sync context.');
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
export async function PathEntry_path$(self_, $task) {
|
|
746
750
|
|
|
747
751
|
const path = import$2
|
|
748
752
|
return path.join(self_.ffPath, self_.name)
|
|
749
|
-
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
export async function PathEntry_isDirectory$(self_, $task) {
|
|
753
|
+
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
export async function PathEntry_isDirectory$(self_, $task) {
|
|
753
757
|
|
|
754
758
|
return self_.isDirectory()
|
|
755
|
-
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
export async function PathEntry_isFile$(self_, $task) {
|
|
759
|
+
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
export async function PathEntry_isFile$(self_, $task) {
|
|
759
763
|
|
|
760
764
|
return self_.isFile()
|
|
761
|
-
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
export async function PathEntry_isSymbolicLink$(self_, $task) {
|
|
765
|
+
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
export async function PathEntry_isSymbolicLink$(self_, $task) {
|
|
765
769
|
|
|
766
770
|
return self_.isSymbolicLink()
|
|
767
|
-
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
771
|
+
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
|
|
775
|
+
|
|
776
|
+
|