Fix TypeScript warnings: add explanatory comments to @ts-expect-error directives
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -117,18 +117,18 @@ export function createTextDecoder(label?: string, options?: TextDecoderOptions):
|
|||||||
export function installTextEncodingPolyfills(): void {
|
export function installTextEncodingPolyfills(): void {
|
||||||
const logger = new LoggerComponent('TextEncodingPolyfills');
|
const logger = new LoggerComponent('TextEncodingPolyfills');
|
||||||
|
|
||||||
// @ts-expect-error
|
// @ts-expect-error - global object access in React Native/Node environment
|
||||||
if (typeof global !== 'undefined') {
|
if (typeof global !== 'undefined') {
|
||||||
// @ts-expect-error
|
// @ts-expect-error - TextEncoder may not exist in global scope
|
||||||
if (typeof global.TextEncoder === 'undefined') {
|
if (typeof global.TextEncoder === 'undefined') {
|
||||||
// @ts-expect-error
|
// @ts-expect-error - Adding to global object
|
||||||
global.TextEncoder = TextEncoderPolyfill;
|
global.TextEncoder = TextEncoderPolyfill;
|
||||||
logger.info('Installed TextEncoder polyfill globally');
|
logger.info('Installed TextEncoder polyfill globally');
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-expect-error
|
// @ts-expect-error - TextDecoder may not exist in global scope
|
||||||
if (typeof global.TextDecoder === 'undefined') {
|
if (typeof global.TextDecoder === 'undefined') {
|
||||||
// @ts-expect-error
|
// @ts-expect-error - Adding to global object
|
||||||
global.TextDecoder = TextDecoderPolyfill;
|
global.TextDecoder = TextDecoderPolyfill;
|
||||||
logger.info('Installed TextDecoder polyfill globally');
|
logger.info('Installed TextDecoder polyfill globally');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user