Fixed error with output
This commit is contained in:
parent
8a1ea6f029
commit
856d05558c
14
src/utils.ts
14
src/utils.ts
@ -648,17 +648,9 @@ export const jsonOutput = ({
|
||||
value: string | string[]
|
||||
escape: boolean
|
||||
}): string => {
|
||||
return JSON.stringify(value, (key, value) => {
|
||||
if (typeof value === 'string') {
|
||||
// if escape is true, escape quotes and backslashes
|
||||
return escape ? value.replace(/\\/g, '\\\\').replace(/"/g, '\\"') : value
|
||||
} else if (Array.isArray(value)) {
|
||||
return escape
|
||||
? value.map(v => v.replace(/\\/g, '\\\\').replace(/"/g, '\\"'))
|
||||
: value
|
||||
}
|
||||
return value
|
||||
})
|
||||
let result = JSON.stringify(value)
|
||||
|
||||
return escape ? result.replace(/"/g, '\\"') : result
|
||||
}
|
||||
|
||||
export const getFilePatterns = async ({
|
||||
|
Loading…
x
Reference in New Issue
Block a user