Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import {expectAssignable, expectType} from 'tsd';
import {PackageJson} from 'type-fest';
import meow = require('.');
import {Result} from '.';
expectType>(meow('Help text'));
expectType>(meow('Help text', {hardRejection: false}));
expectAssignable<{flags: {foo: number}}>(
meow({flags: {foo: {type: 'number'}}})
);
expectAssignable<{flags: {foo: string}}>(
meow({flags: {foo: {type: 'string'}}})
);
expectAssignable<{flags: {foo: boolean}}>(
meow({flags: {foo: {type: 'boolean'}}})
);
expectType>(meow({description: 'foo'}));
expectType>(meow({description: false}));
expectType>(meow({help: 'foo'}));
expectType>(meow({help: false}));
expectType>(meow({version: 'foo'}));
expectType>(meow({version: false}));
expectType>(meow({autoHelp: false}));
expectType>(meow({autoVersion: false}));
expectType>(meow({pkg: {foo: 'bar'}}));
expectType>(meow({argv: ['foo', 'bar']}));
expectType>(meow({inferType: true}));
import {expectType, expectNotAssignable, expectAssignable} from 'tsd';
import cache from '.';
type Primitive = boolean | number | string;
type Value = Primitive | Primitive[] | Record;
expectType>(cache.has('key'));
expectType>(cache.delete('key'));
expectType>(cache.get('key'));
expectType>(cache.get('key'));
expectNotAssignable>(cache.get('key'));
expectAssignable>(cache.set('key', 1));
expectAssignable>(cache.set('key', true));
expectAssignable>(cache.set('key', [true, 'string']));
expectAssignable>>(cache.set('key', {wow: [true, 'string']}));
expectAssignable>(cache.set('key', 1, 1));