mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
32 lines
613 B
TypeScript
32 lines
613 B
TypeScript
import emptyDir = require('empty-dir');
|
|
|
|
emptyDir('./', (err, isEmpty) => {
|
|
// $ExpectType ErrnoException
|
|
err;
|
|
// $ExpectType boolean
|
|
isEmpty;
|
|
});
|
|
|
|
// $ExpectType boolean
|
|
emptyDir.sync('./test/empty');
|
|
|
|
function filter(filepath: string) {
|
|
return !/(Thumbs\.db|\.DS_Store)$/i.test(filepath);
|
|
}
|
|
|
|
emptyDir('./', filter, (err, isEmpty) => {
|
|
// $ExpectType ErrnoException
|
|
err;
|
|
// $ExpectType boolean
|
|
isEmpty;
|
|
});
|
|
|
|
// $ExpectType boolean
|
|
emptyDir.sync('./test/empty', filter);
|
|
|
|
// $ExpectType Promise<boolean>
|
|
emptyDir('./');
|
|
|
|
// $ExpectType Promise<boolean>
|
|
emptyDir('./', filter);
|