Socket
Socket
Sign inDemoInstall

hoek

Package Overview
Dependencies
0
Maintainers
3
Versions
116
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.5.1 to 2.6.0

11

lib/index.js

@@ -66,3 +66,9 @@ // Load modules

if (obj.hasOwnProperty(i)) {
newObj[i] = exports.clone(obj[i], seen);
var descriptor = Object.getOwnPropertyDescriptor(obj, i);
if (descriptor.get) {
Object.defineProperty(newObj, i, descriptor);
}
else {
newObj[i] = exports.clone(obj[i], seen);
}
}

@@ -609,2 +615,5 @@ }

exports.format = Util.format;
exports.transform = function (source, transform, options) {

@@ -611,0 +620,0 @@

2

package.json
{
"name": "hoek",
"description": "General purpose node utilities",
"version": "2.5.1",
"version": "2.6.0",
"repository": "git://github.com/hapijs/hoek",

@@ -6,0 +6,0 @@ "main": "index",

@@ -273,2 +273,25 @@ // Load modules

});
it('clones an object with property getter without executing it', function (done) {
var obj = {};
var value = 1;
var execCount = 0;
Object.defineProperty(obj, 'test', {
enumerable: true,
configurable: true,
get: function () {
++execCount;
return value;
}
});
var copy = Hoek.clone(obj);
expect(execCount).to.equal(0);
expect(copy.test).to.equal(1);
expect(execCount).to.equal(1);
done();
});
});

@@ -1404,2 +1427,18 @@

describe('format()', function () {
it('exists', function (done) {
expect(Hoek.format).to.exist;
expect(typeof Hoek.format).to.equal('function');
done();
});
it('is a reference to Util.format', function (done) {
expect(Hoek.format('hello %s', 'world')).to.equal('hello world');
done();
});
});
describe('transform()', function () {

@@ -1406,0 +1445,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc