UNPKG

@eclipse-emfcloud/modelserver-client

Version:

Typescript rest client to interact with an EMF.cloud modelserver

37 lines 1.48 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.convertToTheiaUri = exports.convertToUri = void 0; /******************************************************************************** * Copyright (c) 2022 STMicroelectronics and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at * https://www.eclipse.org/legal/epl-2.0, or the MIT License which is * available at https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: EPL-2.0 OR MIT *******************************************************************************/ const uri_1 = require("@theia/core/lib/common/uri"); const urijs_1 = __importDefault(require("urijs")); /** * Converts the given TheiaURI to an URI object * @param theiaUri the Theia uri to be converted * @returns the converted URI */ function convertToUri(theiaUri) { return new urijs_1.default(theiaUri.toString(true)).normalize(); } exports.convertToUri = convertToUri; /** * Converts the given URI to a TheiaURI object * @param uri the uri to be converted * @returns the converted TheiaURI */ function convertToTheiaUri(uri) { return new uri_1.URI(uri.toString()); } exports.convertToTheiaUri = convertToTheiaUri; //# sourceMappingURL=uri-utils.js.map