Skip to content

Commit

Permalink
fix: yaml updater for array
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Feb 15, 2022
1 parent 7d4921e commit 536ea6e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main/utils/yaml-updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ function updateNode(doc: Document, node: Node, data: any) {
}
if (YAML.isSeq(node)) {
const items = [...node.items] as any[]
for (const index of items.keys()) {
Array.from(items.keys()).reduceRight((never, key, index) => {
node.deleteIn([index])
}
return never
}, undefined)
for (const value of data) {
const item = items.find(el => isEqual(el, value))
if (item) {
Expand Down

0 comments on commit 536ea6e

Please sign in to comment.