@box2d/debug-draw
Version:
Debug drawing helper for @box2d
18 lines (17 loc) • 612 B
JavaScript
;
// MIT License
Object.defineProperty(exports, "__esModule", { value: true });
exports.b2_augment = void 0;
function b2_augment(host, augmentations) {
for (const key of Object.keys(augmentations)) {
const augmentation = augmentations[key];
const original = host[key];
// eslint-disable-next-line func-names
const wrapper = function (...args) {
return augmentation.call(this, original.bind(this), ...args);
};
Object.defineProperty(wrapper, "name", { value: key });
host[key] = wrapper;
}
}
exports.b2_augment = b2_augment;