File tree Expand file tree Collapse file tree 2 files changed +22
-11
lines changed
lib/node_modules/@stdlib/iter/any/docs/types Expand file tree Collapse file tree 2 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -39,9 +39,6 @@ interface IteratorResult {
3939 done : boolean ;
4040}
4141
42-
43- // MAIN //
44-
4542/**
4643* Tests whether at least one iterated value is truthy.
4744*
Original file line number Diff line number Diff line change 1818
1919import iterAny = require( './index' ) ;
2020
21-
22- // FUNCTIONS //
23-
2421/**
2522* Returns an iterator protocol-compliant object.
2623*
@@ -47,8 +44,25 @@ function iterator() {
4744
4845// TESTS //
4946
50- iterAny ( iterator ( ) ) ; // $ExpectType boolean
51- iterAny ( null ) ; // $ExpectError
52- iterAny ( [ ] ) ; // $ExpectError
53- iterAny ( { } ) ; // $ExpectError
54- iterAny ( ) ; // $ExpectError
47+ // The function returns a boolean...
48+ {
49+ iterAny ( iterator ( ) ) ; // $ExpectType boolean
50+ }
51+
52+ // The function does not compile if provided a value other than an iterator protocol-compliant object...
53+ {
54+ iterAny ( '5' ) ; // $ExpectError
55+ iterAny ( 5 ) ; // $ExpectError
56+ iterAny ( true ) ; // $ExpectError
57+ iterAny ( false ) ; // $ExpectError
58+ iterAny ( null ) ; // $ExpectError
59+ iterAny ( undefined ) ; // $ExpectError
60+ iterAny ( [ ] ) ; // $ExpectError
61+ iterAny ( { } ) ; // $ExpectError
62+ iterAny ( ( x ) => x ) ; // $ExpectError
63+ }
64+
65+ // The function does not compile if provided insufficient arguments...
66+ {
67+ iterAny ( ) ; // $ExpectError
68+ }
You can’t perform that action at this time.
0 commit comments