add repo-wide typechecking
Some checks are pending
CI / Validate (push) Waiting to run

This commit is contained in:
dirtydishes 2026-05-29 02:19:30 -04:00
parent 85ad7f7387
commit e9e2723c28
30 changed files with 380 additions and 44 deletions

View file

@ -14,6 +14,8 @@ export type EquityPrintJoinRecord = {
join_quality_json: string;
};
type JsonPrimitiveRecord = Record<string, string | number | boolean>;
export const equityPrintJoinsTableDDL = (): string => {
return `
CREATE TABLE IF NOT EXISTS ${EQUITY_PRINT_JOINS_TABLE} (
@ -46,11 +48,11 @@ export const toEquityPrintJoinRecord = (join: EquityPrintJoin): EquityPrintJoinR
};
};
const safeJson = (value: string, fallback: Record<string, unknown>): Record<string, unknown> => {
const safeJson = (value: string, fallback: JsonPrimitiveRecord): JsonPrimitiveRecord => {
try {
const parsed = JSON.parse(value);
if (parsed && typeof parsed === "object") {
return parsed as Record<string, unknown>;
return parsed as JsonPrimitiveRecord;
}
} catch {
// ignore

View file

@ -13,6 +13,8 @@ export type FlowPacketRecord = {
join_quality_json: string;
};
type JsonPrimitiveRecord = Record<string, string | number | boolean>;
export const flowPacketsTableDDL = (): string => {
return `
CREATE TABLE IF NOT EXISTS ${FLOW_PACKETS_TABLE} (
@ -43,11 +45,11 @@ export const toFlowPacketRecord = (packet: FlowPacket): FlowPacketRecord => {
};
};
const safeJson = (value: string, fallback: Record<string, unknown>): Record<string, unknown> => {
const safeJson = (value: string, fallback: JsonPrimitiveRecord): JsonPrimitiveRecord => {
try {
const parsed = JSON.parse(value);
if (parsed && typeof parsed === "object") {
return parsed as Record<string, unknown>;
return parsed as JsonPrimitiveRecord;
}
} catch {
// ignore

View file

@ -1,7 +1,7 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"types": []
"types": ["bun"]
},
"include": ["src/**/*.ts", "tests/**/*.ts"]
}