diff --git a/deno.json b/deno.json index a5bf462..ba31417 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@nick/utf8", - "version": "0.3.2", + "version": "0.4.0", "license": "MIT", "author": { "name": "Nicholas Berlette", @@ -28,6 +28,11 @@ "fix": "deno fmt && deno lint --fix", "ok": "deno fmt --check && deno lint && deno run test" }, + "lint": { + "rules": { + "exclude": ["no-import-prefix"] + } + }, "lock": false, "nodeModulesDir": "auto", "publish": { diff --git a/src/_internal.ts b/src/_internal.ts index 1e4fc16..b9b4b19 100644 --- a/src/_internal.ts +++ b/src/_internal.ts @@ -186,7 +186,7 @@ export const TypedArray: TypedArrayConstructor = ObjectGetPrototypeOf( Uint8Array, ); export const TypedArrayPrototype: InstanceType = - TypedArray?.prototype!; + TypedArray?.prototype! as InstanceType; export const TypedArrayPrototypeGetToStringTag: { (target: unknown): TypedArrayToStringTag | undefined; } = uncurryGetter(TypedArrayPrototype, Symbol.toStringTag) as any; @@ -274,7 +274,7 @@ export function toUint8Array(input?: BufferSource | null): Uint8Array { return new Uint8Array(input); } catch (_) { try { - ArrayBufferPrototypeGetByteLength(input); + ArrayBufferPrototypeGetByteLength(input as ArrayBuffer); return new Uint8Array(input); } catch (_) { throw new TypeError( diff --git a/src/shim.ts b/src/shim.ts index bdc49ee..00dcdbd 100644 --- a/src/shim.ts +++ b/src/shim.ts @@ -39,6 +39,8 @@ * ``` * @module shim */ +import type {} from "./shim.d.ts"; + import { TextEncoder } from "./text_encoder.ts"; import { TextDecoder } from "./text_decoder.ts"; import { TextDecoderStream, TextEncoderStream } from "./streams.ts"; diff --git a/src/text_decoder.ts b/src/text_decoder.ts index 450e7d4..61c6f29 100644 --- a/src/text_decoder.ts +++ b/src/text_decoder.ts @@ -73,7 +73,7 @@ export class TextDecoder { readonly #fatal: boolean; readonly #ignoreBOM: boolean; - #buffer = new Uint8Array(0); + #buffer: Uint8Array = new Uint8Array(0); /** * Creates a new TextDecoder instance.