23 lines
904 B
Plaintext
23 lines
904 B
Plaintext
=== tests/cases/compiler/arrayEvery.ts ===
|
|
const foo: (number | string)[] = ['aaa'];
|
|
>foo : Symbol(foo, Decl(arrayEvery.ts, 0, 5))
|
|
|
|
const isString = (x: unknown): x is string => typeof x === 'string';
|
|
>isString : Symbol(isString, Decl(arrayEvery.ts, 2, 5))
|
|
>x : Symbol(x, Decl(arrayEvery.ts, 2, 18))
|
|
>x : Symbol(x, Decl(arrayEvery.ts, 2, 18))
|
|
>x : Symbol(x, Decl(arrayEvery.ts, 2, 18))
|
|
|
|
if (foo.every(isString)) {
|
|
>foo.every : Symbol(Array.every, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
|
>foo : Symbol(foo, Decl(arrayEvery.ts, 0, 5))
|
|
>every : Symbol(Array.every, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
|
|
>isString : Symbol(isString, Decl(arrayEvery.ts, 2, 5))
|
|
|
|
foo[0].slice(0);
|
|
>foo[0].slice : Symbol(String.slice, Decl(lib.es5.d.ts, --, --))
|
|
>foo : Symbol(foo, Decl(arrayEvery.ts, 0, 5))
|
|
>slice : Symbol(String.slice, Decl(lib.es5.d.ts, --, --))
|
|
}
|
|
|