⚙️How to import
Recommended way to import tsafe
Node / Browser
import { assert, type Equals, typeGuard } from "tsafe";
// NOTE: You can also cherry pick imports, example:
// import { assert, is, type Equals } from "tsafe/assert";
// import { typeGuard } from "tsafe/typeGuard";
// But if you are in ESM environement it's unessesary.
// Even if you import from the index your bundler will three shake
// and include only the utility that you use.
Deno
/deps.ts
export { assert, type Equals } from "https://deno.land/x/[email protected]/mod.ts";
import { assert, type Equals } from "./deps.ts";
Last updated
Was this helpful?