functionalscript 0.6.5 → 0.6.6
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/djs/transpiler/test.f.js +1 -1
- package/io/module.f.d.ts +11 -10
- package/io/module.js +1 -0
- package/io/virtual/module.f.d.ts +3 -0
- package/io/{virtual.f.js → virtual/module.f.js} +2 -1
- package/package.json +1 -1
- package/io/virtual.f.d.ts +0 -3
package/djs/transpiler/test.f.js
CHANGED
|
@@ -2,7 +2,7 @@ import { sort } from "../../types/object/module.f.js";
|
|
|
2
2
|
import { setReplace } from "../../types/ordered_map/module.f.js";
|
|
3
3
|
import { transpile } from "./module.f.js";
|
|
4
4
|
import { stringify } from "../serializer/module.f.js";
|
|
5
|
-
import { createVirtualIo } from "../../io/virtual.f.js";
|
|
5
|
+
import { createVirtualIo } from "../../io/virtual/module.f.js";
|
|
6
6
|
const virtualFs = map => {
|
|
7
7
|
return createVirtualIo(map).fs;
|
|
8
8
|
};
|
package/io/module.f.d.ts
CHANGED
|
@@ -60,6 +60,16 @@ export type Module = {
|
|
|
60
60
|
export type Performance = {
|
|
61
61
|
readonly now: () => number;
|
|
62
62
|
};
|
|
63
|
+
/**
|
|
64
|
+
* Node.js Process interface
|
|
65
|
+
* @see https://nodejs.org/api/process.html
|
|
66
|
+
*/
|
|
67
|
+
export type Process = {
|
|
68
|
+
readonly argv: string[];
|
|
69
|
+
readonly env: Env;
|
|
70
|
+
readonly exit: (code: number) => never;
|
|
71
|
+
readonly cwd: () => string;
|
|
72
|
+
};
|
|
63
73
|
/**
|
|
64
74
|
* Core IO operations interface providing access to system resources
|
|
65
75
|
*/
|
|
@@ -69,19 +79,10 @@ export type Io = {
|
|
|
69
79
|
readonly process: Process;
|
|
70
80
|
readonly asyncImport: (s: string) => Promise<Module>;
|
|
71
81
|
readonly performance: Performance;
|
|
82
|
+
readonly fetch: (url: string) => Promise<Response>;
|
|
72
83
|
readonly tryCatch: <T>(f: () => T) => Result<T, unknown>;
|
|
73
84
|
readonly asyncTryCatch: <T>(f: () => Promise<T>) => Promise<Result<T, unknown>>;
|
|
74
85
|
};
|
|
75
|
-
/**
|
|
76
|
-
* Node.js Process interface
|
|
77
|
-
* @see https://nodejs.org/api/process.html
|
|
78
|
-
*/
|
|
79
|
-
export type Process = {
|
|
80
|
-
readonly argv: string[];
|
|
81
|
-
readonly env: Env;
|
|
82
|
-
readonly exit: (code: number) => never;
|
|
83
|
-
readonly cwd: () => string;
|
|
84
|
-
};
|
|
85
86
|
/**
|
|
86
87
|
* The environment variables.
|
|
87
88
|
*/
|
package/io/module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { at } from "
|
|
1
|
+
import { at } from "../../types/ordered_map/module.f.js";
|
|
2
2
|
export const createVirtualIo = (files) => ({
|
|
3
3
|
console: {
|
|
4
4
|
log: (..._d) => { },
|
|
@@ -27,6 +27,7 @@ export const createVirtualIo = (files) => ({
|
|
|
27
27
|
performance: {
|
|
28
28
|
now: () => 0,
|
|
29
29
|
},
|
|
30
|
+
fetch: () => Promise.reject(),
|
|
30
31
|
tryCatch: f => ['ok', f()],
|
|
31
32
|
asyncTryCatch: async (f) => ['ok', await f()],
|
|
32
33
|
});
|
package/package.json
CHANGED
package/io/virtual.f.d.ts
DELETED