mirror of
https://github.com/flarum/framework.git
synced 2024-11-30 21:44:12 +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));
|
|
}
|
|
};
|