Another place

This commit is contained in:
fisker committed 2026-01-18 02:23:34 +08:00
1 parent 7f5c18d719
commit 0bc2286c9d
1 file changed
+1 -7
+1 -7
View File
@@ -2,12 +2,6 @@ import * as assert from "#universal/assert";
import { childNodesCache } from "./comments/attach.js";
import getSortedChildNodes from "./utilities/get-sorted-child-nodes.js";
const isJsonParser = ({ parser }) =>
parser === "json" ||
parser === "json5" ||
parser === "jsonc" ||
parser === "json-stringify";
function findCommonAncestor(startNodeAndAncestors, endNodeAndAncestors) {
endNodeAndAncestors = new Set(endNodeAndAncestors);
return startNodeAndAncestors.find(
@@ -242,7 +236,7 @@ function calculateRange(text, opts, ast) {
let startNode;
let endNode;
if (isJsonParser(opts)) {
if (ast.type === "JsonRoot") {
const commonAncestor = findCommonAncestor(
startNodeAndAncestors,
endNodeAndAncestors,