Socket
Socket
Sign inDemoInstall

hoek

Package Overview
Dependencies
Maintainers
2
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hoek - npm Package Compare versions

Comparing version 0.8.0 to 0.8.1

25

lib/index.js

@@ -270,3 +270,3 @@ // Load modules

return function (callback) {
return function (next) {

@@ -278,6 +278,6 @@ var result = null;

catch (err) {
return callback(err);
return next(err);
}
return callback(null, result);
return next(null, result);
};

@@ -453,6 +453,6 @@ })(obj[i]);

exports.toss = function (condition /*, [message], callback */) {
exports.toss = function (condition /*, [message], next */) {
var message = (arguments.length === 3 ? arguments[1] : '');
var callback = (arguments.length === 3 ? arguments[2] : arguments[1]);
var next = (arguments.length === 3 ? arguments[2] : arguments[1]);

@@ -464,3 +464,3 @@ var err = (message instanceof Error ? message : (message ? new Error(message) : (condition instanceof Error ? condition : new Error())));

return callback(err);
return next(err);
}

@@ -562,1 +562,14 @@ };

};
exports.nextTick = function (callback) {
return function () {
var args = arguments;
process.nextTick(function () {
callback.apply(null, args);
});
};
};
{
"name": "hoek",
"description": "General purpose node utilities",
"version": "0.8.0",
"version": "0.8.1",
"author": "Eran Hammer <eran@hueniverse.com> (http://hueniverse.com)",

@@ -6,0 +6,0 @@ "contributors":[

@@ -982,3 +982,31 @@ // Load modules

});
describe('#nextTick', function () {
it('calls the provided callback on nextTick', function (done) {
var a = 0;
var inc = function (step, next) {
a += step;
next();
};
var ticked = Hoek.nextTick(inc);
ticked(5, function () {
expect(a).to.equal(6);
done();
});
expect(a).to.equal(0);
inc(1, function () {
expect(a).to.equal(1);
});
});
});
});

Sorry, the diff of this file is not supported yet

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