From 51d083ccdcb8c37c788d791288c492c6a512aa42 Mon Sep 17 00:00:00 2001 From: Tim Date: Sat, 27 Dec 2025 01:30:38 +0100 Subject: [PATCH] initial commit --- yaml/_loader_state.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/yaml/_loader_state.ts b/yaml/_loader_state.ts index f6115a79fe08..eca9b601d0ac 100644 --- a/yaml/_loader_state.ts +++ b/yaml/_loader_state.ts @@ -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(); @@ -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(); @@ -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(); @@ -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 }: {