From 0c2ad267e49847029c4fd0cf4369fcd0ac36d621 Mon Sep 17 00:00:00 2001 From: bombillazo Date: Sun, 11 Feb 2024 18:23:14 -0400 Subject: [PATCH] chore: fix variable anem to make camelcase --- connection/connection_params.ts | 2 +- query/decode.ts | 2 +- tests/decode_test.ts | 6 +++--- tests/query_client_test.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/connection/connection_params.ts b/connection/connection_params.ts index deb4dd0..bf006a2 100644 --- a/connection/connection_params.ts +++ b/connection/connection_params.ts @@ -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 */ diff --git a/query/decode.ts b/query/decode.ts index dc6e517..1afe82a 100644 --- a/query/decode.ts +++ b/query/decode.ts @@ -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 diff --git a/tests/decode_test.ts b/tests/decode_test.ts index 438e5d8..0651291 100644 --- a/tests/decode_test.ts +++ b/tests/decode_test.ts @@ -251,7 +251,7 @@ Deno.test("decodeTid", function () { ]); }); -Deno.test("decode_strategy", function () { +Deno.test("decode strategy", function () { const testValues = [ { value: "40", @@ -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, ); } diff --git a/tests/query_client_test.ts b/tests/query_client_test.ts index 65a8121..4c4217b 100644 --- a/tests/query_client_test.ts +++ b/tests/query_client_test.ts @@ -132,7 +132,7 @@ Deno.test( }, ]); }, - { controls: { decode_strategy: "auto" } }, + { controls: { decodeStrategy: "auto" } }, ), ); @@ -154,7 +154,7 @@ Deno.test( }, ]); }, - { controls: { decode_strategy: "string" } }, + { controls: { decodeStrategy: "string" } }, ), );