UNPKG

@tak-ps/node-cot

Version:

Lightweight JavaScript library for parsing and manipulating TAK messages

15 lines (14 loc) 505 B
import type { Static, TSchema, TUnknown } from '@sinclair/typebox'; export type TypeOpts = { verbose?: boolean; default?: boolean; convert?: boolean; clean?: boolean; }; export default class TypeValidator { /** * Arbitrary JSON objects occasionally need to get typed as part of an ETL * This function provides the ability to strictly type unknown objects at runtime */ static type<T extends TSchema = TUnknown>(type: T, body: unknown, opts?: TypeOpts): Static<T>; }