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

andthen

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

andthen - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

22

index.js

@@ -16,12 +16,28 @@ module.exports = andThen;

callback = arguments[ hasFirstValue ? 1 : 0 ],
params;
bind, currentValue, params;
function next(i/* [, currentValue ] */){
params = arguments.length > 1 ? [ arguments[1] ] : [];
currentValue = arguments[1];
params = arguments.length > 1 ? [ currentValue ] : [];
if(typeof functions[i] == 'string'){
bind = functions[i];
return next(i+1, currentValue);
}
if(bind != undefined && params[0]){
params[0] = currentValue[bind];
}
params.push(function(error, newValue){
if(error) return callback(error, params[0]);
if(error) return callback(error, currentValue);
if(bind != undefined) {
currentValue[ bind ] = newValue;
bind = undefined;
newValue = currentValue;
}
if( i + 1 >= functions.length ) return callback(undefined, newValue);

@@ -28,0 +44,0 @@

4

package.json
{
"name": "andthen",
"version": "0.0.0",
"version": "0.0.1",
"description": "Async function composition with parameter fixing abiliy.",

@@ -13,3 +13,3 @@ "main": "index.js",

"repository": {
"url": "git@github.com:azer\/andthen.git",
"url": "git@github.com:azer/andthen.git",
"type": "git"

@@ -16,0 +16,0 @@ },

@@ -21,3 +21,3 @@ ## andthen

andThen(getContent, 'posts', getPosts, 'images', getImages)(function(error, contents){
andThen(getContents, 'posts', getPosts, 'images', getImages)(function(error, contents){

@@ -24,0 +24,0 @@ contents.posts

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