Skip to content

Commit

Permalink
fix: component compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
solvedDev committed Sep 14, 2021
1 parent 67781c6 commit 344248f
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,15 @@ export class Component {
const keys = location.split('/')
const lastKey = keys.pop()!

let current = this.getObjAtLocation(fileContent, keys.join('/'))
const current = this.getObjAtLocation(fileContent, [...keys])

current[lastKey] = deepMerge(current[lastKey] ?? {}, template ?? {})
}
protected getObjAtLocation(fileContent: any, location: string) {
const keys = location.split('/')
protected getObjAtLocation(fileContent: any, location: string[]) {
let current: any = fileContent

while (keys.length > 0) {
const key = keys.shift()!
while (location.length > 0) {
const key = location.shift()!

if (current[key] === undefined) {
if (current[Number(key)] !== undefined) {
Expand Down Expand Up @@ -476,8 +475,7 @@ export class Component {
'Invalid component location inside of permutation'
)

const loc = keys.join('/')
const permutation = this.getObjAtLocation(fileContent, loc)
const permutation = this.getObjAtLocation(fileContent, [...keys])
const eventName = `bridge:${permutationEventName}_${type}`

if (permutation.condition)
Expand Down

0 comments on commit 344248f

Please sign in to comment.