ordinal-js
Version:
Utility to convert from numbers to their ordinal representations
17 lines (14 loc) • 377 B
JavaScript
;
/**
* Enhances a certain type prototype
*/
module.exports = function (type, name, fn) {
if (!type.prototype[name]) {
type.prototype[name] = function () {
for (var _len = arguments.length, params = Array(_len), _key = 0; _key < _len; _key++) {
params[_key] = arguments[_key];
}
return fn.call.apply(fn, [null, this].concat(params));
};
}
};