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

machinepack-util

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

machinepack-util - npm Package Compare versions

Comparing version 7.0.0-1 to 7.0.0-2

machines/get-calculated-value.js

13

machines/whilst.js

@@ -79,4 +79,5 @@ module.exports = {

// Import `async`.
// Import `async` and `rttc`.
var async = require('async');
var rttc = require('rttc');

@@ -86,2 +87,6 @@ // Put a reference to `inputs.initialData` into a var for convenience.

// Get an exemplar of the initial value so that we can coerce any
// updated data to be the same type after each iteration.
var initialValueTypeSchema = rttc.infer(rttc.coerceExemplar(inputs.initialData));
// Use `async.during` to perform a fully asynchronous "while" loop

@@ -115,4 +120,8 @@ // (In `async.whilst`, the test must be performed synchronously).

success: function(updatedData) {
data = updatedData;
// Keep track of accumulated result so far, and make sure it validates
// against the initial value's type.
data = rttc.coerce(initialValueTypeSchema, updatedData);
return cb();
},

@@ -119,0 +128,0 @@ // If the operation returned through its `error` exit,

10

package.json
{
"name": "machinepack-util",
"version": "7.0.0-1",
"version": "7.0.0-2",
"description": "Miscellaneous utilities for everyday tasks with arrays, dictionaries, strings, etc.",

@@ -25,4 +25,5 @@ "scripts": {

"lodash": "3.10.1",
"machine": "^13.0.0-7",
"resolve": "1.1.7"
"machine": "^13.0.0-11",
"resolve": "1.1.7",
"rttc": "^9.8.2"
},

@@ -46,3 +47,4 @@ "repository": {

"whilst",
"pretty-print"
"pretty-print",
"get-calculated-value"
],

@@ -49,0 +51,0 @@ "testsUrl": "https://travis-ci.org/treelinehq/machinepack-util"

@@ -12,4 +12,24 @@ {

"returns": 0
},
{
"using": {
"test": "function(inputs, exits) {if (inputs.data === 0) {return exits.stop();} return exits.success();}",
"operation": "function(inputs, exits) {console.log(inputs.data); return exits.success(inputs.data + 'foo');}",
"initialData": 5
},
"outcome": "success",
"returns": 0
},
{
"using": {
"test": "function(inputs, exits) {if (inputs.data.length === 10) {return exits.stop();} return exits.success();}",
"operation": "function(inputs, exits) {return exits.success(inputs.data.concat(inputs.data.length));}",
"initialData": []
},
"outcome": "success",
"returns": [0,1,2,3,4,5,6,7,8,9]
}
]
}
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