Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

shescape

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shescape - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

4

CHANGELOG.md

@@ -12,2 +12,6 @@ # Changelog

## [1.1.1] - 2020-12-30
- Improve error message when a value is not stringable.
## [1.1.0] - 2020-12-22

@@ -14,0 +18,0 @@

2

package.json
{
"name": "shescape",
"version": "1.1.0",
"version": "1.1.1",
"description": "simple shell escape library",

@@ -5,0 +5,0 @@ "homepage": "https://ericcornelissen.github.io/shescape/",

@@ -0,1 +1,3 @@

module.exports.typeError =
"Shescape requires strings or values that can be converted into a string using .toString()";
module.exports.win32 = "win32";

@@ -1,7 +0,23 @@

const { win32 } = require("./constants.js");
const { typeError, win32 } = require("./constants.js");
const unix = require("./unix.js");
const win = require("./win.js");
function isStringable(value) {
if (value === undefined || value === null) {
return false;
}
return typeof value.toString === "function";
}
function escapeShellArgByPlatform(arg, platform) {
const argAsString = arg.toString();
let argAsString = arg;
if (typeof arg !== "string") {
if (!isStringable(arg)) {
throw new TypeError(typeError);
}
argAsString = arg.toString();
}
switch (platform) {

@@ -8,0 +24,0 @@ case win32:

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc