Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions pages/builder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,15 @@ const validateFiles = async () => {
} else {
error.value = null;
// Parse appinfo.spixi
const appInfoFile = Array.from(filesMap.value.entries()).find(
([path]) => path.toLowerCase() === 'appinfo.spixi'
)?.[1];
// ⚑ Bolt Optimization: Use for...of instead of Array.from(map.entries()).find()
// to avoid unnecessary O(N) array allocation and reduce garbage collection pressure.
let appInfoFile;
for (const [path, file] of filesMap.value.entries()) {
if (path.toLowerCase() === 'appinfo.spixi') {
appInfoFile = file;
break;
}
}

if (appInfoFile) {
const text = await appInfoFile.text();
Expand Down Expand Up @@ -220,9 +226,15 @@ const packApp = async () => {
success.value = false;

try {
const iconFile = Array.from(filesMap.value.entries()).find(
([path]) => path.toLowerCase() === 'icon.png'
)?.[1];
// ⚑ Bolt Optimization: Use for...of instead of Array.from(map.entries()).find()
// to avoid unnecessary O(N) array allocation and reduce garbage collection pressure.
let iconFile;
for (const [path, file] of filesMap.value.entries()) {
if (path.toLowerCase() === 'icon.png') {
iconFile = file;
break;
}
}

// Use data from form
const appInfo = appFormData.value;
Expand Down