Skip to content

Commit

Permalink
fix: Folder's named "constructor" not being included in asar (#8286)
Browse files Browse the repository at this point in the history
  • Loading branch information
beyondkmp authored Jul 1, 2024
1 parent 81da7c1 commit 4a4023c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/lazy-buttons-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"app-builder-lib": patch
---

fix Folder's named "constructor" not being included in asar
8 changes: 4 additions & 4 deletions packages/app-builder-lib/src/asar/asar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class AsarFilesystem {
readonly headerSize: number = -1
) {
if (this.header.files == null) {
this.header.files = {}
this.header.files = Object.create(null) as { [key: string]: Node }
}
}

Expand All @@ -54,7 +54,7 @@ export class AsarFilesystem {
return null
}
child = new Node()
child.files = {}
child.files = Object.create(null) as { [key: string]: Node }
node.files![dir] = child
}
node = child
Expand All @@ -71,7 +71,7 @@ export class AsarFilesystem {
const name = path.basename(p)
const dirNode = this.searchNodeFromDirectory(path.dirname(p), true)!
if (dirNode.files == null) {
dirNode.files = {}
dirNode.files = Object.create(null) as { [key: string]: Node }
}

let result = dirNode.files[name]
Expand Down Expand Up @@ -105,7 +105,7 @@ export class AsarFilesystem {

let children = dirNode.files
if (children == null) {
children = {}
children = Object.create(null) as { [key: string]: Node }
dirNode.files = children
}
children[path.basename(file)] = node
Expand Down

0 comments on commit 4a4023c

Please sign in to comment.