mirror of
https://github.com/JasonYANG170/IOTConnect-Web.git
synced 2024-11-23 12:16:29 +00:00
16 lines
359 B
JavaScript
16 lines
359 B
JavaScript
|
'use strict';
|
||
|
|
||
|
module.exports = function(pattern) {
|
||
|
if (typeof pattern !== 'string') {
|
||
|
throw new TypeError('expected a string');
|
||
|
}
|
||
|
|
||
|
var glob = { negated: false, pattern: pattern, original: pattern };
|
||
|
if (pattern.charAt(0) === '!' && pattern.charAt(1) !== '(') {
|
||
|
glob.negated = true;
|
||
|
glob.pattern = pattern.slice(1);
|
||
|
}
|
||
|
|
||
|
return glob;
|
||
|
};
|