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

righto

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

righto - npm Package Compare versions

Comparing version 2.1.2 to 2.2.0

4

index.js

@@ -473,2 +473,6 @@ var abbott = require('abbott');

righto.isRighto = isRighto;
righto.isThenable = isThenable;
righto.isResolveable = isResolveable;
righto.proxy = function(){

@@ -475,0 +479,0 @@ if(typeof Proxy === 'undefined'){

2

package.json
{
"name": "righto",
"version": "2.1.2",
"version": "2.2.0",
"main": "index.js",

@@ -5,0 +5,0 @@ "directories": {

@@ -521,2 +521,25 @@ # Righto

## isRighto, isThenable, isResolveable
Use these methods to check if something is a righto, a thenable, or resolveable (either righto or thenable);
```
var rigthoA = righto(function(done){
done(null, 1);
});
var promiseB = new Promise(function(resolve, reject){
resolve(null, 2);
});
righto.isRighto(rigthoA); -> true
righto.isRighto(promiseB); -> false
righto.isThenable(rigthoA); -> false
righto.isThenable(promiseB); -> true
righto.isResolveable(rigthoA); -> true
righto.isResolveable(promiseB); -> true
```
# Tracing

@@ -523,0 +546,0 @@

@@ -1204,2 +1204,24 @@ var test = require('tape'),

});
});
test('isRighto', function(t){
t.plan(9);
var rigthoA = righto(function(done){
done(null, 1);
});
var promiseB = new Promise(function(resolve, reject){
resolve(null, 2);
});
t.ok(righto.isRighto(rigthoA), 'rigthoA is righto');
t.notOk(righto.isRighto(promiseB), 'promiseB is not a righto');
t.notOk(righto.isThenable(rigthoA), 'rigthoA is not a thenable');
t.ok(righto.isThenable(promiseB), 'promiseB is thenable');
t.ok(righto.isResolveable(rigthoA), 'rigthoA is resolveable');
t.ok(righto.isResolveable(promiseB), 'promiseB is resolveable');
t.notOk(righto.isRighto(null), 'null is not a righto');
t.notOk(righto.isThenable(null), 'null is not a thenable');
t.notOk(righto.isResolveable(null), 'null is not a resolveable');
});
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