{"version":3,"file":"isSolidUri.mjs","names":[],"sources":["../../src/util/isSolidUri.ts"],"sourcesContent":["import type { SolidContainerUri, SolidLeafUri, SolidUri } from \"../types\";\n\n/**\n * Checks if a provided string is a leaf URI\n * @param uri - the string to check\n * @returns true if the string is a leaf URI\n */\nexport function isSolidUri(uri: string): uri is SolidUri {\n  try {\n    const url = new URL(uri);\n    return url.protocol === \"https:\" || url.protocol === \"http:\";\n  } catch {\n    return false;\n  }\n}\n\n/**\n * Checks if a provided string is a Container URI\n * @param uri - the string to check\n * @returns true if the string is a container URI\n */\nexport function isSolidContainerUri(uri: string): uri is SolidContainerUri {\n  try {\n    const url = new URL(uri);\n    return url.pathname.endsWith(\"/\");\n  } catch {\n    return false;\n  }\n}\n\n/**\n * Checks if a provided string is a leaf URI\n * @param uri - the string to check\n * @returns true if the string is a leaf URI\n */\nexport function isSolidLeafUri(uri: string): uri is SolidLeafUri {\n  try {\n    const url = new URL(uri);\n    return !url.pathname.endsWith(\"/\");\n  } catch {\n    return false;\n  }\n}\n"],"mappings":";;;;;;AAOA,SAAgB,WAAW,KAA8B;AACvD,KAAI;EACF,MAAM,MAAM,IAAI,IAAI,IAAI;AACxB,SAAO,IAAI,aAAa,YAAY,IAAI,aAAa;SAC/C;AACN,SAAO;;;;;;;;AASX,SAAgB,oBAAoB,KAAuC;AACzE,KAAI;AAEF,SAAO,IADS,IAAI,IACV,CAAC,SAAS,SAAS,IAAI;SAC3B;AACN,SAAO;;;;;;;;AASX,SAAgB,eAAe,KAAkC;AAC/D,KAAI;AAEF,SAAO,CAAC,IADQ,IAAI,IACT,CAAC,SAAS,SAAS,IAAI;SAC5B;AACN,SAAO"}