diff --git a/const.ts b/const.ts index 8be89cc..9df5719 100644 --- a/const.ts +++ b/const.ts @@ -12,7 +12,11 @@ export const DEFAULT_RECORD_SIZE = 1024 * 64; export const RECORD_SIZE_MIN = 18; export const RECORD_SIZE_MAX = 2 ** 36 - 31; -export const encoder = new TextEncoder(); -export const CEK_INFO = encoder.encode("Content-Encoding: aes128gcm\0"); -export const NONCE_INFO = encoder.encode("Content-Encoding: nonce\0"); -export const ONE_BYTE = encoder.encode("\x01"); +export const encoder: TextEncoder = new TextEncoder(); +export const CEK_INFO: Uint8Array = encoder.encode( + "Content-Encoding: aes128gcm\0", +); +export const NONCE_INFO: Uint8Array = encoder.encode( + "Content-Encoding: nonce\0", +); +export const ONE_BYTE: Uint8Array = encoder.encode("\x01"); diff --git a/deno.json b/deno.json index 19f2e7e..f658f71 100644 --- a/deno.json +++ b/deno.json @@ -1,30 +1,39 @@ { - "compilerOptions": { - "allowJs": false, - "strict": true - }, - "lint": { - "include": [ - "." - ], - "exclude": [ - "dist/", - "npm/" - ], - "rules": { - "tags": [ - "recommended" - ] - } - }, - "fmt": { - "include": [ - "." - ], - "exclude": [ - "dist/", - "npm/" - ], - "indentWidth": 2 - } + "name": "@negrel/http-ece", + "version": "0.2.0", + "exports": "./mod.ts", + "compilerOptions": { + "allowJs": false, + "strict": true + }, + "lint": { + "include": [ + "." + ], + "exclude": [ + "dist/", + "npm/" + ], + "rules": { + "tags": [ + "recommended" + ] + } + }, + "fmt": { + "include": [ + "." + ], + "exclude": [ + "dist/", + "npm/" + ], + "indentWidth": 2 + }, + "imports": { + "@deno/dnt": "jsr:@deno/dnt@0.38.0", + "@std/encoding": "jsr:@std/encoding@0.224.0", + "@std/bytes": "jsr:@std/bytes@0.224.0", + "@std/assert": "jsr:@std/assert@0.224.0" + } } diff --git a/deps.ts b/deps.ts index 7c0a0c9..c9649c1 100644 --- a/deps.ts +++ b/deps.ts @@ -1,10 +1,10 @@ export { decodeBase64Url, encodeBase64Url, -} from "https://deno.land/std@0.224.0/encoding/base64url.ts"; +} from "@std/encoding/base64url"; export { decodeBase64, encodeBase64, -} from "https://deno.land/std@0.224.0/encoding/base64.ts"; +} from "@std/encoding/base64"; -export * as bytes from "https://deno.land/std@0.224.0/bytes/mod.ts"; +export * as bytes from "@std/bytes"; diff --git a/dev_deps.ts b/dev_deps.ts index 3d4fc32..262436a 100644 --- a/dev_deps.ts +++ b/dev_deps.ts @@ -4,4 +4,4 @@ export { assertFalse, assertNotEquals, assertThrows, -} from "https://deno.land/std@0.224.0/assert/mod.ts"; +} from "@std/assert"; diff --git a/scripts/build_npm.ts b/scripts/build_npm.ts index bbb865f..1eb660d 100644 --- a/scripts/build_npm.ts +++ b/scripts/build_npm.ts @@ -1,4 +1,4 @@ -import { build, emptyDir } from "https://deno.land/x/dnt@0.38.0/mod.ts"; +import { build, emptyDir } from "@deno/dnt"; const version = Deno.args[0]; if (!version) throw new Error("Missing version");