UNPKG

@ledgerhq/live-common

Version:
26 lines 809 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.extractURLFromManifest = extractURLFromManifest; const extractDappURLFromManifest_1 = require("./extractDappURLFromManifest"); /** Returns dapp dappURL or live app URL from manifest. */ function extractURLFromManifest(manifest) { if (!manifest) { return undefined; } const dappUrl = (0, extractDappURLFromManifest_1.extractDappURLFromManifest)(manifest); if (dappUrl) { return dappUrl; } try { if (manifest.url && manifest.url instanceof URL) { return manifest.url; } const url = new URL(manifest.url); return url; } catch { // Invalid URL return undefined; } } //# sourceMappingURL=extractURLFromManifest.js.map