mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-20 00:24:24 +01:00
Switch to BiomeJS (#306)
This commit is contained in:
@@ -118,7 +118,7 @@ export function filterJSONPath(
|
||||
path: string,
|
||||
result: JSONPathResult,
|
||||
join: string | null,
|
||||
formatted: boolean = false,
|
||||
formatted = false,
|
||||
): string {
|
||||
const parsed = JSON.parse(body);
|
||||
let items = JSONPath({ path, json: parsed });
|
||||
@@ -138,13 +138,12 @@ export function filterJSONPath(
|
||||
return objToStr(items, formatted);
|
||||
}
|
||||
|
||||
function objToStr(o: unknown, formatted: boolean = false): string {
|
||||
function objToStr(o: unknown, formatted = false): string {
|
||||
if (
|
||||
Object.prototype.toString.call(o) === '[object Array]' ||
|
||||
Object.prototype.toString.call(o) === '[object Object]'
|
||||
) {
|
||||
return formatted ? JSON.stringify(o, null, 2) : JSON.stringify(o);
|
||||
} else {
|
||||
return String(o);
|
||||
}
|
||||
return String(o);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user