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.4 to 1.1.0

test/backbone-style-extends.js

8

HISTORY.md
# Change History
## 1.0.04 (2014-05-17)
## 1.1.0 (2014-08-28)
* Allow `extends_` method to delegate to `Parent.extend` if present. This way
typedef can be used with libs like [AmpersandJS](http://ampersandjs.com/)
and [Backbone](http://backbonejs.org/).
## 1.0.4 (2014-05-17)
* Updated NPM dependencies.

@@ -6,0 +12,0 @@

@@ -8,2 +8,5 @@ module.exports = extends_;

* prototypes.
*
* If the `Parent` class has a `extend` method (like Backbone or Ampersand), it
* will defer to that.
* @param {Function} Child Child constructor function.

@@ -15,2 +18,22 @@ * @param {Function} Parent Parent contrusctor function.

{
if (typeof Parent.extend === 'function') {
var proto = {};
// Add in all the prototype members
for (var p in Child.prototype) {
proto[p] = Child.prototype[p];
}
proto.constructor = Child;
// Delegate
Parent.extend(proto);
// Give static to access parent
Child.Super = Parent;
return;
}
// Drop in statics

@@ -17,0 +40,0 @@ for (var key in Parent) {

2

package.json
{
"name": "typedef",
"version": "1.0.4",
"version": "1.1.0",
"description": "Low-level type-centric utility functions for Javascript.",

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

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