Files
DefinitelyTyped/types/is-typedarray/is-typedarray-tests.ts

20 lines
318 B
TypeScript

import isTypedArray = require('is-typedarray');
const buf: any = new Buffer(1);
// $ExpectType any
buf;
if (isTypedArray(buf)) {
// $ExpectType TypedArray
buf;
}
if (isTypedArray.strict(buf)) {
// $ExpectType TypedArray
buf;
}
if (isTypedArray.loose(buf)) {
// $ExpectType TypedArray
buf;
}