You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.d.ts 718B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. declare const junk: {
  2. /**
  3. Returns `true` if `filename` matches a junk file.
  4. */
  5. is(filename: string): boolean;
  6. /**
  7. Returns `true` if `filename` doesn't match a junk file.
  8. @example
  9. ```
  10. import {promisify} from 'util';
  11. import * as fs from 'fs';
  12. import junk = require('junk');
  13. const pReaddir = promisify(fs.readdir);
  14. (async () => {
  15. const files = await pReaddir('some/path');
  16. console.log(files);
  17. //=> ['.DS_Store', 'test.jpg']
  18. console.log(files.filter(junk.not));
  19. //=> ['test.jpg']
  20. })();
  21. ```
  22. */
  23. not(filename: string): boolean;
  24. /**
  25. Regex used for matching junk files.
  26. */
  27. readonly regex: RegExp;
  28. // TODO: Remove this for the next major release
  29. default: typeof junk;
  30. };
  31. export = junk;