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

jsh

Package Overview
Dependencies
Maintainers
1
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsh - npm Package Compare versions

Comparing version 0.1.33 to 0.1.34

lib/util/escape-shell.js

8

lib/completion.js

@@ -6,3 +6,3 @@ var fs = require('fs'),

breakUpCommand = require('./util/break-up-command'),
escapeSpaces = require('./util/escape-spaces'),
escapeShell = require('./util/escape-shell'),
firstWord = require('./util/first-word'),

@@ -200,9 +200,9 @@ extractJs = require('./util/extract-js'),

possibilities.directories.forEach(function (v) {
ret.push(escapeSpaces(v) + '/');
ret.push(escapeShell(v) + '/');
});
possibilities.files.forEach(function (v) {
ret.push(escapeSpaces(v) + ' ');
ret.push(escapeShell(v) + ' ');
});
possibilities.executables.forEach(function (v) {
ret.push(escapeSpaces(v) + ' ');
ret.push(escapeShell(v) + ' ');
});

@@ -209,0 +209,0 @@ possibilities.js.forEach(function (v) {

var fs = require('fs'),
path = require('path'),
escapeRegExp = require('../util/escape-regexp'),
escapeSpaces = require('../util/escape-spaces'),
inJavaScript = require('../util/in-javascript'),

@@ -6,0 +5,0 @@ extractJs = require('../util/extract-js'),

{
"name": "jsh",
"version": "0.1.33",
"version": "0.1.34",
"description": "The JavaScript shell interpreter.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -36,3 +36,3 @@ var vm = require('vm'),

addNewlines = require('../lib/util/add-newlines'),
escapeSpaces = require('../lib/util/escape-spaces'),
escapeShell = require('../lib/util/escape-shell'),
stripSemicolon = require('../lib/util/strip-semicolon'),

@@ -74,4 +74,5 @@ breakUpCommand = require('../lib/util/break-up-command'),

});
it('should escape spaces', function () {
expect(escapeSpaces('vim file')).to.equal('vim\\ file');
it('should escape shell commands', function () {
expect(escapeShell('vim file')).to.equal('vim\\ file');
expect(escapeShell('Edge of Tomorrow (2014) [1080p]/')).to.equal('Edge\\ of\\ Tomorrow\\ \\(2014\\)\\ \\[1080p\\]/')
});

@@ -78,0 +79,0 @@ it('should break up a command into parts', function () {

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