add jsesc options support (#8143)
This commit is contained in:
@@ -132,10 +132,7 @@ export function StringLiteral(node: Object) {
|
||||
}
|
||||
|
||||
// ensure the output is ASCII-safe
|
||||
const opts = {
|
||||
quotes: "double",
|
||||
wrap: true,
|
||||
};
|
||||
const opts = this.format.jsescOption;
|
||||
if (this.format.jsonCompatibleStrings) {
|
||||
opts.json = true;
|
||||
}
|
||||
|
||||
@@ -53,6 +53,11 @@ function normalizeOptions(code, opts): Format {
|
||||
base: 0,
|
||||
},
|
||||
decoratorsBeforeExport: !!opts.decoratorsBeforeExport,
|
||||
jsescOption: {
|
||||
quotes: "double",
|
||||
wrap: true,
|
||||
...opts.jsescOption,
|
||||
},
|
||||
};
|
||||
|
||||
if (format.minified) {
|
||||
|
||||
Reference in New Issue
Block a user