@markw65/monkeyc-optimizer 1.0.8 → 1.0.9
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/README.md +10 -0
- package/build/api.cjs +7 -7191
- package/build/optimizer.cjs +40 -79
- package/build/sdk-util.cjs +7245 -0
- package/build/util.cjs +19 -9
- package/package.json +3 -2
package/build/util.cjs
CHANGED
|
@@ -4093,19 +4093,29 @@ function readByLine(file, lineHandler) {
|
|
|
4093
4093
|
);
|
|
4094
4094
|
}
|
|
4095
4095
|
|
|
4096
|
-
async function promiseAll(
|
|
4096
|
+
async function promiseAll(promiseFn, parallelism) {
|
|
4097
4097
|
parallelism = parallelism || 4;
|
|
4098
4098
|
const serializer = [];
|
|
4099
4099
|
const results = [];
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4100
|
+
let done = false;
|
|
4101
|
+
let i = 0;
|
|
4102
|
+
const next = () => {
|
|
4103
|
+
const index = i++;
|
|
4104
|
+
if (done) return;
|
|
4105
|
+
const promise = promiseFn(index);
|
|
4106
|
+
if (!promise) {
|
|
4107
|
+
done = true;
|
|
4108
|
+
return;
|
|
4107
4109
|
}
|
|
4108
|
-
|
|
4110
|
+
return promise
|
|
4111
|
+
.then((r) => {
|
|
4112
|
+
results[index] = r;
|
|
4113
|
+
})
|
|
4114
|
+
.then(next);
|
|
4115
|
+
};
|
|
4116
|
+
while (i < parallelism) {
|
|
4117
|
+
serializer.push(next());
|
|
4118
|
+
}
|
|
4109
4119
|
return Promise.all(serializer).then(() => results);
|
|
4110
4120
|
}
|
|
4111
4121
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markw65/monkeyc-optimizer",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.9",
|
|
5
5
|
"description": "Source to source optimizer for Garmin Monkey C code",
|
|
6
6
|
"main": "build/optimizer.cjs",
|
|
7
7
|
"exports": {
|
|
@@ -19,12 +19,13 @@
|
|
|
19
19
|
"files": [
|
|
20
20
|
"build/optimizer.cjs",
|
|
21
21
|
"build/util.cjs",
|
|
22
|
+
"build/sdk-util.cjs",
|
|
22
23
|
"build/api.cjs"
|
|
23
24
|
],
|
|
24
25
|
"author": "markw65",
|
|
25
26
|
"license": "MIT",
|
|
26
27
|
"dependencies": {
|
|
27
|
-
"@markw65/prettier-plugin-monkeyc": "^1.0.
|
|
28
|
+
"@markw65/prettier-plugin-monkeyc": "^1.0.15"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"eslint": "^8.12.0",
|