Socket
Socket
Sign inDemoInstall

machinepack-process

Package Overview
Dependencies
10
Maintainers
2
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.0.0 to 4.0.1

53

lib/escape-as-command-line-opt.js

@@ -61,9 +61,4 @@ module.exports = {

// Import `lodash`.
var _ = require('@sailshq/lodash');
// Import `machinepack-json`.
var MPJSON = require('machinepack-json');
// First, determine the string to escape.

@@ -79,3 +74,49 @@ var stringToEscape;

try {
stringToEscape = MPJSON.stringifySafe({value:inputs.value}).execSync();
// This was modified by @mikermcneil from @isaacs' json-stringify-safe
// (see https://github.com/isaacs/json-stringify-safe/commit/02cfafd45f06d076ac4bf0dd28be6738a07a72f9#diff-c3fcfbed30e93682746088e2ce1a4a24)
function serializer() {
var stack = [];
var keys = [];
// Function to replace circular references with a string describing the reference.
// Used by the custom stringify function below.
var cycleReplacer = function(key, value) {
if (stack[0] === value) {
return '[Circular ~]';
}
return '[Circular ~.' + keys.slice(0, stack.indexOf(value)).join('.') + ']';
};
// Return a custom stringify function to be used as the second argument
// to the native JSON.stringify.
return function(key, value) {
if (stack.length > 0) {
var thisPos = stack.indexOf(this);
~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
if (~stack.indexOf(value)) {
value = cycleReplacer.call(this, key, value);
}
}
else {
stack.push(value);
}
// Do some advanced serialization
if (_.isError(value)){
value = value.stack;
}
else if (_.isRegExp(value)){
value = value.toString();
}
else if (_.isFunction(value)){
value = value.toString();
}
return value;
};
}
// Serialize the string.
stringToEscape = JSON.stringify(inputs.value, serializer());
} catch (e) {

@@ -82,0 +123,0 @@ // If we couldn't stringify the value, exit through the `couldNotSerialize` exit.

2

lib/open-browser.js

@@ -25,3 +25,2 @@ module.exports = {

// Import `open` and `openBrowserAndNavigateToUrl`.
var openBrowserAndNavigateToUrl = require('opn');

@@ -32,3 +31,2 @@

// Return through the `success` exit.
return exits.success();

@@ -35,0 +33,0 @@ }

{
"name": "machinepack-process",
"version": "4.0.0",
"version": "4.0.1",
"description": "Work with child procs and the running process.",

@@ -20,3 +20,2 @@ "scripts": {

"machine": "^15.0.0-23",
"machinepack-json": "^2.0.0",
"opn": "5.3.0"

@@ -23,0 +22,0 @@ },

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc