@here/harp-utils
Advanced tools
| export * from "./index-common"; | ||
| export * from "./lib/UrlPlatformUtils"; | ||
| //# sourceMappingURL=index.node.d.ts.map |
| "use strict"; | ||
| /* | ||
| * Copyright (C) 2019-2021 HERE Europe B.V. | ||
| * Licensed under Apache 2.0, see full license in LICENSE | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
| }) : (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| o[k2] = m[k]; | ||
| })); | ||
| var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
| for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| __exportStar(require("./index-common"), exports); | ||
| __exportStar(require("./lib/UrlPlatformUtils"), exports); | ||
| //# sourceMappingURL=index.node.js.map |
@@ -9,2 +9,3 @@ "use strict"; | ||
| exports.getAppBaseUrl = void 0; | ||
| const UrlUtils_1 = require("./UrlUtils"); | ||
| /** | ||
@@ -19,5 +20,8 @@ * Get base URL for from where relative URLs will be loaded. | ||
| function getAppBaseUrl() { | ||
| return `file://${process.cwd()}/`; | ||
| if (typeof window === "undefined") { | ||
| return `file://${process.cwd()}/`; | ||
| } | ||
| return UrlUtils_1.baseUrl(window.location.href); | ||
| } | ||
| exports.getAppBaseUrl = getAppBaseUrl; | ||
| //# sourceMappingURL=UrlPlatformUtils.js.map |
+4
-4
| { | ||
| "name": "@here/harp-utils", | ||
| "version": "0.24.0", | ||
| "version": "0.25.0", | ||
| "description": "Provides utilities: logging, debugging.", | ||
| "main": "index.js", | ||
| "browser": "index.web.js", | ||
| "main": "index.node.js", | ||
| "browser": "index.js", | ||
| "scripts": { | ||
@@ -36,3 +36,3 @@ "build": "tsc --build $EXTRA_TSC_ARGS", | ||
| }, | ||
| "gitHead": "74bf1b008abf47d331ed0cdb968911967a1b514d" | ||
| "gitHead": "51adfc43303e44617a6ff2a5f5daf9d004cd037e" | ||
| } |
| export * from "./index-common"; | ||
| export * from "./lib/UrlPlatformUtils.web"; | ||
| //# sourceMappingURL=index.web.d.ts.map |
-20
| "use strict"; | ||
| /* | ||
| * Copyright (C) 2019-2021 HERE Europe B.V. | ||
| * Licensed under Apache 2.0, see full license in LICENSE | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
| }) : (function(o, m, k, k2) { | ||
| if (k2 === undefined) k2 = k; | ||
| o[k2] = m[k]; | ||
| })); | ||
| var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
| for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
| }; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| __exportStar(require("./index-common"), exports); | ||
| __exportStar(require("./lib/UrlPlatformUtils.web"), exports); | ||
| //# sourceMappingURL=index.web.js.map |
| /** | ||
| * Get base URL for from where relative URLs will be loaded. | ||
| * | ||
| * * In browser, it resolves to `baseUrl(location.href)` i.e document's base URL | ||
| * (see: https://www.w3.org/TR/WD-html40-970917/htmlweb.html#h-5.1.2). | ||
| * | ||
| * * In node, it resolves to `file://${process.cwd()}`. | ||
| */ | ||
| export declare function getAppBaseUrl(): string; | ||
| //# sourceMappingURL=UrlPlatformUtils.web.d.ts.map |
| "use strict"; | ||
| /* | ||
| * Copyright (C) 2019-2021 HERE Europe B.V. | ||
| * Licensed under Apache 2.0, see full license in LICENSE | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.getAppBaseUrl = void 0; | ||
| const UrlUtils_1 = require("./UrlUtils"); | ||
| /** | ||
| * Get base URL for from where relative URLs will be loaded. | ||
| * | ||
| * * In browser, it resolves to `baseUrl(location.href)` i.e document's base URL | ||
| * (see: https://www.w3.org/TR/WD-html40-970917/htmlweb.html#h-5.1.2). | ||
| * | ||
| * * In node, it resolves to `file://${process.cwd()}`. | ||
| */ | ||
| function getAppBaseUrl() { | ||
| return UrlUtils_1.baseUrl(window.location.href); | ||
| } | ||
| exports.getAppBaseUrl = getAppBaseUrl; | ||
| //# sourceMappingURL=UrlPlatformUtils.web.js.map |
116066
-0.85%66
-2.94%2916
-0.88%