0bc29acc08
Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
7 lines
168 B
TypeScript
7 lines
168 B
TypeScript
const foo: (number | string)[] = ['aaa'];
|
|
|
|
const isString = (x: unknown): x is string => typeof x === 'string';
|
|
|
|
if (foo.every(isString)) {
|
|
foo[0].slice(0);
|
|
}
|