yves 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/yves.mjs +2 -1
- package/package.json +1 -1
package/lib/yves.mjs
CHANGED
|
@@ -128,7 +128,8 @@ function stringify(obj, options, ctx) {
|
|
|
128
128
|
switch (typeOf(obj)) {
|
|
129
129
|
case 'string': {
|
|
130
130
|
if (options?.templateStrings && !options?.json && /[\r\n\t\u0001-\u001F]/u.test(obj)) {
|
|
131
|
-
|
|
131
|
+
const escaped = options?.html ? htmlEscape(obj.replace(/`/g, '\\`')) : obj.replace(/`/g, '\\`')
|
|
132
|
+
return stylize('`' + escaped + '`', 'string')
|
|
132
133
|
}
|
|
133
134
|
const quoted = obj.indexOf("'") === -1 && !options?.json
|
|
134
135
|
? `'${obj.replace(/'/g, "\\'")}'`
|