UNPKG

@effect-ts/system

Version:

Effect-TS is a zero dependency set of libraries to write highly productive, purely functional TypeScript at scale.

15 lines (11 loc) 254 B
// ets_tracing: off export interface IntBrand { readonly IntBrand: unique symbol } export type Int = number & IntBrand export function Int(n: number): Int { if (!Number.isInteger(n)) { throw new Error("not an integer") } return n as Int }