Socket
Socket
Sign inDemoInstall

callbag-map-promise

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

callbag-map-promise - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

8

index.js

@@ -6,2 +6,8 @@ import pipe from 'callbag-pipe'

const transfer = (data)=>(type,d)=>{
if(type !== 0) return
d(1,data)
}
export default fn=>source=>{

@@ -12,3 +18,3 @@ return pipe(

d = fn(d)
return d instanceof Promise ? fromPromise(d) : d
return d instanceof Promise ? fromPromise(d) : transfer(d)
}),

@@ -15,0 +21,0 @@ flatten

@@ -18,2 +18,9 @@ "use strict";

var transfer = function transfer(data) {
return function (type, d) {
if (type !== 0) return;
d(1, data);
};
};
var _default = function _default(fn) {

@@ -23,3 +30,3 @@ return function (source) {

d = fn(d);
return d instanceof Promise ? (0, _callbagFromPromise.default)(d) : d;
return d instanceof Promise ? (0, _callbagFromPromise.default)(d) : transfer(d);
}), _callbagFlatten.default);

@@ -26,0 +33,0 @@ };

4

package.json
{
"name": "callbag-map-promise",
"version": "0.1.0",
"version": "0.1.1",
"description": "callbag map+fromPromise+flatten",
"main": "./lib",
"scripts": {
"test": "ava",
"test": "npm run build && ava",
"build": "babel index.js --out-dir lib --presets @babel/preset-env --plugins @babel/plugin-proposal-pipeline-operator"

@@ -9,0 +9,0 @@ },

@@ -39,2 +39,9 @@ import test from "ava"

})
fromPromise(fetchUser("judicy"))
|> mapPromise(user => 123)
|> forEach(friends => {
t.deepEqual(friends, 123)
t.end()
})
})
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