myanimelist-url-to-id
Version:
MyAnimeList raw URL to ID
17 lines (16 loc) • 460 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.startsWith = void 0;
/**
* Check if certain string starts with a specified string.
*
* @param needle Matching string
* @param haystack String you wanted to match to
*/
function startsWith(needle, haystack) {
if (haystack.length < needle.length) {
return false;
}
return haystack.substr(0, needle.length) == needle;
}
exports.startsWith = startsWith;