Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
Soremwar committed Apr 30, 2020
1 parent 4b19be6 commit 3ff575d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
20 changes: 11 additions & 9 deletions connection_params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ function getPgEnv(): IConnectionParams {
try {
const env = Deno.env;
return {
database: env.get('PGDATABASE'),
host: env.get('PGHOST'),
port: env.get('PGPORT'),
user: env.get('PGUSER'),
password: env.get('PGPASSWORD'),
application_name: env.get('PGAPPNAME'),
database: env.get("PGDATABASE"),
host: env.get("PGHOST"),
port: env.get("PGPORT"),
user: env.get("PGUSER"),
password: env.get("PGPASSWORD"),
application_name: env.get("PGAPPNAME"),
};
} catch (e) {
// PermissionDenied (--allow-env not passed)
Expand Down Expand Up @@ -110,9 +110,11 @@ export class ConnectionParams {

if (missingParams.length) {
throw new ConnectionParamsError(
`Missing connection parameters: ${missingParams.join(
", ",
)}. Connection parameters can be read
`Missing connection parameters: ${
missingParams.join(
", ",
)
}. Connection parameters can be read
from environment only if Deno is run with env permission (deno run --allow-env)`,
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/encode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test("encodeObject", function () {

test("encodeUint8Array", function () {
const buf_1 = new Uint8Array([1, 2, 3]);
const buf_2 = new Uint8Array([2,10,500]);
const buf_2 = new Uint8Array([2, 10, 500]);

assertEquals("\\x010203", encode(buf_1));
assertEquals("\\x02af4", encode(buf_2));
Expand Down
6 changes: 3 additions & 3 deletions utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export function readInt32BE(buffer: Uint8Array, offset: number): number {

return (
(buffer[offset] << 24) |
(buffer[offset + 1] << 16) |
(buffer[offset + 2] << 8) |
buffer[offset + 3]
(buffer[offset + 1] << 16) |
(buffer[offset + 2] << 8) |
buffer[offset + 3]
);
}

Expand Down

0 comments on commit 3ff575d

Please sign in to comment.