override-fn
util function to override any other function
Quick start
Several quick start options are available:
- Download the latest release
- Clone the repo:
git clone https://github.com/massive-angular/override-fn.git
- Install with bower:
bower install override-fn
- Install with npm:
npm install override-fn
Examples
Use original parameters
var overrideFn = ; var context = { console; }; var originalFn = ; context;// output:// hello from override-fn// hello from fn: 1, 2, 3 ;// output:// hello from fn: 1, 2, 3
Use custom parameters
var overrideFn = ; var context = { console; }; var originalFn = ; context;// output:// hello from override-fn// hello from fn: 2, 3, 4 ;// output:// hello from fn: 1, 2, 3
Override class
var overrideFn = ; var originalDate = ; var date = ;console;console;console;// output:// hello from override-fn// Tue May 24 2016 16:00:54 GMT+0300 (EEST)// false// true
Creators
Slava Matvienco
Alexandr Dascal
License
Code released under the MIT license.