New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

typedef

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typedef - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

lib/extends.js

@@ -16,3 +16,3 @@ module.exports = extends_;

for (var key in Parent) {
if (Parent.hasOwnProperty(key)) {
if (!Child.hasOwnProperty(key) && Parent.hasOwnProperty(key)) {
Child[key] = Parent[key];

@@ -19,0 +19,0 @@ }

{
"name": "typedef",
"version": "1.0.1",
"version": "1.0.2",
"description": "Low-level type-centric utility functions for Javascript.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -114,1 +114,24 @@ var extends_ = require('../lib/extends.js');

});
test('Static member overriden by child', function(t) {
t.plan(2);
var A = 'A';
var B = 'B';
function Parent() { }
Parent.foo = A;
// Trivial case of extends being called first
function Child() { }
extends_(Child, Parent);
Child.foo = B;
t.strictEqual(Child.foo, B, 'Child foo');
// Using extends aftewards should skip over any statics already on child
function Child2() { }
Child2.foo = B;
extends_(Child2, Parent);
t.strictEqual(Child2.foo, B, 'Child2 foo');
});
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