dist/src/util.js
function getOrdinal(value) {
    const lastDigit = value % 10;
    if (lastDigit === 1) {
        return `${value}st`;
    }
    else if (lastDigit === 2) {
        return `${value}nd`;
    }
    else if (lastDigit === 3) {
        return `${value}rd`;
    }
    else {
        return `${value}th`;
    }
}
function getOrdinal(value) {
    const lastDigit = value % 10;
    if (lastDigit === 1) {
        return `${value}st`;
    }
    else if (lastDigit === 2) {
        return `${value}nd`;
    }
    else if (lastDigit === 3) {
        return `${value}rd`;
    }
    else {
        return `${value}th`;
    }
}
function getOrdinal ( value ) { const lastDigit = value % 10 ; if ( lastDigit === 1 ) { return ` ${ value } ` ; } else if ( lastDigit === 2 ) { return ` ${ value } ` ; } else if ( lastDigit === 3 ) { return ` ${ value } ` ; } else { return ` ${ value } ` ; } }
Helper function to get an ordinal string like "1st", "2nd", "3rd"... Expects the input to be an integer. This is used to produce helpful names for tests and callbacks that weren't assigned more descriptive names by their developer.
Helper function to get an ordinal string like 1st 2nd 3rd ... Expects the input to be an integer . This is used to produce helpful names for tests and callbacks that weren t assigned more descriptive names by their developer .