@balena/open-balena-api 31.0.1-build-renovate-major-11-uuid-4626b9e62f44787c323fa23cfd16b3c17d27c192-1 → 31.0.1-build-no-delay-last-7b7ea8bd93d7995f70ed7317c3a7309e03caa59a-1

Sign up to get free protection for your applications and to get access to all the features.
package/dist/lib/utils.js CHANGED
@@ -56,12 +56,29 @@ export const getBase64DataUri = async (filePath, mimeType) => {
56
56
  export const b64decode = (str) => Buffer.from(str, 'base64').toString().trim();
57
57
  export const throttledForEach = async (array, delayMS, fn) => {
58
58
  const promises = [];
59
+ const runFn = async (item) => {
60
+ try {
61
+ const p = fn(item);
62
+ promises.push(p);
63
+ await p;
64
+ }
65
+ catch {
66
+ // Ignore, the caller can handle the error if it needs to but
67
+ // due to the delays if we don't add a catch handler here then
68
+ // it'll always be treated as an unhandled error
69
+ }
70
+ };
71
+ // Handle the last item separately so we don't add a delay after it
72
+ const lastItem = array.pop();
59
73
  for (const item of array) {
60
74
  // We do not wait for each individual fn, we just throttle the calling of them
61
- promises.push(fn(item));
75
+ void runFn(item);
62
76
  // Delay by the throttle rate before we continue to the next item
63
77
  await setTimeout(delayMS);
64
78
  }
79
+ if (lastItem != null) {
80
+ void runFn(lastItem);
81
+ }
65
82
  // We return the results of the iterator so the caller can await them as necessary
66
83
  return await Promise.all(promises);
67
84
  };
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,wFAAwF;AACxF,iFAAiF;AACjF,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,QAAQ,GAAG,OAAO,CAAC,M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AY,EAAE,QAAwB,EAAE,EAAE;IAC1E,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC7B,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC5B,IAAI,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,QAAQ,IAAI,IAAI,EAAE,CAAC;YACtB,QAAQ,GAAG,EAAE,CAAC;YACd,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC3B,CAAC;QACD,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAClC,GAAY,EACZ,SAAiB,EACjB,YAAqB,EACpB,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@balena/open-balena-api",
3
3
  "description": "Internet of things, Made Simple",
4
- "version": "31.0.1-build-renovate-major-11-uuid-4626b9e62f44787c323fa23cfd16b3c17d27c192-1",
4
+ "version": "31.0.1-build-no-delay-last-7b7ea8bd93d7995f70ed7317c3a7309e03caa59a-1",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -130,7 +130,7 @@
130
130
  "ts-node": "^10.9.2",
131
131
  "typed-error": "^3.2.2",
132
132
  "typescript": "^5.6.3",
133
- "uuid": "^11.0.0",
133
+ "uuid": "^10.0.0",
134
134
  "validator": "^13.12.0"
135
135
  },
136
136
  "devDependencies": {
@@ -167,6 +167,6 @@
167
167
  "loader": "ts-node/esm/transpile-only"
168
168
  },
169
169
  "versionist": {
170
- "publishedAt": "2024-10-31T17:07:11.920Z"
170
+ "publishedAt": "2024-11-01T13:22:45.812Z"
171
171
  }
172
172
  }