"use strict";var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _isPositiveInteger=_interopRequireDefault(require("./isPositiveInteger"));

const got=(i)=>
typeof i==="string"?JSON.stringify(i):i;

function getOrdinalSuffix(i){
const j=i%10;
const k=i%100-j;
if(k!==10){
if(j===1){
return"st";
}
if(j===2){
return"nd";
}
if(j===3){
return"rd";
}
}
return"th";
}var _default=

i=>{
if(!(0,_isPositiveInteger.default)(i)){
throw new Error(`Number must be a positive integer. Instead got: ${got(i)}`);
}

return`${i}${getOrdinalSuffix(i)}`;
};exports.default=_default;