Skip to content

Commit 70da740

Browse files
committed
chore: update to @std 1.0
1 parent d34523a commit 70da740

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

deps_test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export { assertRejects } from "jsr:@std/assert@^1.0/rejects";
1313
export { assertStrictEquals } from "jsr:@std/assert@^1.0/strict-equals";
1414
export { assertThrows } from "jsr:@std/assert@^1.0/throws";
1515
export { timingSafeEqual } from "jsr:@std/crypto@^1.0/timing-safe-equal";
16-
export { calculate } from "jsr:@std/http@0.224/etag";
17-
export { FakeTime } from "jsr:@std/testing@0.225/time";
16+
export { eTag } from "jsr:@std/http@^1.0/etag";
17+
export { FakeTime } from "jsr:@std/testing@^1.0/time";

http_errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
* @module
4747
*/
4848

49-
import { accepts } from "jsr:@std/http@0.224/negotiation";
49+
import { accepts } from "jsr:@std/http@^1.0/negotiation";
5050
import { contentType } from "jsr:@std/media-types@^1.0/content-type";
5151

5252
import {

range.test.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
import { assertThrows } from "./deps_test.ts";
2-
import {
3-
assert,
4-
assertEquals,
5-
calculate,
6-
timingSafeEqual,
7-
} from "./deps_test.ts";
2+
import { assert, assertEquals, eTag, timingSafeEqual } from "./deps_test.ts";
83

94
import {
105
MultiPartByteRangesStream,
@@ -22,8 +17,8 @@ const fixtureInfoNoMtime = {
2217
size: 65_000,
2318
mtime: null,
2419
};
25-
const etag = (await calculate(fixture))!;
26-
const weakEtag = (await calculate(fixtureInfo))!;
20+
const etag = (await eTag(fixture))!;
21+
const weakEtag = (await eTag(fixtureInfo))!;
2722

2823
Deno.test({
2924
name: "range - no range - entity + fileInfo",

range.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,7 @@
7878

7979
import { assert } from "jsr:/@std/assert@^1.0/assert";
8080
import { concat } from "jsr:/@std/bytes@^1.0/concat";
81-
import {
82-
calculate,
83-
type Entity,
84-
type FileInfo,
85-
} from "jsr:/@std/[email protected]/etag";
81+
import { eTag, type FileInfo } from "jsr:/@std/http@^1.0/etag";
8682

8783
/**
8884
* A descriptor for the start and end of a byte range, which are inclusive of
@@ -169,6 +165,11 @@ export interface ResponseRangeOptions {
169165
type?: string;
170166
}
171167

168+
/**
169+
* The valid forms of an entity which can be used with the range functions.
170+
*/
171+
export type Entity = FileInfo | string | Uint8Array;
172+
172173
const DEFAULT_CHUNK_SIZE = 524_288;
173174
const ETAG_RE = /(?:W\/)?"[ !#-\x7E\x80-\xFF]+"/;
174175
const encoder = new TextEncoder();
@@ -587,7 +588,8 @@ export async function range(
587588
if (!fileInfo || match.startsWith("W")) {
588589
return { ok: true, ranges: null };
589590
}
590-
if (match !== await calculate(entity)) {
591+
// @ts-ignore the types for eTag are not correct
592+
if (match !== await eTag(entity)) {
591593
return { ok: true, ranges: null };
592594
}
593595
} else {

0 commit comments

Comments
 (0)