@elastic/ems-client 8.3.3 → 8.4.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,13 +1,12 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2
-
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
2
  /*
4
3
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
4
  * or more contributor license agreements. Licensed under the Elastic License
6
5
  * 2.0; you may not use this file except in compliance with the Elastic License
7
6
  * 2.0.
8
7
  */
9
- import chroma from 'chroma-js';
10
8
 
9
+ import chroma from 'chroma-js';
11
10
  /**
12
11
  * Resolves a target URL path relative to the host.
13
12
  * This is specifically useed by the Kibana proxy re-routing.
@@ -17,10 +16,8 @@ export function toAbsoluteUrl(host, path) {
17
16
  if (!host) {
18
17
  return path;
19
18
  }
20
-
21
19
  var hostEndWithSlash = host[host.length - 1] === '/';
22
20
  var pathStartsWithSlash = path[0] === '/';
23
-
24
21
  if (hostEndWithSlash === true && pathStartsWithSlash === true) {
25
22
  return host + path.slice(1);
26
23
  } else if (hostEndWithSlash !== pathStartsWithSlash) {
@@ -29,6 +26,7 @@ export function toAbsoluteUrl(host, path) {
29
26
  return host + '/' + path;
30
27
  }
31
28
  }
29
+
32
30
  /*
33
31
  Type with the possible ways to define a color in maplibre
34
32
  */
@@ -51,16 +49,16 @@ function transformColor(paintColor, func) {
51
49
  return newPaintColor;
52
50
  } else return paintColor;
53
51
  }
52
+
54
53
  /*
55
54
  This is the function used to generate the current EMS desaturated roadmap
56
55
  */
57
-
58
-
59
56
  export function desaturateColor(paintColor) {
60
57
  return transformColor(paintColor, function (color) {
61
58
  return chroma(color).desaturate(1.1).brighten(0.33);
62
59
  });
63
60
  }
61
+
64
62
  /*
65
63
  Blends an original maplibre color definition with a destination
66
64
  color. Accepts different blending modes and an additional `mix`
@@ -71,7 +69,6 @@ More details:
71
69
  https://gka.github.io/chroma.js/#chroma-blend
72
70
  https://gka.github.io/chroma.js/#chroma-mix
73
71
  */
74
-
75
72
  export function colorizeColor(sourceColor, destColor) {
76
73
  var operation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'screen';
77
74
  var percentage = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.5;