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 9.0.4 to 9.0.5

spec/exit-def.struct.js

10

lib/Machine.build.js

@@ -169,2 +169,8 @@ /**

// Fold case for `typesafe` (tolerate "typeSafe")
if (!_.isUndefined(machineDefinition.typeSafe)) {
machineDefinition.typesafe = machineDefinition.typeSafe;
delete machineDefinition.typeSafe;
}
// Define a callable machine function

@@ -210,2 +216,6 @@ //

};
_callableMachineWrapper.unsafe = function (){
var machineInstance = new Machine(machineDefinition);
return machineInstance.unsafe.apply(machineInstance, Array.prototype.slice.call(arguments));
};

@@ -212,0 +222,0 @@ // Next, expose the rest of the machine definition as properties on the wrapper fn.

20

lib/Machine.constructor.js

@@ -60,3 +60,3 @@ /**

},
build: this.constructor.build
build: _.bind(self.constructor.build, self.constructor)
};

@@ -76,6 +76,20 @@

// unsafe mode completely disables input validation, and sets _runTimeTypeCheck, _inputCoercion
// and _exitCoercion to `false` (they can be reactivated if chained after the call to `.unsafe()`)
// unsafe mode completely disables validation and coercion of both inputs and exits
// by setting `_runTimeTypeCheck`, `_inputCoercion` ,and `_exitCoercion` to `false`.
// (they can be reactivated if chained after the call to the `.unsafe()` helper method)
this._unsafeMode = false;
// if `typesafe` is enabled, then the machine will have validation and coercion
// completely disabled by default-- so immediately call `.unsafe(true)`
if (this.typesafe) {
console.log(' * * * * * * * * * * * * * * * * ~••~ * * * * * * * * * * * * * * * * * * *');
console.log(' * NOTE: `typesafe` is experimental and not ready for production use! *');
console.log(' * It is generally not a good idea to use this, and there is a high *');
console.log(' * likelihood the feature will be removed altogether; or that its API *');
console.log(' * will change significantly and without notice in an upcoming release. *');
console.log(' * * * * * * * * * * * * * * * * ~••~ * * * * * * * * * * * * * * * * * * *');
this.unsafe(true);
}
// a flag tracking whether or not the machine is running synchronously
this._runningSynchronously = false;

@@ -82,0 +96,0 @@

3

lib/Machine.prototype.exec.js

@@ -35,2 +35,3 @@ /**

// Only validate & coerce configured input values if `unsafeMode` is disabled.
var coercedInputValues;

@@ -46,3 +47,3 @@ if (!self._unsafeMode) {

// if any inputs are invalid.
// TODO: call a special 'failedInputValidation' exit here
// TODO: call a special '_failedInputValidation' exit here
if(self._runTimeTypeCheck) {

@@ -49,0 +50,0 @@ // Fourth argument (`true`) tells switchback to run synchronously

{
"name": "machine",
"version": "9.0.4",
"version": "9.0.5",
"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