@tapjs/processinfo 1.0.6 → 1.0.7

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 (2) hide show
  1. package/lib/esm.mjs +6 -10
  2. package/package.json +1 -1
package/lib/esm.mjs CHANGED
@@ -7,18 +7,14 @@ import './cjs.cjs'
7
7
  const processInfo = getProcessInfo()
8
8
  const exclude = getExclude('_TAPJS_PROCESSINFO_EXCLUDE_')
9
9
 
10
- let others = Promise.all(
10
+ let others = await Promise.all(
11
11
  [...new URL(import.meta.url).searchParams.keys()].map(s =>
12
12
  import(s).catch(() => ({}))
13
13
  )
14
- ).then(o => others = o)
14
+ )
15
15
 
16
- let hasLoad = (async () =>
17
- (await others).filter(loader => typeof loader.load === 'function'))()
18
- .then(has => hasLoad = has)
19
- let hasResolve = (async () =>
20
- (await others).filter(loader => typeof loader.resolve === 'function'))()
21
- .then(has => hasResolve = has)
16
+ let hasLoad = others.filter(loader => typeof loader.load === 'function')
17
+ let hasResolve = others.filter(loader => typeof loader.resolve === 'function')
22
18
 
23
19
  const myLoad = defaultFn => async (url, context) => {
24
20
  if (/^file:/.test(url)) {
@@ -31,10 +27,10 @@ const myLoad = defaultFn => async (url, context) => {
31
27
  }
32
28
 
33
29
  export const load = async (url, context, defaultFn) =>
34
- runAll(await hasLoad, 'load', url, context, myLoad(defaultFn))
30
+ runAll(hasLoad, 'load', url, context, myLoad(defaultFn))
35
31
 
36
32
  export const resolve = async (url, context, defaultFn) =>
37
- runAll(await hasResolve, 'resolve', url, context, defaultFn)
33
+ runAll(hasResolve, 'resolve', url, context, defaultFn)
38
34
 
39
35
  const runAll = async (set, method, url, context, defaultFn, i = 0) => {
40
36
  if (i >= set.length) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapjs/processinfo",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "main": "lib/index.cjs",
5
5
  "files": [
6
6
  "index.d.ts",