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.5 to 0.9.0

0

lib/escape.js

@@ -0,0 +0,0 @@ // Declare internals

45

lib/index.js

@@ -73,12 +73,12 @@ // Load modules

source.forEach(function (item) {
for (var i = 0, il = source.length; i < il; ++i) {
target.push(source[i]);
}
target.push(item);
});
return target;
}
Object.keys(source).forEach(function (key) {
var keys = Object.keys(source);
for (var k = 0, kl = keys.length; k < kl; ++k) {
var key = keys[k];
var value = source[key];

@@ -105,3 +105,3 @@ if (value &&

}
});
}

@@ -179,3 +179,3 @@ return target;

exports.intersect = function (array1, array2) {
exports.intersect = function (array1, array2, justFirst) {

@@ -191,2 +191,6 @@ if (!array1 || !array2) {

if (hash[array2[i]] && !found[array2[i]]) {
if (justFirst) {
return array2[i];
}
common.push(array2[i]);

@@ -250,8 +254,7 @@ found[array2[i]] = true;

var ref = obj;
path.forEach(function (level) {
for (var i = 0, il = path.length; i < il; ++i) {
if (ref) {
ref = ref[level];
ref = ref[path[i]];
}
});
}

@@ -299,6 +302,6 @@ return ref;

var trace = [];
stack.forEach(function (item) {
for (var i = 0, il = stack.length; i < il; ++i) {
var item = stack[i];
trace.push([item.getFileName(), item.getLineNumber(), item.getColumnNumber(), item.getFunctionName(), item.isConstructor()]);
});
}

@@ -312,6 +315,7 @@ return trace;

var display = [];
trace.forEach(function (row) {
for (var i = 0, il = trace.length; i < il; ++i) {
var row = trace[i];
display.push((row[4] ? 'new ' : '') + row[3] + ' (' + row[0] + ':' + row[1] + ':' + row[2] + ')');
});
}

@@ -396,4 +400,5 @@ return display;

Fs.readdirSync(path).forEach(function (filename) {
var files = Fs.readdirSync(path);
for (i = 0, il = files.length; i < il; ++i) {
var filename = files[i];
if (/\.js$/.test(filename) &&

@@ -412,3 +417,3 @@ !exclude[filename]) {

}
});
}
};

@@ -415,0 +420,0 @@

{
"name": "hoek",
"description": "General purpose node utilities",
"version": "0.8.5",
"version": "0.9.0",
"author": "Eran Hammer <eran@hueniverse.com> (http://hueniverse.com)",

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

@@ -0,0 +0,0 @@ // Load modules

@@ -429,2 +429,11 @@ // Load modules

it('should return just the first common object of two arrays', function (done) {
var array1 = [1, 2, 3, 4, 4, 5, 5];
var array2 = [5, 4, 5, 6, 7];
var common = Hoek.intersect(array1, array2, true);
expect(common).to.equal(5);
done();
});
it('should return an empty array if either input is null', function (done) {

@@ -431,0 +440,0 @@

exports.x = 1;
exports.y = 2;
exports.z = 3;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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