Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
terrablue committed Aug 4, 2024
1 parent a2d24f4 commit f9d83e3
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@rcompat/crypto": "^0.5.0",
"@rcompat/fs": "^0.4.0",
"@rcompat/function": "^0.4.0",
"@rcompat/http": "^0.5.0",
"@rcompat/http": "^0.5.1",
"@rcompat/invariant": "^0.5.0",
"@rcompat/object": "^0.5.0",
"@rcompat/package": "^0.7.0",
Expand Down
5 changes: 2 additions & 3 deletions packages/core/src/serve/hook/respond.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import identity from "@rcompat/function/identity";
import proper from "@rcompat/object/proper";

const is_instance = of => value => value instanceof of;
const is_response = is_instance(globalThis.Response);
const is_fake_response = is_instance(Response);
const is_response = is_instance(Response);
const is_streamable =
value => value instanceof Blob || value?.streamable === streamable;

Expand All @@ -18,7 +17,7 @@ const guesses = [
[is_instance(URL), redirect],
[is_streamable, value => stream(value.stream())],
[is_instance(ReadableStream), stream],
[value => is_response(value) || is_fake_response(value), value => _ => value],
[value => is_response(value), value => _ => value],
[proper, json],
[value => typeof value === "string", text],
[bad_body, identity],
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@rcompat/build": "^0.4.0",
"@rcompat/crypto": "^0.5.0",
"@rcompat/fs": "^0.4.0",
"@rcompat/http": "^0.5.0",
"@rcompat/http": "^0.5.1",
"@rcompat/object": "^0.5.0"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@primate/core": "workspace:^",
"@rcompat/cli": "^0.5.1",
"@rcompat/fs": "^0.4.0",
"@rcompat/http": "^0.5.0"
"@rcompat/http": "^0.5.1"
},
"type": "module",
"imports": {
Expand Down
6 changes: 3 additions & 3 deletions packages/store/src/private/driver/json/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import file from "@rcompat/fs/file";
export default async ({ database }) => {
is(database).string();

const fileref = file(database);
const dbfile = file(database);
const db = {
collections: await fileref.exists() ? await fileref.json() : {},
collections: await dbfile.exists() ? await dbfile.json() : {},
};

return {
Expand All @@ -17,7 +17,7 @@ export default async ({ database }) => {
async write(name, callback) {
db.collections[name] = await callback(this.read(name));
// write to file
await path.write(stringify(db.collections));
await dbfile.write(stringify(db.collections));
},
};
};
2 changes: 1 addition & 1 deletion packages/surrealdb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"directory": "packages/surrealdb"
},
"scripts": {
"db:surreal": "surreal start --user primate --pass primate"
"db:start": "surreal start --user primate --pass primate"
},
"dependencies": {
"@primate/core": "workspace:^",
Expand Down

0 comments on commit f9d83e3

Please sign in to comment.