Skip to content

Commit

Permalink
chore: fix variable anem to make camelcase
Browse files Browse the repository at this point in the history
  • Loading branch information
bombillazo committed Feb 11, 2024
1 parent 3230a8e commit 0c2ad26
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion connection/connection_params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export type ClientControls = {
* - `strict` : deno-postgres parses the data into JS objects, and if a parser is not implemented, it throws an error
* - `raw` : the data is returned as Uint8Array
*/
decode_strategy?: "string" | "auto";
decodeStrategy?: "string" | "auto";
};

/** The Client database connection options */
Expand Down
2 changes: 1 addition & 1 deletion query/decode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export function decode(
return decodeBinary();
} else if (column.format === Format.TEXT) {
// If the user has specified a decode strategy, use that
if (controls?.decode_strategy === "string") {
if (controls?.decodeStrategy === "string") {
return decoder.decode(value);
}
// default to 'auto' mode, which uses the typeOid to determine the decoding strategy
Expand Down
6 changes: 3 additions & 3 deletions tests/decode_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ Deno.test("decodeTid", function () {
]);
});

Deno.test("decode_strategy", function () {
Deno.test("decode strategy", function () {
const testValues = [
{
value: "40",
Expand Down Expand Up @@ -315,12 +315,12 @@ Deno.test("decode_strategy", function () {
assertEquals(decode(encodedValue, testValue.column), testValue.parsed);
// check 'auto' behavior
assertEquals(
decode(encodedValue, testValue.column, { decode_strategy: "auto" }),
decode(encodedValue, testValue.column, { decodeStrategy: "auto" }),
testValue.parsed,
);
// check 'string' behavior
assertEquals(
decode(encodedValue, testValue.column, { decode_strategy: "string" }),
decode(encodedValue, testValue.column, { decodeStrategy: "string" }),
testValue.value,
);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/query_client_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ Deno.test(
},
]);
},
{ controls: { decode_strategy: "auto" } },
{ controls: { decodeStrategy: "auto" } },
),
);

Expand All @@ -154,7 +154,7 @@ Deno.test(
},
]);
},
{ controls: { decode_strategy: "string" } },
{ controls: { decodeStrategy: "string" } },
),
);

Expand Down

1 comment on commit 0c2ad26

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No typecheck tests failure

This error was most likely caused by incorrect type stripping from the SWC crate

Please report the following failure to https://github.com/denoland/deno with a reproduction of the current commit

Failure log

Please sign in to comment.