DefinitelyTyped/types/is-typedarray/is-typedarray-tests.ts
2018-12-18 00:18:32 +01:00

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;
}