Socket
Socket
Sign inDemoInstall

extend-with-super

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    extend-with-super

Extend object literals with function properties to have a _super method that references the original function, instead of overwriting it. (No dependencies, but borrowed methods from underscore.js.)


Version published
Weekly downloads
111
decreased by-22.92%
Maintainers
1
Install size
25.3 kB
Created
Weekly downloads
 

Changelog

Source

2.0.0 (February 28, 2015)

  • Updated scope of execution
  • Added tests for scope of execution
  • Added appveyor yml config file
  • Tagged 2.0.0

Readme

Source

extend-with-super

Build Status Codeship Status for michaelBenin/extend-with-super Build status Code Climate Coverage Status NPM version
Dependency status Dev Dependency Status Downloads per Month Built with Grunt

NPM

Quickstart Example & Description


// Extend object literals with function properties to have a
// _super method that references the original function, instead
// of overwriting it.
// (No dependencies, but borrowed methods from underscore.js.)

var sampleObj = {
  funcProp: function(){
    return 'Hello';
  }
};

var sampleObj2 = {
  funcProp: function(){
    var originalMethod = this._super();
    return originalMethod + ' World';
  }
};

// Note just like _.extend, only the first argument is modified
var sampleObj3 = extendWithSuper({}, sampleObj, sampleObj2);

sampleObj3.funcProp(); // Hello World

Usage / Support

On the server/browserify:

CommonJS in npm.

Supported in all versions of node.js/iojs.

With RequireJS or as Global in browser:

Bower in UMD ~ Global is extendWithSuper.

Tests pass in IE9+ - Does not break IE8.

In browser weight

< 1kb
gzip: 606 bytes

Contributing

Commands:

npm run build
npm test

Open a github issue for the bug/enhancement discussion.

Any contributions must be accompanied with tests.

Make a pull request to the develop branch referencing the issue.

Please do not introduce any external dependencies.

Main functionality influenced by underscore.js.

License MIT

Bitdeli Badge

Keywords

FAQs

Last updated on 28 Feb 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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