/usr/lib/nodejs/is-valid-glob/index.js is in node-is-valid-glob 0.3.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | 'use strict';
module.exports = function isValidGlob(glob) {
if (typeof glob === 'string' && glob.length > 0) {
return true;
}
if (Array.isArray(glob)) {
return glob.length !== 0 && every(glob);
}
return false;
};
function every(arr) {
var len = arr.length;
while (len--) {
if (typeof arr[len] !== 'string' || arr[len].length <= 0) {
return false;
}
}
return true;
}
|