mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
20 lines
318 B
TypeScript
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;
|
|
}
|