UNPKG

@acdh-oeaw/universalviewer

Version:

The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎

21 lines 747 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseContentStateParameter = parseContentStateParameter; var content_state_1 = require("./content-state/content-state"); function parseContentStateParameter(contentState) { if (!contentState) { return null; } if (typeof contentState === "string" && contentState.startsWith("http")) { return { type: "remote-content-state", id: contentState }; } try { return (0, content_state_1.normaliseContentState)(typeof contentState === "string" ? (0, content_state_1.parseContentState)(contentState) : contentState); } catch (err) { return null; } } //# sourceMappingURL=helpers.js.map