@elastic/ems-client 7.14.0 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,61 +0,0 @@
1
- (function (global, factory) {
2
- if (typeof define === "function" && define.amd) {
3
- define(["exports"], factory);
4
- } else if (typeof exports !== "undefined") {
5
- factory(exports);
6
- } else {
7
- var mod = {
8
- exports: {}
9
- };
10
- factory(mod.exports);
11
- global.utils = mod.exports;
12
- }
13
- })(typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : this, function (_exports) {
14
- "use strict";
15
-
16
- Object.defineProperty(_exports, "__esModule", {
17
- value: true
18
- });
19
- _exports.toAbsoluteUrl = toAbsoluteUrl;
20
-
21
- /*
22
- * Licensed to Elasticsearch B.V. under one or more contributor
23
- * license agreements. See the NOTICE file distributed with
24
- * this work for additional information regarding copyright
25
- * ownership. Elasticsearch B.V. licenses this file to you under
26
- * the Apache License, Version 2.0 (the "License"); you may
27
- * not use this file except in compliance with the License.
28
- * You may obtain a copy of the License at
29
- *
30
- * http://www.apache.org/licenses/LICENSE-2.0
31
- *
32
- * Unless required by applicable law or agreed to in writing,
33
- * software distributed under the License is distributed on an
34
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
35
- * KIND, either express or implied. See the License for the
36
- * specific language governing permissions and limitations
37
- * under the License.
38
- */
39
-
40
- /**
41
- * Resolves a target URL path relative to the host.
42
- * This is specifically useed by the Kibana proxy re-routing.
43
- * It also handles trailing slashes in tileApiUrl and fileApiUrl parameters.
44
- */
45
- function toAbsoluteUrl(host, path) {
46
- if (!host) {
47
- return path;
48
- }
49
-
50
- var hostEndWithSlash = host[host.length - 1] === '/';
51
- var pathStartsWithSlash = path[0] === '/';
52
-
53
- if (hostEndWithSlash === true && pathStartsWithSlash === true) {
54
- return host + path.slice(1);
55
- } else if (hostEndWithSlash !== pathStartsWithSlash) {
56
- return host + path;
57
- } else {
58
- return host + '/' + path;
59
- }
60
- }
61
- });