Skip to content

Commit e3924f0

Browse files
fix: use jsr imports
1 parent d357aff commit e3924f0

File tree

8 files changed

+235
-29
lines changed

8 files changed

+235
-29
lines changed

deno.jsonc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,9 @@
44
"format": "deno run -A npm:@biomejs/biome format . --write",
55
"lint": "deno run -A npm:@biomejs/biome lint ."
66
},
7-
"exclude": ["npm"]
7+
"exclude": ["npm"],
8+
"imports": {
9+
"@deno/dnt": "jsr:@deno/dnt@^0.41.1",
10+
"@std/assert": "jsr:@std/assert@^0.225.3"
11+
}
812
}

deno.lock

Lines changed: 225 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps_dev.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

scripts/build_npm.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// This dependancy cannot be moved to dev_deps.ts since dnt complains about a top-level await
2-
import { build, emptyDir } from "https://deno.land/x/[email protected]/mod.ts";
1+
import { build, emptyDir } from "@deno/dnt";
32

43
if (!Deno.args[0]) {
54
throw new Error("No version specified");

src/core/parentClient_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertRejects } from "../../deps_dev.ts";
1+
import { assertRejects } from "@std/assert";
22
import { ParentClient } from "../core/parentClient.ts";
33

44
Deno.test("Throws when no email is provided", async () => {

src/core/studentClient_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertRejects } from "../../deps_dev.ts";
1+
import { assertRejects } from "@std/assert";
22
import { StudentClient } from "../core/studentClient.ts";
33

44
Deno.test("Throws when no student code is provided", async () => {

src/utils/utils.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@ export function parseCookies(input: string) {
88
const cookies = input.split(",");
99
for (const cookie of cookies) {
1010
const cookieSplit = cookie.split(";")[0].split("=");
11-
output[leftTrim(decodeURIComponent(cookieSplit[0]))] = decodeURIComponent(
11+
output[decodeURIComponent(cookieSplit[0]).trimStart()] = decodeURIComponent(
1212
cookieSplit[1],
1313
);
1414
}
1515
return output;
1616
}
17-
export function leftTrim(str: string) {
18-
return str.replace(/^\s+/g, "");
19-
}

src/utils/utils_test.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { assertEquals, assertExists } from "../../deps_dev.ts";
1+
import { assertEquals, assertExists } from "@std/assert";
22
import { parseCookies } from "./utils.ts";
33
Deno.test("Parses simple cookie", () => {
44
const cookie =
@@ -22,16 +22,3 @@ Deno.test("Parses cookie with no value", () => {
2222
assertExists(parsed.cookieWithNoValue);
2323
assertEquals(parsed.cookieWithNoValue, "");
2424
});
25-
26-
import { leftTrim } from "./utils.ts";
27-
Deno.test("Trims left with spaces", () => {
28-
const input = " Hello world!";
29-
const output = leftTrim(input);
30-
assertEquals(output, "Hello world!");
31-
});
32-
33-
Deno.test("Trims left with no spaces", () => {
34-
const input = "Hello world!";
35-
const output = leftTrim(input);
36-
assertEquals(output, "Hello world!");
37-
});

0 commit comments

Comments
 (0)