bare-module 7.5.3 → 7.5.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/lib/loader.js +1 -1
- package/lib/semaphore.js +23 -0
- package/package.json +2 -3
- package/prebuilds/android-arm/bare-module.bare +0 -0
- package/prebuilds/android-arm64/bare-module.bare +0 -0
- package/prebuilds/android-ia32/bare-module.bare +0 -0
- package/prebuilds/android-x64/bare-module.bare +0 -0
- package/prebuilds/darwin-arm64/bare-module.bare +0 -0
- package/prebuilds/darwin-x64/bare-module.bare +0 -0
- package/prebuilds/ios-arm64/bare-module.bare +0 -0
- package/prebuilds/ios-arm64-simulator/bare-module.bare +0 -0
- package/prebuilds/ios-x64-simulator/bare-module.bare +0 -0
- package/prebuilds/linux-arm64/bare-module.bare +0 -0
- package/prebuilds/linux-x64/bare-module.bare +0 -0
- package/prebuilds/win32-arm64/bare-module.bare +0 -0
- package/prebuilds/win32-x64/bare-module.bare +0 -0
package/lib/loader.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const Semaphore = require('promaphore')
|
|
2
1
|
const traverse = require('bare-module-traverse')
|
|
3
2
|
const { startsWithWindowsDriveLetter } = require('bare-module-resolve')
|
|
4
3
|
const lex = require('bare-module-lexer')
|
|
5
4
|
const hostParser = require('bare-host-parser')
|
|
6
5
|
const { isURL, pathToFileURL } = require('bare-url')
|
|
6
|
+
const Semaphore = require('./semaphore')
|
|
7
7
|
const { urlToPath } = require('./url')
|
|
8
8
|
const ModuleProtocol = require('./protocol')
|
|
9
9
|
const ModuleSource = require('./source')
|
package/lib/semaphore.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module.exports = class Semaphore {
|
|
2
|
+
constructor(limit) {
|
|
3
|
+
this.limit = limit
|
|
4
|
+
this.active = 0
|
|
5
|
+
this.waiting = []
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
wait() {
|
|
9
|
+
if (this.active < this.limit) {
|
|
10
|
+
this.active++
|
|
11
|
+
return Promise.resolve()
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return new Promise((resolve) => this.waiting.push(resolve))
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
signal() {
|
|
18
|
+
const next = this.waiting.shift()
|
|
19
|
+
|
|
20
|
+
if (next === undefined) this.active--
|
|
21
|
+
else next()
|
|
22
|
+
}
|
|
23
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bare-module",
|
|
3
|
-
"version": "7.5.
|
|
3
|
+
"version": "7.5.4",
|
|
4
4
|
"description": "The module system that powers Bare",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./package": "./package.json",
|
|
@@ -60,8 +60,7 @@
|
|
|
60
60
|
"bare-path": "^3.0.0",
|
|
61
61
|
"bare-type-stripper": "^0.1.2",
|
|
62
62
|
"bare-url": "^2.0.1",
|
|
63
|
-
"bare-wasm-abi": "^0.1.0"
|
|
64
|
-
"promaphore": "^1.0.0"
|
|
63
|
+
"bare-wasm-abi": "^0.1.0"
|
|
65
64
|
},
|
|
66
65
|
"devDependencies": {
|
|
67
66
|
"bare-buffer": "^3.0.2",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|