Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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));