UNPKG

@prismicio/client

Version:

The official JavaScript + TypeScript client library for Prismic

1 lines 695 B
{"version":3,"file":"isRepositoryEndpoint.cjs","sources":["../../src/isRepositoryEndpoint.ts"],"sourcesContent":["/**\n * Determines if a string if a Prismic Rest API V2 endpoint. Note that any valid\n * URL is a valid endpoint to support network proxies.\n *\n * @param input - Input to test.\n *\n * @returns `true` if `input` is a valid Prismic Rest API V2 endpoint, `false`\n * otherwise.\n */\nexport const isRepositoryEndpoint = (input: string): boolean => {\n\ttry {\n\t\tnew URL(input)\n\n\t\treturn true\n\t} catch {\n\t\treturn false\n\t}\n}\n"],"names":[],"mappings":";;AASa,MAAA,uBAAuB,CAAC,UAA0B;AAC1D,MAAA;AACH,QAAI,IAAI,KAAK;AAEN,WAAA;AAAA,EAAA,QACA;AACA,WAAA;AAAA,EAAA;AAET;;"}