node-red-contrib-padavan 1.0.0 → 1.0.1
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/main.mjs +2 -1
- package/package.json +1 -1
package/main.mjs
CHANGED
|
@@ -246,7 +246,8 @@ export class Padavan {
|
|
|
246
246
|
if (!id)
|
|
247
247
|
id = (await this.getArtifact())?.id;
|
|
248
248
|
return this.github(`actions/artifacts/${id}/zip`).then(res => res.arrayBuffer()).then(jszip.loadAsync).then(zip => {
|
|
249
|
-
const
|
|
249
|
+
const regexp = new RegExp('(bin|trx)$');
|
|
250
|
+
const firmware = Object.values(zip.files).find(file => regexp.test(file.name));
|
|
250
251
|
return firmware.async('blob').then(blob => {
|
|
251
252
|
const data = new FormData();
|
|
252
253
|
data.append('file', blob, firmware.name);
|