yves 1.1.1 → 1.1.2
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/dist/yves.js +2 -1
- package/package.json +1 -1
package/dist/yves.js
CHANGED
|
@@ -3137,7 +3137,8 @@ function stringify(obj, options, ctx) {
|
|
|
3137
3137
|
case 'string':
|
|
3138
3138
|
{
|
|
3139
3139
|
if (options?.templateStrings && !options?.json && /[\r\n\t\u0001-\u001F]/u.test(obj)) {
|
|
3140
|
-
|
|
3140
|
+
const escaped = options?.html ? htmlEscape(obj.replace(/`/g, '\\`')) : obj.replace(/`/g, '\\`');
|
|
3141
|
+
return stylize('`' + escaped + '`', 'string');
|
|
3141
3142
|
}
|
|
3142
3143
|
const quoted = obj.indexOf("'") === -1 && !options?.json ? `'${obj.replace(/'/g, "\\'")}'` : `"${obj.replace(/"/g, '\\"')}"`;
|
|
3143
3144
|
return stylize(stringifyString(quoted, options), 'string');
|