Skip to content

Commit

Permalink
convert to jsr module
Browse files Browse the repository at this point in the history
  • Loading branch information
negrel committed May 7, 2024
1 parent 6098335 commit 78cd040
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 37 deletions.
12 changes: 8 additions & 4 deletions const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
65 changes: 37 additions & 28 deletions deno.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
6 changes: 3 additions & 3 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -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";
2 changes: 1 addition & 1 deletion dev_deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export {
assertFalse,
assertNotEquals,
assertThrows,
} from "https://deno.land/std@0.224.0/assert/mod.ts";
} from "@std/assert";
2 changes: 1 addition & 1 deletion scripts/build_npm.ts
Original file line number Diff line number Diff line change
@@ -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");
Expand Down

0 comments on commit 78cd040

Please sign in to comment.