Skip to content

Commit 89d4ffd

Browse files
charlespwdclaude
andcommitted
Fix const reassignment error in standalone build
Inline `isNode` into `hasOrIsNode` to prevent terser from creating problematic const reassignment when building standalone bundle. Fixes #1109 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent b1bca3f commit 89d4ffd

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

packages/prettier-plugin-liquid/src/printer/printer-liquid-html.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,6 @@ function hasOrIsNode<N extends LiquidHtmlNode, K extends keyof N>(node: N, key:
632632
const v = node[key];
633633
// this works because there's no ()[] type that is string | Node, it only
634634
// happens for singular nodes such as name: string | LiquidDrop, etc.
635-
return Array.isArray(v) || isNode(v);
636-
}
637-
638-
function isNode(x: unknown): x is LiquidHtmlNode {
639-
return x !== null && typeof x === 'object' && 'type' in x && typeof x.type === 'string';
635+
// Note: isNode logic inlined to avoid terser const reassignment in standalone build
636+
return Array.isArray(v) || (v !== null && typeof v === 'object' && 'type' in v && typeof v.type === 'string');
640637
}

0 commit comments

Comments
 (0)