Skip to content

Commit 8cc981c

Browse files
committed
how about now
1 parent cd492b6 commit 8cc981c

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"scope": {
3+
"@typescript-eslint/parser": ">=6.5.0"
4+
}
5+
}

tests/src/parser/test-utils.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -565,21 +565,20 @@ function normalizeObject(value: any) {
565565
}
566566

567567
export function sortJson(pJson: any): any {
568-
function tryParse() {
568+
function tryParse(): { isJson: boolean; json: any | null } {
569569
if (Array.isArray(pJson) || typeof pJson === "object") {
570-
return [true, pJson];
570+
return { isJson: true, json: pJson };
571571
}
572572
try {
573573
const json = JSON.parse(pJson);
574-
return [true, json];
574+
return { isJson: true, json };
575575
} catch {
576-
return [false, null];
576+
return { isJson: false, json: null };
577577
}
578578
}
579579

580-
const [isJson, json] = tryParse();
580+
const { isJson, json } = tryParse();
581581
if (!isJson) return pJson;
582-
// プロパティの順序をソートする
583582
if (Array.isArray(json)) {
584583
return json.map(sortJson);
585584
}

0 commit comments

Comments
 (0)