UNPKG

ordinal-js

Version:

Utility to convert from numbers to their ordinal representations

13 lines (11 loc) 232 B
"use strict"; /** * Enhances a certain type prototype */ module.exports = function(type, name, fn) { if (!type.prototype[name]) { type.prototype[name] = function(...params) { return fn.call(null, this, ...params); } } }