@prismicio/client
Version:
The official JavaScript + TypeScript client library for Prismic
22 lines (21 loc) • 518 B
JavaScript
//#region src/isRepositoryEndpoint.ts
/**
* Determines if a string is a Prismic Content API endpoint. Note that any valid
* URL is a valid endpoint to support network proxies.
*
* @param input - Input to test.
*
* @returns `true` if `input` is a valid Prismic Content API endpoint, `false`
* otherwise.
*/
const isRepositoryEndpoint = (input) => {
try {
new URL(input);
return true;
} catch {
return false;
}
};
//#endregion
export { isRepositoryEndpoint };
//# sourceMappingURL=isRepositoryEndpoint.js.map