Skip to content

Commit a360a0c

Browse files
Merge pull request #3 from httpland/beta
Beta
2 parents fcf81aa + 657e1b0 commit a360a0c

File tree

9 files changed

+100
-58
lines changed

9 files changed

+100
-58
lines changed

CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
# [1.2.0-beta.1](https://github.com/httpland/conditional-request-middleware/compare/1.1.0...1.2.0-beta.1) (2023-05-02)
2+
3+
4+
### Bug Fixes
5+
6+
* **if_match:** fix to parse list-based fields syntax ([0c0006d](https://github.com/httpland/conditional-request-middleware/commit/0c0006dfde15b0ff379e9bf1528af3a9b75226f9))
7+
8+
9+
### Features
10+
11+
* **deps:** update deps version ([192e84f](https://github.com/httpland/conditional-request-middleware/commit/192e84f24f5cad9ccfc5bea9f2876cd92898a9d6))
12+
113
# [1.1.0](https://github.com/httpland/conditional-request-middleware/compare/1.0.0...1.1.0) (2023-04-02)
214

315

_tools/build_npm.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { build, emptyDir } from "https://deno.land/x/dnt@0.33.1/mod.ts";
1+
import { build, emptyDir } from "https://deno.land/x/dnt@0.34.0/mod.ts";
22
import { join } from "https://deno.land/[email protected]/path/mod.ts";
33
import { makeOptions } from "./meta.ts";
44

_tools/meta.ts

+30-30
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const makeOptions = (version: string): BuildOptions => ({
44
test: false,
55
shims: {},
66
compilerOptions: {
7-
lib: ["esnext", "dom"],
7+
lib: ["esnext", "dom", "dom.iterable"],
88
},
99
typeCheck: true,
1010
entryPoints: ["./mod.ts"],
@@ -44,45 +44,50 @@ export const makeOptions = (version: string): BuildOptions => ({
4444
},
4545
packageManager: "pnpm",
4646
mappings: {
47-
"https://deno.land/x/isx@1.1.1/is_boolean.ts": {
47+
"https://deno.land/x/isx@1.3.1/is_boolean.ts": {
4848
name: "@miyauci/isx",
49-
version: "1.1.1",
50-
subPath: "is_boolean",
49+
version: "1.3.1",
50+
subPath: "is_boolean.js",
5151
},
52-
"https://deno.land/x/isx@1.1.1/is_null.ts": {
52+
"https://deno.land/x/isx@1.3.1/is_null.ts": {
5353
name: "@miyauci/isx",
54-
version: "1.1.1",
55-
subPath: "is_null",
54+
version: "1.3.1",
55+
subPath: "is_null.js",
5656
},
57-
"https://deno.land/x/isx@1.1.1/is_string.ts": {
57+
"https://deno.land/x/isx@1.3.1/is_string.ts": {
5858
name: "@miyauci/isx",
59-
version: "1.1.1",
60-
subPath: "is_string",
59+
version: "1.3.1",
60+
subPath: "is_string.js",
6161
},
62-
"https://deno.land/x/isx@1.1.1/is_number.ts": {
62+
"https://deno.land/x/isx@1.3.1/is_number.ts": {
6363
name: "@miyauci/isx",
64-
version: "1.1.1",
65-
subPath: "is_number",
64+
version: "1.3.1",
65+
subPath: "is_number.js",
6666
},
67-
"https://deno.land/x/isx@1.1.1/number/is_negative_number.ts": {
67+
"https://deno.land/x/isx@1.3.1/number/is_negative_number.ts": {
6868
name: "@miyauci/isx",
69-
version: "1.1.1",
70-
subPath: "number/is_negative_number",
69+
version: "1.3.1",
70+
subPath: "number/is_negative_number.js",
7171
},
7272
"https://deno.land/x/[email protected]/mod.ts": {
7373
name: "@httpland/http-middleware",
7474
version: "1.0.0",
7575
},
76-
"https://deno.land/x/http_utils@1.0.0/header.ts": {
76+
"https://deno.land/x/http_utils@1.2.0/header.ts": {
7777
name: "@httpland/http-utils",
78-
version: "1.0.0",
78+
version: "1.2.0",
7979
subPath: "header.js",
8080
},
81-
"https://deno.land/x/http_utils@1.0.0/method.ts": {
81+
"https://deno.land/x/http_utils@1.2.0/method.ts": {
8282
name: "@httpland/http-utils",
83-
version: "1.0.0",
83+
version: "1.2.0",
8484
subPath: "method.js",
8585
},
86+
"https://deno.land/x/[email protected]/list.ts": {
87+
name: "@httpland/http-utils",
88+
version: "1.2.0",
89+
subPath: "list.js",
90+
},
8691
"https://deno.land/x/[email protected]/mod.ts": {
8792
name: "@miyauci/result",
8893
version: "1.0.0",
@@ -91,19 +96,14 @@ export const makeOptions = (version: string): BuildOptions => ({
9196
name: "@httpland/range-request-middleware",
9297
version: "1.2.0",
9398
},
94-
"https://deno.land/x/[email protected].0/mod.ts": {
99+
"https://deno.land/x/[email protected].1/mod.ts": {
95100
name: "@httpland/accept-ranges-parser",
96-
version: "1.0.0",
97-
},
98-
"https://deno.land/x/[email protected]/trim.ts": {
99-
name: "@miyauci/prelude",
100-
version: "1.0.0",
101-
subPath: "trim",
101+
version: "1.0.1",
102102
},
103-
"https://deno.land/x/prelude_js@1.0.0/to_lower_case.ts": {
103+
"https://deno.land/x/prelude_js@1.2.0/to_lower_case.ts": {
104104
name: "@miyauci/prelude",
105-
version: "1.0.0",
106-
subPath: "to_lower_case",
105+
version: "1.2.0",
106+
subPath: "to_lower_case.js",
107107
},
108108
},
109109
});

_tools/publish_npm.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@ if (import.meta.main) {
1616
const tag = isPrerelease?.[0] ?? "latest";
1717

1818
const pkg = makeOptions(version);
19-
const result = await Deno.run({
20-
cmd: ["npm", "publish", pkg.outDir, "--tag", String(tag)],
21-
stdout: "piped",
22-
})
23-
.output();
19+
const command = new Deno.Command("npm", {
20+
args: ["publish", pkg.outDir, "--tag", String(tag)],
21+
});
22+
const result = await command.output();
2423

25-
console.log(new TextDecoder().decode(result));
24+
if (!result.success) {
25+
console.error(new TextDecoder().decode(result.stderr));
26+
}
2627
}

deno.lock

+33-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@ export {
77
type SuccessfulStatus,
88
} from "https://deno.land/[email protected]/http/http_status.ts";
99
export { distinct } from "https://deno.land/[email protected]/collections/distinct.ts";
10-
export { isBoolean } from "https://deno.land/x/[email protected]/is_boolean.ts";
11-
export { isNull } from "https://deno.land/x/[email protected]/is_null.ts";
12-
export { isString } from "https://deno.land/x/[email protected]/is_string.ts";
13-
export { isNumber } from "https://deno.land/x/[email protected]/is_number.ts";
14-
export { isNegativeNumber } from "https://deno.land/x/[email protected]/number/is_negative_number.ts";
15-
export { trim } from "https://deno.land/x/[email protected]/trim.ts";
16-
export { toLowerCase } from "https://deno.land/x/[email protected]/to_lower_case.ts";
10+
export { isBoolean } from "https://deno.land/x/[email protected]/is_boolean.ts";
11+
export { isNull } from "https://deno.land/x/[email protected]/is_null.ts";
12+
export { isString } from "https://deno.land/x/[email protected]/is_string.ts";
13+
export { isNumber } from "https://deno.land/x/[email protected]/is_number.ts";
14+
export { isNegativeNumber } from "https://deno.land/x/[email protected]/number/is_negative_number.ts";
15+
export { toLowerCase } from "https://deno.land/x/[email protected]/to_lower_case.ts";
1716
export {
1817
type Handler,
1918
type Middleware,
@@ -25,11 +24,12 @@ export {
2524
isRepresentationHeader,
2625
RangeHeader,
2726
RepresentationHeader,
28-
} from "https://deno.land/x/http_utils@1.0.0/header.ts";
27+
} from "https://deno.land/x/http_utils@1.2.0/header.ts";
2928
export {
3029
isRetrieveMethod,
3130
Method,
32-
} from "https://deno.land/x/[email protected]/method.ts";
31+
} from "https://deno.land/x/[email protected]/method.ts";
32+
export { parseListFields } from "https://deno.land/x/[email protected]/list.ts";
3333
export {
3434
compareStrong,
3535
compareWeak,
@@ -39,7 +39,7 @@ export {
3939
} from "https://deno.land/x/[email protected]/mod.ts";
4040
export { isErr, unsafe } from "https://deno.land/x/[email protected]/mod.ts";
4141
export { ascend } from "https://deno.land/[email protected]/collections/_comparators.ts";
42-
export { withContentRange } from "https://deno.land/x/range_request_middleware@1.2.0/transform.ts";
42+
export { withContentRange } from "https://deno.land/x/range_request_middleware@1.3.0/transform.ts";
4343
export {
4444
type BytesContext,
4545
BytesRange,
@@ -52,11 +52,11 @@ export {
5252
type RangesSpecifier,
5353
type SuffixRange,
5454
} from "https://deno.land/x/[email protected]/mod.ts";
55-
export { default as parseHttpDate } from "https://esm.sh/[email protected]";
55+
export { default as parseHttpDate } from "https://esm.sh/[email protected]?pin=v118";
5656
export {
5757
parseAcceptRanges,
5858
type Token,
59-
} from "https://deno.land/x/[email protected].0/mod.ts";
59+
} from "https://deno.land/x/[email protected].1/mod.ts";
6060

6161
export function not<T extends readonly unknown[]>(
6262
fn: (...args: T) => boolean,

if_match.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
// TODO(miyauci): External Packaging
55

6-
import { type ETag, parseETag, trim } from "./deps.ts";
6+
import { type ETag, parseETag, parseListFields } from "./deps.ts";
77

88
export type IfMatch = Star | ETag[];
99
export type IfNoneMatch = IfMatch;
@@ -15,9 +15,5 @@ export type Star = "*";
1515
export function parse(input: string): IfMatch | IfNoneMatch {
1616
if (input === "*") return input;
1717

18-
return input
19-
.split(",")
20-
.map(trim)
21-
.filter(Boolean)
22-
.map(parseETag);
18+
return parseListFields(input).map(parseETag);
2319
}

if_match_test.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ describe("parse", () => {
4444
tag: "*",
4545
weak: false,
4646
}]],
47+
48+
[`","`, [{ tag: ",", weak: false }]],
4749
];
4850

4951
table.forEach(([input, expected]) => {
@@ -57,7 +59,6 @@ describe("parse", () => {
5759
"* a",
5860
"*,",
5961
`*, ""`,
60-
`","`,
6162
`* *`,
6263
`**`,
6364
`"", *`,

preconditions/utils_test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ describe("ifNoneMatch", () => {
7171
[`"a", "b", "c"`, `"d"`],
7272
[`W/"a", "b", "c"`, `"d"`],
7373
[`W/"a", "b", "c"`, `W/"d"`],
74+
[`"abc,def"`, `""`],
7475
];
7576

7677
table.forEach(([filedValue, etag]) => {
@@ -83,7 +84,6 @@ describe("ifNoneMatch", () => {
8384
["", ""],
8485
[`""`, `"`],
8586
[`"`, `""`],
86-
[`"abc,def"`, `""`],
8787
];
8888

8989
table.forEach(([filedValue, etag]) => {

0 commit comments

Comments
 (0)