primate 0.29.4 → 0.29.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "primate",
3
- "version": "0.29.4",
3
+ "version": "0.29.5",
4
4
  "description": "Polymorphic development platform",
5
5
  "homepage": "https://primatejs.com",
6
6
  "bugs": "https://github.com/primatejs/primate/issues",
@@ -19,7 +19,7 @@
19
19
  "directory": "packages/primate"
20
20
  },
21
21
  "dependencies": {
22
- "rcompat": "^0.8.0"
22
+ "rcompat": "^0.8.3"
23
23
  },
24
24
  "engines": {
25
25
  "node": ">=18"
@@ -1,6 +1,6 @@
1
1
  import { Response, Status, MediaType } from "rcompat/http";
2
2
  import { cascade, tryreturn } from "rcompat/async";
3
- import { respond } from "./respond/exports.js";
3
+ import respond from "./respond.js";
4
4
  import { error as clientError } from "../handlers.js";
5
5
 
6
6
  const guard_error = Symbol("guard_error");
@@ -9,8 +9,8 @@ const not_found = value => {
9
9
  const is_text = value => typeof value === "string";
10
10
  const is_non_null_object = value => typeof value === "object" && value !== null;
11
11
  const is_instance = of => value => value instanceof of;
12
- const is_response = is_instance(Response);
13
- const is_global_response = is_instance(globalThis.Response);
12
+ const is_response = is_instance(globalThis.Response);
13
+ const is_fake_response = is_instance(Response);
14
14
  const is_streamable =
15
15
  value => value instanceof Blob || value?.streamable === s_streamable;
16
16
 
@@ -19,7 +19,7 @@ const guesses = [
19
19
  [is_instance(URL), redirect],
20
20
  [is_streamable, value => stream(value.stream())],
21
21
  [is_instance(ReadableStream), stream],
22
- [value => is_response(value) || is_global_response(value), identity],
22
+ [value => is_response(value) || is_fake_response(value), value => _ => value],
23
23
  [is_non_null_object, json],
24
24
  [is_text, text],
25
25
  [not_found, identity],
@@ -1,4 +0,0 @@
1
- import { Headers } from "rcompat/http";
2
-
3
- export default value =>
4
- value.body !== undefined && value.headers instanceof Headers;
@@ -1 +0,0 @@
1
- export { default as respond } from "./respond.js";