UNPKG

@readium/shared

Version:

Shared models to be used across other Readium projects and implementations in Typescript

17 lines (13 loc) 313 B
function endsWithChar(word, c) { if (c.length > 1) { return c.indexOf(word.slice(-1)) > -1; } return word.slice(-1) === c; } function endsWith(word, end) { return word.slice(word.length - end.length) === end; } export default { endsWith: endsWith, endsWithChar: endsWithChar };