File: index.test-d.ts

package info (click to toggle)
node-execa 8.0.1%2Bdfsg1%2B~cs12.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,588 kB
  • sloc: javascript: 2,940; makefile: 11; sh: 1
file content (13 lines) | stat: -rw-r--r-- 419 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
import {expectType} from 'tsd';
import onetime from './index.js';

const foo = onetime(() => 5);
expectType<number>(foo());

const foo2 = onetime(() => true, {throw: true});
expectType<boolean>(foo2());

expectType<number>(onetime((first: boolean) => 5)(true));
expectType<number>(onetime((first: boolean, second: string) => 5)(true, ''));

expectType<number>(onetime.callCount((first: boolean, second: string) => 5));