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.4.0 to 1.5.0

src/executables.js

4

CHANGELOG.md

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

## [1.5.0] - 2022-02-14
- Follow symbolic links when determining the shell to escape for.
## [1.4.0] - 2022-02-08

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

2

index.js

@@ -11,3 +11,3 @@ /**

* @module shescape
* @version 1.4.0
* @version 1.5.0
* @license MPL-2.0

@@ -14,0 +14,0 @@ * @author Eric Cornelissen <ericornelissen@gmail.com>

{
"name": "shescape",
"version": "1.4.0",
"version": "1.5.0",
"description": "simple shell escape library",

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

],
"dependencies": {
"which": "^2.0.0"
},
"devDependencies": {

@@ -63,3 +66,4 @@ "@stryker-mutator/core": "5.6.1",

"prettier": "2.5.1",
"rollup": "2.67.1"
"rollup": "2.67.2",
"sinon": "13.0.1"
},

@@ -66,0 +70,0 @@ "engines": {

@@ -21,3 +21,3 @@ # Shescape

- Zero dependencies
- Advanced shell detection
- Lightweight

@@ -24,0 +24,0 @@ - Supports MacOS, Linux, and Windows

@@ -8,3 +8,7 @@ /**

import * as fs from "fs";
import which from "which";
import { typeError, win32 } from "./constants.js";
import { resolveExecutable } from "./executables.js";
import * as unix from "./unix.js";

@@ -36,12 +40,23 @@ import * as win from "./win.js";

function getShell(platform, env, shell) {
if (shell !== undefined) {
return shell;
if (shell === undefined) {
switch (platform) {
case win32:
shell = win.getDefaultShell(env);
break;
default:
shell = unix.getDefaultShell();
break;
}
}
switch (platform) {
case win32:
return win.getDefaultShell(env);
default:
return unix.getDefaultShell();
}
return resolveExecutable(
{
executable: shell,
},
{
exists: fs.existsSync,
readlink: fs.readlinkSync,
which: which.sync,
}
);
}

@@ -48,0 +63,0 @@

Sorry, the diff of this file is not supported yet

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