New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

promise-thunk

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise-thunk - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

2

package.json
{
"name": "promise-thunk",
"version": "0.1.5",
"version": "0.1.6",
"description": "Promise and thunk",

@@ -5,0 +5,0 @@ "main": "promise-thunk.js",

@@ -352,2 +352,3 @@ // promise-thunk.js

function thunkify(fn) {
var ctx = this;
if (typeof fn !== 'function')

@@ -358,3 +359,3 @@ throw new TypeError('thunkify: argument must be a function');

return function thunkified() {
var ctx, result, callbacks = [], unhandled;
var result, callbacks = [], unhandled;
arguments[arguments.length++] = function callback(err, val) {

@@ -367,3 +368,3 @@ if (result) {

ctx = this, result = arguments;
result = arguments;
if (callbacks.length === 0 && err instanceof Error)

@@ -377,3 +378,3 @@ unhandled = true,

};
fn.apply(this, arguments);
fn.apply(ctx, arguments);

@@ -380,0 +381,0 @@ // thunk

@@ -188,2 +188,10 @@ [promise-thunk](https://www.npmjs.org/package/promise-thunk) - npm

#### postgres `pg` example:
```js
var pg = require('pg');
var pg_connect = thunkify.call(pg, pg.connect);
var client_query = thunkify.call(client, client.query);
```
### promise.then(onFulfilled, onRejected)

@@ -190,0 +198,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