Skip to content
Merged
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
16 changes: 4 additions & 12 deletions yaml/_loader_state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,7 @@ export class LoaderState {
const anchor = this.anchor;
const result: unknown[] = [];

if (this.anchor !== null && typeof this.anchor !== "undefined") {
this.anchorMap.set(this.anchor, result);
}
if (this.anchor !== null) this.anchorMap.set(this.anchor, result);

let ch = this.peek();

Expand Down Expand Up @@ -844,9 +842,7 @@ export class LoaderState {
return false;
}

if (this.anchor !== null && typeof this.anchor !== "undefined") {
this.anchorMap.set(this.anchor, result);
}
if (this.anchor !== null) this.anchorMap.set(this.anchor, result);

ch = this.next();

Expand Down Expand Up @@ -1122,9 +1118,7 @@ export class LoaderState {
let atExplicitKey = false;
let detected = false;

if (this.anchor !== null && typeof this.anchor !== "undefined") {
this.anchorMap.set(this.anchor, result);
}
if (this.anchor !== null) this.anchorMap.set(this.anchor, result);

let ch = this.peek();

Expand Down Expand Up @@ -1502,9 +1496,7 @@ export class LoaderState {
}

this.result = type.construct(this.result);
if (this.anchor !== null) {
this.anchorMap.set(this.anchor, this.result);
}
if (this.anchor !== null) this.anchorMap.set(this.anchor, this.result);
}
composeNode(
{ parentIndent, nodeContext, allowToSeek, allowCompact }: {
Expand Down
Loading