When setting noUncheckedIndexedAccess to true in a project consuming this library, type errors ensue:
node_modules/@elysiajs/static/src/index.ts:107:34 - error TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
Type 'undefined' is not assignable to type 'string'.
107 if (shouldIgnore(file)) continue
~~~~
node_modules/@elysiajs/static/src/index.ts:109:62 - error TS2769: No overload matches this call.
Overload 1 of 3, '(path: string | URL, options?: BlobPropertyBag | undefined): BunFile', gave the following error.
Argument of type 'string | undefined' is not assignable to parameter of type 'string | URL'.
Type 'undefined' is not assignable to type 'string | URL'.
Overload 2 of 3, '(path: Uint8Array | ArrayBufferLike, options?: BlobPropertyBag | undefined): BunFile', gave the following error.
Argument of type 'string | undefined' is not assignable to parameter of type 'Uint8Array | ArrayBufferLike'.
Type 'undefined' is not assignable to type 'Uint8Array | ArrayBufferLike'.
Overload 3 of 3, '(fileDescriptor: number, options?: BlobPropertyBag | undefined): BunFile', gave the following error.
Argument of type 'string | undefined' is not assignable to parameter of type 'number'.
Type 'undefined' is not assignable to type 'number'.
109 const response = () => new Response(Bun.file(file))
~~~~
node_modules/@elysiajs/static/src/index.ts:110:32 - error TS18048: 'file' is possibly 'undefined'.
110 let fileName = file
~~~~
When setting
noUncheckedIndexedAccess
totrue
in a project consuming this library, type errors ensue: