File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ "scope" : {
3
+ "@typescript-eslint/parser" : " >=6.5.0"
4
+ }
5
+ }
Original file line number Diff line number Diff line change @@ -565,21 +565,20 @@ function normalizeObject(value: any) {
565
565
}
566
566
567
567
export function sortJson ( pJson : any ) : any {
568
- function tryParse ( ) {
568
+ function tryParse ( ) : { isJson : boolean ; json : any | null } {
569
569
if ( Array . isArray ( pJson ) || typeof pJson === "object" ) {
570
- return [ true , pJson ] ;
570
+ return { isJson : true , json : pJson } ;
571
571
}
572
572
try {
573
573
const json = JSON . parse ( pJson ) ;
574
- return [ true , json ] ;
574
+ return { isJson : true , json } ;
575
575
} catch {
576
- return [ false , null ] ;
576
+ return { isJson : false , json : null } ;
577
577
}
578
578
}
579
579
580
- const [ isJson , json ] = tryParse ( ) ;
580
+ const { isJson, json } = tryParse ( ) ;
581
581
if ( ! isJson ) return pJson ;
582
- // プロパティの順序をソートする
583
582
if ( Array . isArray ( json ) ) {
584
583
return json . map ( sortJson ) ;
585
584
}
You can’t perform that action at this time.
0 commit comments