Skip to content

Commit 0564065

Browse files
committed
refactor(client): minor style changes
1 parent d363dde commit 0564065

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

apps/nest-server/src/app/app.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class AppService {
5151
return {
5252
columns: results.columns,
5353
rows: JSON.stringify(results.data, (key, value) => {
54-
if (typeof value !== 'bigint') return value
54+
if (typeof value != 'bigint') return value
5555

5656
return value.toString()
5757
}),

presto-client/src/utils.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@
1111
* @returns Parsed object with BigInts where required
1212
*/
1313
export function parseWithBigInts(_: string, value: unknown, context: { source: string }) {
14-
if (!context) return value // Context is not available, fallback to default parse
15-
const { source } = context
16-
if (!source) return value // Source is not available, fallback to default parse
14+
if (!context?.source) return value // Context source is not available, fallback to default parse
1715

1816
// Ignore non-numbers
19-
if (typeof value !== 'number') return value
17+
if (typeof value != 'number') return value
2018

2119
// If not an integer, use the value
2220
// TODO: Check if Presto can return floats that could also lose precision
@@ -25,5 +23,5 @@ export function parseWithBigInts(_: string, value: unknown, context: { source: s
2523
// If number is a safe integer, we can use it
2624
if (Number.isSafeInteger(value)) return value
2725

28-
return BigInt(source)
26+
return BigInt(context.source)
2927
}

0 commit comments

Comments
 (0)