functionalscript 0.0.507 → 0.0.508
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/dev/module.mjs +3 -6
- package/package.json +1 -1
package/dev/module.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { readdir, readFile } from 'node:fs/promises'
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* @typedef {{
|
|
3
5
|
* readonly withFileTypes: true
|
|
@@ -78,9 +80,6 @@ const remove_tail = v => dif => v.slice(0, v.length - dif)
|
|
|
78
80
|
/** @type {any} */
|
|
79
81
|
const self = globalThis
|
|
80
82
|
|
|
81
|
-
/** @type {() => Promise<FsPromises>} */
|
|
82
|
-
export const fs = () => import(self.Deno ? 'https://deno.land/std@0.177.0/node/fs/promises.ts' : 'node:fs/promises')
|
|
83
|
-
|
|
84
83
|
/** @type {(code: number) => never} */
|
|
85
84
|
export const exit = self.Deno ? self.Deno.exit : process.exit
|
|
86
85
|
|
|
@@ -95,8 +94,6 @@ export const env =
|
|
|
95
94
|
}
|
|
96
95
|
|
|
97
96
|
export const loadModuleMap = async () => {
|
|
98
|
-
const { readdir, readFile } = await fs();
|
|
99
|
-
|
|
100
97
|
/** @type {() => Promise<FunctionMap>} */
|
|
101
98
|
const load = async () => {
|
|
102
99
|
/** @type {(readonly[string, Function])[]} */
|
|
@@ -167,4 +164,4 @@ export const loadModuleMap = async () => {
|
|
|
167
164
|
}
|
|
168
165
|
|
|
169
166
|
return build()
|
|
170
|
-
}
|
|
167
|
+
}
|