index.js 330 B

12345678910111213141516171819
  1. 'use strict';
  2. module.exports = function (pth, cb) {
  3. if (String(pth).indexOf('\u0000') !== -1) {
  4. var err = new Error('Path must be a string without null bytes.');
  5. err.code = 'ENOENT';
  6. if (typeof cb !== 'function') {
  7. throw err;
  8. }
  9. process.nextTick(function () {
  10. cb(err);
  11. });
  12. return false;
  13. }
  14. return true;
  15. }