Skip to content

Commit

Permalink
fix: changes for publishing to jsr.io (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy authored Feb 6, 2024
1 parent be8a02c commit 3bbeef3
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
3 changes: 3 additions & 0 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"name": "@denosaurs/plug",
"version": "1.0.3",
"exports": "./mod.ts",
"lock": false,
"importMap": "./import_map.json"
}
8 changes: 4 additions & 4 deletions deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export {
normalize,
resolve,
toFileUrl,
} from "https://deno.land/std@0.203.0/path/mod.ts";
export { ensureDir } from "https://deno.land/std@0.203.0/fs/mod.ts";
export { encode as hex } from "https://deno.land/std@0.203.0/encoding/hex.ts";
export { green } from "https://deno.land/std@0.203.0/fmt/colors.ts";
} from "jsr:@std/path@0.213.1";
export { ensureDir } from "jsr:@std/fs@0.213.1";
export { encodeHex as hex } from "jsr:@std/encoding@0.213.1/hex";
export { green } from "jsr:@std/fmt@0.213.1/colors";
2 changes: 2 additions & 0 deletions download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const defaultExtensions: OsRecord<string> = {
aix: "so",
solaris: "so",
illumos: "so",
android: "so",
};

export const defaultPrefixes: OsRecord<string> = {
Expand All @@ -56,6 +57,7 @@ export const defaultPrefixes: OsRecord<string> = {
solaris: "lib",
illumos: "lib",
windows: "",
android: "lib",
};

function getCrossOption<T>(record?: NestedCrossRecord<T>): T | undefined {
Expand Down
4 changes: 2 additions & 2 deletions test_deps.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "https://deno.land/std@0.203.0/assert/mod.ts";
export * from "https://deno.land/std@0.203.0/path/mod.ts";
export * from "https://deno.land/std@0.214.0/assert/mod.ts";
export * from "https://deno.land/std@0.214.0/path/mod.ts";
8 changes: 3 additions & 5 deletions util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,9 @@ export function stringToURL(url: string): URL {
}

export async function hash(value: string): Promise<string> {
return decoder.decode(
hex(
new Uint8Array(
await crypto.subtle.digest("SHA-256", encoder.encode(value)),
),
return hex(
new Uint8Array(
await crypto.subtle.digest("SHA-256", encoder.encode(value)),
),
);
}
Expand Down

0 comments on commit 3bbeef3

Please sign in to comment.