How to use the typescript-is.is function in typescript-is

To help you get started, we’ve selected a few typescript-is examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github woutervh- / typescript-is / examples / src / index.ts View on Github external
item: V;
}

interface Baz {
    buz: W;
}

interface Foo extends Bar<u>, Baz {
    type: 'cool';
    secondItem: T;
    thirdItem: Bar&gt;;
}

console.log(is, string&gt;&gt;({}));
console.log(is, string&gt;&gt;({ item: 'string', buz: 1, type: 'cool', secondItem: { item: 2 }, thirdItem: { item: { item: true } } }));
console.log(is(true));
console.log(is(false));
</u>
github woutervh- / typescript-is / examples / src / index.ts View on Github external
}

interface Baz {
    buz: W;
}

interface Foo extends Bar<u>, Baz {
    type: 'cool';
    secondItem: T;
    thirdItem: Bar&gt;;
}

console.log(is, string&gt;&gt;({}));
console.log(is, string&gt;&gt;({ item: 'string', buz: 1, type: 'cool', secondItem: { item: 2 }, thirdItem: { item: { item: true } } }));
console.log(is(true));
console.log(is(false));
</u>
github woutervh- / typescript-is / examples / src / index.ts View on Github external
interface Bar /*extends Pick*/ {
    item: V;
}

interface Baz {
    buz: W;
}

interface Foo extends Bar<u>, Baz {
    type: 'cool';
    secondItem: T;
    thirdItem: Bar&gt;;
}

console.log(is, string&gt;&gt;({}));
console.log(is, string&gt;&gt;({ item: 'string', buz: 1, type: 'cool', secondItem: { item: 2 }, thirdItem: { item: { item: true } } }));
console.log(is(true));
console.log(is(false));
</u>

typescript-is

TypeScript transformer that generates run-time type-checks.

MIT
Latest version published 1 year ago

Package Health Score

54 / 100
Full package analysis

Popular typescript-is functions