Skip to content

Commit 9cbaaad

Browse files
antonisclaude
andcommitted
fix(core): Fix TS build error with bracket notation for isWellFormed
Use typed interface cast instead of bracket notation to avoid TS7015 (implicit any from index expression) in strict builds. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 58c5a0e commit 9cbaaad

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/core/src/logs/internal.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@ function sanitizeLogAttributes(attributes: Attributes): Attributes {
252252
* On older runtimes without native support, returns the string as-is.
253253
*/
254254
export function _INTERNAL_removeLoneSurrogates(str: string): string {
255-
if (typeof str['isWellFormed'] === 'function') {
256-
return str['isWellFormed']() ? str : str['toWellFormed']();
255+
const s = str as unknown as { isWellFormed?: () => boolean; toWellFormed?: () => string };
256+
if (typeof s.isWellFormed === 'function') {
257+
return s.isWellFormed() ? str : (s.toWellFormed as () => string)();
257258
}
258259
return str;
259260
}

0 commit comments

Comments
 (0)