Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [1.1.0-beta.1](https://github.com/httpland/compression-middleware/compare/1.0.0...1.1.0-beta.1) (2023-04-02)


### Features

* **deps:** update deps version ([c8a343d](https://github.com/httpland/compression-middleware/commit/c8a343d90e74c9b205336a8d3874ffba01cc3a5c))

# 1.0.0 (2023-03-19)


Expand Down
8 changes: 4 additions & 4 deletions _dev_deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ export {
assertEquals,
assertFalse,
assertThrows,
} from "https://deno.land/std@0.180.0/testing/asserts.ts";
export { describe, it } from "https://deno.land/std@0.180.0/testing/bdd.ts";
} from "https://deno.land/std@0.181.0/testing/asserts.ts";
export { describe, it } from "https://deno.land/std@0.181.0/testing/bdd.ts";
export {
assertSpyCalls,
spy,
} from "https://deno.land/std@0.180.0/testing/mock.ts";
export { equalsResponse } from "https://deno.land/x/http_utils@1.0.0-beta.13/response.ts";
} from "https://deno.land/std@0.181.0/testing/mock.ts";
export { equalsResponse } from "https://deno.land/x/http_utils@1.0.0/response.ts";
25 changes: 18 additions & 7 deletions _tools/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,34 @@ export const makeOptions = (version: string): BuildOptions => ({
publishConfig: {
access: "public",
},
dependencies: {
"@types/compressible": "2.0.0",
"@types/node": "^18",
},
},
mappings: {
"https://esm.sh/compressible@2.0.18": {
"https://esm.sh/compressible@2.0.18?pin=v111": {
name: "compressible",
version: "2.0.18",
},
"https://deno.land/x/http_middleware@1.0.0/mod.ts": {
name: "@httpland/http-middleware",
version: "1.0.0",
},
"https://deno.land/x/http_utils@1.0.0-beta.13/header.ts": {
name: "@httpland/http-utils",
version: "1.0.0-beta.13",
"https://deno.land/x/isx@1.1.1/is_null.ts": {
name: "@miyauci/isx",
version: "1.1.1",
subPath: "is_null",
},
"https://deno.land/x/isx@1.1.1/is_iterable.ts": {
name: "@miyauci/isx",
version: "1.1.1",
subPath: "is_iterable",
},
"https://deno.land/x/isx@1.0.0-beta.24/mod.ts": {
name: "isxx",
version: "1.0.0-beta.24",
"https://deno.land/x/http_utils@1.0.0/header.ts": {
name: "@httpland/http-utils",
version: "1.0.0",
subPath: "header.js",
},
},
packageManager: "pnpm",
Expand Down
74 changes: 33 additions & 41 deletions deno.lock

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

14 changes: 6 additions & 8 deletions deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ export {
CachingHeader,
ContentNegotiationHeader,
RepresentationHeader,
} from "https://deno.land/x/http_utils@1.0.0-beta.13/header.ts";
export { acceptsEncodings } from "https://deno.land/std@0.180.0/http/negotiation.ts";
export { parseMediaType } from "https://deno.land/std@0.180.0/media_types/mod.ts";
export {
isIterable,
isNull,
} from "https://deno.land/x/isx@1.0.0-beta.24/mod.ts";
export { default as compressible } from "https://esm.sh/compressible@2.0.18";
} from "https://deno.land/x/http_utils@1.0.0/header.ts";
export { acceptsEncodings } from "https://deno.land/std@0.181.0/http/negotiation.ts";
export { parseMediaType } from "https://deno.land/std@0.181.0/media_types/mod.ts";
export { isNull } from "https://deno.land/x/isx@1.1.1/is_null.ts";
export { isIterable } from "https://deno.land/x/isx@1.1.1/is_iterable.ts";
export { default as compressible } from "https://esm.sh/compressible@2.0.18?pin=v111";
export { vary } from "https://deno.land/x/vary@1.0.0/mod.ts";
3 changes: 3 additions & 0 deletions utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@

import { RepresentationHeader } from "./deps.ts";

// TODO(miayuci): add strict parsing.

const ReNoTransform = /(?:^|,)\s*?no-transform\s*?(?:,|$)/;

export function isNoTransform(input: string): boolean {
return ReNoTransform.test(input);
}

/** Return new `Response` if the response include `Content-Length` header and readable. */
export async function reCalcContentLength(
response: Response,
): Promise<Response> {
Expand Down