@hpcc-js/common 3.6.3 → 3.7.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hpcc-js/common",
3
- "version": "3.6.3",
3
+ "version": "3.7.0",
4
4
  "description": "hpcc-js - Viz Common",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",
@@ -39,7 +39,7 @@
39
39
  "update-major": "npx --yes npm-check-updates -u"
40
40
  },
41
41
  "dependencies": {
42
- "@hpcc-js/util": "^3.4.6",
42
+ "@hpcc-js/util": "^3.4.8",
43
43
  "@types/d3-array": "1.2.12",
44
44
  "@types/d3-brush": "1.1.8",
45
45
  "@types/d3-collection": "1.0.13",
@@ -57,7 +57,7 @@
57
57
  "@types/d3-zoom": "1.8.7"
58
58
  },
59
59
  "devDependencies": {
60
- "@hpcc-js/esbuild-plugins": "^1.8.2",
60
+ "@hpcc-js/esbuild-plugins": "^1.8.3",
61
61
  "colorbrewer": "1.6.1",
62
62
  "d3-array": "^1",
63
63
  "d3-brush": "^1",
@@ -88,5 +88,5 @@
88
88
  "url": "https://github.com/hpcc-systems/Visualization/issues"
89
89
  },
90
90
  "homepage": "https://github.com/hpcc-systems/Visualization",
91
- "gitHead": "99595523fbe7b16b75fc22b03666b9f249257a50"
91
+ "gitHead": "0c1e3df0f2ae628352200f8f8fd6b91b976f69c3"
92
92
  }
package/src/Utility.ts CHANGED
@@ -395,10 +395,14 @@ export function faCode(key: string): number {
395
395
  return faChar(key).charCodeAt(0);
396
396
  }
397
397
 
398
+ let _removeHTMLFromStringDiv: HTMLDivElement;
398
399
  export function removeHTMLFromString(str: string, div?: HTMLDivElement) {
399
- div = div ? div : document.createElement("div");
400
+ if (div === undefined && _removeHTMLFromStringDiv === undefined) {
401
+ _removeHTMLFromStringDiv = document.createElement("div");
402
+ }
403
+ div = div ?? _removeHTMLFromStringDiv;
400
404
  div.innerHTML = str;
401
- return div.textContent || div.innerText || "";
405
+ return div.textContent ?? div.innerText ?? "";
402
406
  }
403
407
 
404
408
  // Template ---