@brightspace-ui/core 3.9.0 → 3.9.1

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.
Files changed (2) hide show
  1. package/helpers/error.js +5 -3
  2. package/package.json +1 -1
package/helpers/error.js CHANGED
@@ -1,11 +1,13 @@
1
1
  import { getComposedParent } from './dom.js';
2
2
 
3
+ const numParentLevels = 10;
4
+
3
5
  function getComposedPath(elem, opts) {
4
6
 
5
7
  if (!opts?.composedPath) return '';
6
8
 
7
9
  const composedParents = [];
8
- let parent = elem;
10
+ let parent = getComposedParent(elem);
9
11
  while (parent !== null && parent?.tagName?.toLowerCase() !== 'body') {
10
12
  if (parent?.tagName) {
11
13
  composedParents.push(parent.tagName.toLowerCase());
@@ -15,8 +17,8 @@ function getComposedPath(elem, opts) {
15
17
 
16
18
  if (composedParents.length === 0) return '';
17
19
 
18
- composedParents.reverse();
19
- const path = ` Path: "${composedParents.join(' > ')}".`;
20
+ const slicedParents = composedParents.slice(0, numParentLevels);
21
+ const path = ` ${slicedParents.length} parent nodes: "${slicedParents.join(', ')}".`;
20
22
  return path;
21
23
 
22
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightspace-ui/core",
3
- "version": "3.9.0",
3
+ "version": "3.9.1",
4
4
  "description": "A collection of accessible, free, open-source web components for building Brightspace applications",
5
5
  "type": "module",
6
6
  "repository": "https://github.com/BrightspaceUI/core.git",