Skip to content

Commit ba7d58b

Browse files
committed
chore: update dependencies in yarn.lock and enhance className handling in buildElementSelector function
1 parent 18bd67c commit ba7d58b

2 files changed

Lines changed: 55 additions & 3 deletions

File tree

packages/javascript/src/utils/selector.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,17 @@ export function buildElementSelector(element: HTMLElement, maxDepth: number = 3)
1515
}
1616

1717
if (element.className) {
18-
selector += `.${element.className.split(' ').filter(Boolean).join('.')}`;
19-
return selector;
18+
/**
19+
* className can be a string, DOMTokenList, or SVGAnimatedString (e.g., in SVG elements)
20+
* Convert to string safely before calling split()
21+
* String() works for all types: string, DOMTokenList, SVGAnimatedString, etc.
22+
*/
23+
const classNameStr = String(element.className);
24+
25+
if (classNameStr) {
26+
selector += `.${classNameStr.split(' ').filter(Boolean).join('.')}`;
27+
return selector;
28+
}
2029
}
2130

2231
/**

yarn.lock

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,13 +316,29 @@
316316
minimatch "^3.0.4"
317317
strip-json-comments "^3.1.1"
318318

319+
"@hawk.so/javascript@^3.0.0":
320+
version "3.2.12"
321+
resolved "https://registry.yarnpkg.com/@hawk.so/javascript/-/javascript-3.2.12.tgz#9c654593d8166088dee992deb427621db2dfead1"
322+
integrity sha512-1yeuIG47a3EG5QtwlOwF4TyOZZlU568qy6iOR9zlovAUkQTQBFa69UD2iuhnfmZFO96pXtOgu38uUMyGMw+QDw==
323+
dependencies:
324+
"@hawk.so/types" "^0.1.36"
325+
error-stack-parser "^2.1.4"
326+
vite-plugin-dts "^4.2.4"
327+
319328
"@hawk.so/types@0.5.2":
320329
version "0.5.2"
321330
resolved "https://registry.yarnpkg.com/@hawk.so/types/-/types-0.5.2.tgz#504eabed7d510431411a3e39d8af008e76bb4f41"
322331
integrity sha512-+7gkelP6P5VMxOLHjcWUlX8hx8OR0k0ag9EyrqvJxMF+hNW49udARNM+PU5R0MFgyyq2L4ltCy0c2BsUi9yPww==
323332
dependencies:
324333
bson "^7.0.0"
325334

335+
"@hawk.so/types@^0.1.36":
336+
version "0.1.38"
337+
resolved "https://registry.yarnpkg.com/@hawk.so/types/-/types-0.1.38.tgz#b287f6d22025f53b6de7858c7c2eba1d8c52a00a"
338+
integrity sha512-IaAiM+T8sc+twZiZcAd90AwE7rEZfmfN1gvo8d+Ax53dhQCMBU+c/+6L+Z7XdCGe696mPGWqJGY26S8mRUg3BA==
339+
dependencies:
340+
"@types/mongodb" "^3.5.34"
341+
326342
"@humanwhocodes/config-array@^0.5.0":
327343
version "0.5.0"
328344
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9"
@@ -559,6 +575,13 @@
559575
resolved "https://registry.yarnpkg.com/@types/argparse/-/argparse-1.0.38.tgz#a81fd8606d481f873a3800c6ebae4f1d768a56a9"
560576
integrity sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==
561577

578+
"@types/bson@*":
579+
version "4.2.4"
580+
resolved "https://registry.yarnpkg.com/@types/bson/-/bson-4.2.4.tgz#3bb08ab0de5dd07103fba355361814019ba2ae88"
581+
integrity sha512-SG23E3JDH6y8qF20a4G9txLuUl+TCV16gxsKyntmGiJez2V9VBJr1Y8WxTBBD6OgBVcvspQ7sxgdNMkXFVcaEA==
582+
dependencies:
583+
bson "*"
584+
562585
"@types/color-name@^1.1.1":
563586
version "1.1.1"
564587
resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0"
@@ -578,6 +601,21 @@
578601
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
579602
integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=
580603

604+
"@types/mongodb@^3.5.34":
605+
version "3.6.20"
606+
resolved "https://registry.yarnpkg.com/@types/mongodb/-/mongodb-3.6.20.tgz#b7c5c580644f6364002b649af1c06c3c0454e1d2"
607+
integrity sha512-WcdpPJCakFzcWWD9juKoZbRtQxKIMYF/JIAM4JrNHrMcnJL6/a2NWjXxW7fo9hxboxxkg+icff8d7+WIEvKgYQ==
608+
dependencies:
609+
"@types/bson" "*"
610+
"@types/node" "*"
611+
612+
"@types/node@*":
613+
version "25.0.10"
614+
resolved "https://registry.yarnpkg.com/@types/node/-/node-25.0.10.tgz#4864459c3c9459376b8b75fd051315071c8213e7"
615+
integrity sha512-zWW5KPngR/yvakJgGOmZ5vTBemDoSqF3AcV/LrO5u5wTWyEAVVh+IT39G4gtyAkh3CtTZs8aX/yRM82OfzHJRg==
616+
dependencies:
617+
undici-types "~7.16.0"
618+
581619
"@types/semver@^7.5.0":
582620
version "7.5.8"
583621
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e"
@@ -969,7 +1007,7 @@ braces@^3.0.3:
9691007
dependencies:
9701008
fill-range "^7.1.1"
9711009

972-
bson@^7.0.0:
1010+
bson@*, bson@^7.0.0:
9731011
version "7.1.1"
9741012
resolved "https://registry.yarnpkg.com/bson/-/bson-7.1.1.tgz#19965d9138e1c4d88e4690414d91c84f217c84e8"
9751013
integrity sha512-TtJgBB+QyOlWjrbM+8bRgH84VM/xrDjyBFgSgGrfZF4xvt6gbEDtcswm27Tn9F9TWsjQybxT8b8VpCP/oJK4Dw==
@@ -2978,6 +3016,11 @@ unbox-primitive@^1.0.2:
29783016
has-symbols "^1.0.3"
29793017
which-boxed-primitive "^1.0.2"
29803018

3019+
undici-types@~7.16.0:
3020+
version "7.16.0"
3021+
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.16.0.tgz#ffccdff36aea4884cbfce9a750a0580224f58a46"
3022+
integrity sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==
3023+
29813024
universalify@^0.1.0:
29823025
version "0.1.2"
29833026
resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66"

0 commit comments

Comments
 (0)