Comparing version 1.5.0 to 1.5.1
@@ -12,2 +12,9 @@ # Changelog | ||
## [1.5.1] - 2022-02-19 | ||
- Fix default shell for Windows when `%COMSPEC%` is missing. | ||
- Fix escaping of `~` for certain input strings with `escape` and `escapeAll` | ||
when `interpolation` is set to `true` in the options. | ||
- Improve error messaging for certain non-string arguments. | ||
## [1.5.0] - 2022-02-14 | ||
@@ -14,0 +21,0 @@ |
@@ -11,3 +11,3 @@ /** | ||
* @module shescape | ||
* @version 1.5.0 | ||
* @version 1.5.1 | ||
* @license MPL-2.0 | ||
@@ -14,0 +14,0 @@ * @author Eric Cornelissen <ericornelissen@gmail.com> |
{ | ||
"name": "shescape", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "simple shell escape library", | ||
@@ -58,3 +58,3 @@ "homepage": "https://ericcornelissen.github.io/shescape/", | ||
"dotenv": "16.0.0", | ||
"fast-check": "2.21.0", | ||
"fast-check": "2.22.0", | ||
"husky": "7.0.4", | ||
@@ -66,3 +66,3 @@ "is-ci": "3.0.1", | ||
"prettier": "2.5.1", | ||
"rollup": "2.67.2", | ||
"rollup": "2.67.3", | ||
"sinon": "13.0.1" | ||
@@ -69,0 +69,0 @@ }, |
@@ -27,3 +27,8 @@ /** | ||
return typeof value.toString === "function"; | ||
if (typeof value.toString !== "function") { | ||
return false; | ||
} | ||
const str = value.toString(); | ||
return typeof str === "string"; | ||
} | ||
@@ -30,0 +35,0 @@ |
@@ -40,2 +40,7 @@ /** | ||
result = result.replace(/^=/gu, "\\=").replace(/(\[|\]|\{|\})/g, "\\$1"); | ||
} else { | ||
result = result.replace( | ||
/(?<=\=(?:.*?:)?)(~)(?=\:|\=|\-|\+|\/|0|\s|$)/g, | ||
"\\$1" | ||
); | ||
} | ||
@@ -42,0 +47,0 @@ |
@@ -86,3 +86,8 @@ /** | ||
export function getDefaultShell(env) { | ||
return env.ComSpec; | ||
// See: https://nodejs.org/api/child_process.html#default-windows-shell | ||
if (Object.prototype.hasOwnProperty.call(env, "ComSpec")) { | ||
return env.ComSpec; | ||
} | ||
return "cmd.exe"; | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
63179
938