mirror of
https://github.com/flarum/framework.git
synced 2024-12-04 00:03:37 +08:00
9 lines
263 B
JavaScript
9 lines
263 B
JavaScript
|
export function extend(object, func, extension) {
|
||
|
var oldFunc = object[func];
|
||
|
object[func] = function() {
|
||
|
var value = oldFunc.apply(this, arguments);
|
||
|
var args = [].slice.apply(arguments);
|
||
|
return extension.apply(this, [value].concat(args));
|
||
|
}
|
||
|
};
|