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

baggywrinkle

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baggywrinkle - npm Package Compare versions

Comparing version 1.5.1 to 1.6.0

51

index.js

@@ -0,1 +1,3 @@

const _ = require('@sailshq/lodash');
const rttc = require('rttc');
const machineAsAction = require('machine-as-action');

@@ -6,2 +8,51 @@ const statuses = require('statuses');

// Set up global sails mock.
global.sails = {
config: {
appPath: process.cwd(),
},
log: {
info: console.log,
debug: console.log,
warn: console.log,
error: console.log,
verbose: process.env.sails_log__level==='verbose' || process.env.sails_log__level==='silly' ? console.log : () => {},
silly: process.env.sails_log__level==='silly' ? console.log : () => {},
blank: () => {}
},
on: () => {},
once: () => {}
};
// Parse env vars into config.
const prefix = 'sails_';
// Cache the prefix length so we don't have to keep looking it up.
const l = prefix.length;
// Loop through the env vars, looking for ones with the right prefix.
_.each(process.env, function(val, key) {
// If this var's name has the right prefix...
if((key.indexOf(prefix)) === 0) {
// Replace double-underscores with dots, to work with Lodash _.set().
var keypath = key.substring(l).replace(/__/g,'.');
// Attempt to parse the value as JSON.
try {
val = rttc.parseHuman(val, 'json');
}
// If that doesn't work, humanize the value without providing a schema.
catch(unusedErr) {
val = rttc.parseHuman(val);
}
// Override the current value at this keypath in `conf` (which currently contains
// the string value of the env var) with the now (possibly) humanized value.
_.set(sails.config, keypath, val);
}
});
// Allow both `(optsOrMachineDefOrMachine, options)` and `(optsOrMachineDefOrMachine, bootstrap, teardown)` signatures.

@@ -8,0 +59,0 @@ let options = typeof bootstrap === 'object' ? bootstrap : {

4

package.json
{
"name": "baggywrinkle",
"version": "1.5.1",
"version": "1.6.0",
"description": "Run a machine from an AWS Lambda function.",

@@ -12,5 +12,7 @@ "main": "index.js",

"dependencies": {
"@sailshq/lodash": "^3.10.2",
"machine-as-action": "^9.0.2",
"rttc": "^9.8.2",
"statuses": "1.4.0"
}
}
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