index.js 330 Bytes
Newer Older
jatuporn Tonggasem's avatar
jatuporn Tonggasem committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
'use strict';
module.exports = function (pth, cb) {
	if (String(pth).indexOf('\u0000') !== -1) {
		var err = new Error('Path must be a string without null bytes.');
		err.code = 'ENOENT';

		if (typeof cb !== 'function') {
			throw err;
		}

		process.nextTick(function () {
			cb(err);
		});

		return false;
	}

	return true;
}