Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions test/tsc-build/mysql/constants/Types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ import { mysql } from '../../index.test.js';
const BLOB: number = mysql.Types.BLOB;
const DECIMAL: string = mysql.Types[0x00];
const DOUBLE: string = mysql.Types[5];

const typeName = (field: mysql.FieldPacket): string | undefined =>
field.type === undefined ? undefined : mysql.Types[field.type];

// @ts-expect-error: A type code maps to its name, a string
const BLOB_CODE: number = mysql.Types[BLOB];
6 changes: 6 additions & 0 deletions test/tsc-build/promise/constants/Types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ import { mysqlp as mysql } from '../../index.test.js';
const BLOB: number = mysql.Types.BLOB;
const DECIMAL: string = mysql.Types[0x00];
const DOUBLE: string = mysql.Types[5];

const typeName = (field: mysql.FieldPacket): string | undefined =>
field.type === undefined ? undefined : mysql.Types[field.type];

// @ts-expect-error: A type code maps to its name, a string
const BLOB_CODE: number = mysql.Types[BLOB];
1 change: 1 addition & 0 deletions typings/mysql/lib/constants/Types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ interface Types {
0xfd: string;
0xfe: string;
0xff: string;
[key: number]: string;

DECIMAL: number;
TINY: number;
Expand Down
Loading