Skip to main content

latest

Collection of type utils

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 months ago (1.0.6)

Type guard functions

Examples

Example 1

import { number, object, string } from '@clapp/types';

const MyType = object({
    name: string,
    age: number,
});

type MyType = ReturnType<typeof MyType>;

const myType = MyType({
    name: 'Foo',
    age: 100,
});

Add Package

deno add jsr:@clapp/types

Import symbol

import * as mod from "@clapp/types";

---- OR ----

Import directly with a jsr specifier

import * as mod from "jsr:@clapp/types";

Add Package

npx jsr add @clapp/types

Import symbol

import * as mod from "@clapp/types";

Add Package

yarn dlx jsr add @clapp/types

Import symbol

import * as mod from "@clapp/types";

Add Package

pnpm dlx jsr add @clapp/types

Import symbol

import * as mod from "@clapp/types";

Add Package

bunx jsr add @clapp/types

Import symbol

import * as mod from "@clapp/types";