@stll/template-conditions 0.5.2 → 0.5.3
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/index.js +5 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1430,7 +1430,11 @@ const unwritableMarkerLiteral = (value, form = "output") => {
|
|
|
1430
1430
|
/** One string literal, double-quoted, with backslashes and quotes escaped the
|
|
1431
1431
|
* way `scanQuoted` reads them back. */
|
|
1432
1432
|
const renderString = (value) => `"${value.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"")}"`;
|
|
1433
|
-
const renderLiteral = (value) =>
|
|
1433
|
+
const renderLiteral = (value) => {
|
|
1434
|
+
if (typeof value === "string") return renderString(value);
|
|
1435
|
+
if (typeof value === "number" && Object.is(value, -0)) return "-0";
|
|
1436
|
+
return String(value);
|
|
1437
|
+
};
|
|
1434
1438
|
const renderArgument = (arg) => arg.kind === "positional" ? renderLiteral(arg.value) : `${arg.name}=${renderLiteral(arg.value)}`;
|
|
1435
1439
|
/** Every value in a chain the grammar has no spelling for, with the filter it
|
|
1436
1440
|
* was written on and why, so a caller can refuse a configuration before it
|
package/package.json
CHANGED