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

machine

Package Overview
Dependencies
Maintainers
5
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

machine - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

40

lib/Machine.prototype.execSync.js

@@ -14,2 +14,5 @@ /**

var self = this;
var identity = this.identity;
// If machine definition did not explicitly flag itself as synchronous,

@@ -19,3 +22,3 @@ // prevent this usage.

throw (function (){
var _err = new Error('Cannot use `.execSync()` with `'+this.identity+'` machine because it does not enable synchronous usage (i.e. `sync:true`)');
var _err = new Error('Cannot use `.execSync()` with `'+identity+'` machine because it does not enable synchronous usage (i.e. `sync:true`)');
_err.code = 'E_USAGE';

@@ -33,11 +36,36 @@ return _err;

var isMachineActuallySynchronousCv = false;
this.exec(function (_err, _result){
isMachineActuallySynchronousCv = true;
err = _err;
result = _result;
var exitCallbacks = {
success: function (_result){
isMachineActuallySynchronousCv = true;
result = _result;
},
error: function (_err){
isMachineActuallySynchronousCv = true;
err = _err;
}
};
// Apply default exit
exitCallbacks[this.defaultExit||'success'] = exitCallbacks.success;
// Built exit callbacks for all other exits.
_.each(this.exits, function (exitDef, exitName) {
if (exitName === this.defaultExit || exitName === 'success') return;
exitCallbacks[exitName] = function (_data){
isMachineActuallySynchronousCv = true;
// ensure `_data` exists
// (if not, built it using the exit definition)
if (!_data) {
_data = new Error(util.format('`%s` triggered its `%s` exit', self.identity, exitName) + ((self.exits[exitName] && self.exits[exitName].description)?': '+self.exits[exitName].description:'') + '');
}
err = _data;
};
});
this.exec(exitCallbacks);
if (!isMachineActuallySynchronousCv) {
throw (function (){
var _err = new Error('Cannot use `.execSync()` with `'+this.identity+'` machine because, although it declares synchronous usage (i.e. `sync:true`), it is not actually synchronous.');
var _err = new Error('Cannot use `.execSync()` with `'+identity+'` machine because, although it declares synchronous usage (i.e. `sync:true`), it is not actually synchronous.');
_err.code = 'E_MACHINE_INCONSISTENT';

@@ -44,0 +72,0 @@ return _err;

5

lib/types/rttc.js

@@ -30,3 +30,6 @@ /**

if(val === undefined) {
throw new Error('Undefined value');
var err = new Error();
err.code = 'E_UNDEFINED_VAL';
err.message = 'Undefined value';
throw err;
}

@@ -33,0 +36,0 @@

{
"name": "machine",
"version": "1.2.1",
"version": "1.2.2",
"description": "Configure and execute machines",

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

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