Skip to content

Commit

Permalink
Codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
ayrton committed Apr 25, 2024
1 parent 3995d80 commit 2847932
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/cast.ts
Original file line number Diff line number Diff line change
@@ -47,16 +47,20 @@ export function cast(field: Field, value: any): any {
* https://github.com/planetscale/database-js/pull/90
*/

const BIG_INT_FIELD_TYPES = ['INT64', 'UINT64']

function isBigInt(field: Field) {
return field.type === 'INT64' || field.type === 'UINT64'
return BIG_INT_FIELD_TYPES.includes(field.type)
}

/**
* https://github.com/vitessio/vitess/blob/v19.0.3/go/sqltypes/type.go#L103-L106
*/

const DATE_OR_DATETIME_FIELD_TYPES = ['DATETIME', 'DATE', 'TIMESTAMP', 'TIME']

function isDateOrTime(field: Field) {
return field.type === 'DATETIME' || field.type === 'DATE' || field.type === 'TIMESTAMP' || field.type === 'TIME'
return DATE_OR_DATETIME_FIELD_TYPES.includes(field.type)
}

function isDecimal(field: Field) {

0 comments on commit 2847932

Please sign in to comment.