Socket
Socket
Sign inDemoInstall

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.2.2 to 2.2.3

18

index.js

@@ -79,5 +79,14 @@ var abbott = require('abbott');

function traceGet(instance, result){
if(righto._debug && !(typeof result === 'object' || typeof result === 'function')){
var line = getCallLine(instance._stack);
throw new Error('Result of righto was not an instance at: \n' + line);
}
}
function get(fn){
var instance = this;
return righto(function(result, fn, done){
if(typeof fn === 'string'){
traceGet(instance, result);
return done(null, result[fn]);

@@ -99,3 +108,12 @@ }

if(instance[key] || key in instance || key === 'inspect' || typeof key === 'symbol'){
return instance[key];
}
if(righto._debug && key.charAt(0) === '_'){
return instance[key];
}
return proxy(righto.sync(function(result){
traceGet(instance, result);
return result[key];

@@ -102,0 +120,0 @@ }, instance));

2

package.json
{
"name": "righto",
"version": "2.2.2",
"version": "2.2.3",
"main": "index.js",

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

@@ -644,3 +644,3 @@ var test = require('tape'),

var foo = stuff.foo
var foo = stuff.foo;

@@ -656,2 +656,48 @@ var bar = righto(function(foo, done){

test('proxy resolve', function(t){
t.plan(1);
if(typeof Proxy === 'undefined'){
t.pass('Proxy not available');
return;
}
function getStuff(callback){
callback(null, {foo: 'foo'});
}
var stuff = righto.proxy(getStuff);
var foo = stuff.foo;
var bar = righto.resolve({ foo });
bar(function(error, bar){
t.deepEqual(bar, { foo: 'foo' });
});
});
test('proxy resolve deep', function(t){
t.plan(1);
if(typeof Proxy === 'undefined'){
t.pass('Proxy not available');
return;
}
function getStuff(callback){
callback(null, {foo: 'foo'});
}
var stuff = righto.proxy(getStuff);
var foo = stuff.foo;
var bar = righto.resolve({ foo }, true);
bar(function(error, bar){
t.deepEqual(bar, { foo: 'foo' });
});
});
test('resolve', function(t){

@@ -658,0 +704,0 @@ t.plan(1);

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