Skip to content

Commit

Permalink
chore: use jsr instead of std and deno.land/x
Browse files Browse the repository at this point in the history
  • Loading branch information
kawarimidoll committed May 31, 2024
1 parent 0d6ef2b commit 4f9d551
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 10 deletions.
2 changes: 1 addition & 1 deletion api_handler_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "./deps.ts";
import { assertEquals } from "@std/assert";
import {
apiHandler,
apiHeaders,
Expand Down
2 changes: 1 addition & 1 deletion custom_url_search_params_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "./deps.ts";
import { assertEquals } from "@std/assert";
import { CustomURLSearchParams } from "./custom_url_search_params.ts";

const url = "https://test.com/api?text=hello&speed=100&flg=true&ng=false";
Expand Down
7 changes: 7 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"imports": {
"@ns/random": "jsr:@ns/random@^0.1.1",
"@std/assert": "jsr:@std/assert@^0.225.3",
"markup_tag": "https://deno.land/x/markup_tag@0.4.0/mod.ts"
}
}
70 changes: 70 additions & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
export { tag } from "https://deno.land/x/markup_tag@0.4.0/mod.ts";
export { assertEquals } from "https://deno.land/std@0.224.0/testing/asserts.ts";
export { randomInteger } from "https://deno.land/std@0.224.0/collections/_utils.ts";

import { range as genRange } from "https://deno.land/x/it_range@v1.0.3/range.mjs";
export function range(start: number, end?: number, step?: number): number[] {
return [...genRange(start, end, step)];
Expand Down
2 changes: 1 addition & 1 deletion get_pixel_positions_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "./deps.ts";
import { assertEquals } from "@std/assert";
import {
getCharacterArray,
getEncodedCharacter,
Expand Down
6 changes: 4 additions & 2 deletions svg.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { getPixelPositions } from "./get_pixel_positions.ts";
import { randomInteger, range, tag as h } from "./deps.ts";
import { range } from "./deps.ts";
import { randInt } from "@ns/random";
import { tag as h } from "markup_tag";

const svgID = "typograssy";
const xmlns = "http://www.w3.org/2000/svg";
Expand Down Expand Up @@ -73,7 +75,7 @@ export class Svg {

const textRects = pixelPositions.map((line, x) =>
line.map((y) => {
const color = randomInteger(1, colors.length - 1);
const color = randInt(1, colors.length - 1);
const ret = rect(x + offset, y, color);
if (needScroll && x < weeks - offset) {
return ret + rect(x + offset + steps, y, color);
Expand Down
2 changes: 1 addition & 1 deletion svg_test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "./deps.ts";
import { assertEquals } from "@std/assert";
import { Svg } from "./svg.ts";

Deno.test("error", async () => {
Expand Down

0 comments on commit 4f9d551

Please sign in to comment.