meilisearch
Version:
The Meilisearch JS client for Node.js and the browser.
17 lines • 469 B
JavaScript
async function sleep(ms) {
return await new Promise((resolve) => setTimeout(resolve, ms));
}
function addProtocolIfNotPresent(host) {
if (!(host.startsWith("https://") || host.startsWith("http://"))) {
return `http://${host}`;
}
return host;
}
function addTrailingSlash(url) {
if (!url.endsWith("/")) {
url += "/";
}
return url;
}
export { sleep, addProtocolIfNotPresent, addTrailingSlash };
//# sourceMappingURL=utils.js.map