Lines Matching refs:pattern
51 function filter (pattern, options) { argument
54 return minimatch(p, pattern, options)
76 var m = function minimatch (p, pattern, options) { argument
77 return orig.minimatch(p, pattern, ext(def, options))
80 m.Minimatch = function Minimatch (pattern, options) { argument
81 return new orig.Minimatch(pattern, ext(def, options))
92 function minimatch (p, pattern, options) { argument
93 if (typeof pattern !== 'string') {
100 if (!options.nocomment && pattern.charAt(0) === '#') {
105 if (pattern.trim() === '') return p === ''
107 return new Minimatch(pattern, options).match(p)
110 function Minimatch (pattern, options) {
112 return new Minimatch(pattern, options)
115 if (typeof pattern !== 'string') {
120 pattern = pattern.trim()
124 pattern = pattern.split(path.sep).join('/')
129 this.pattern = pattern
146 var pattern = this.pattern
150 if (!options.nocomment && pattern.charAt(0) === '#') {
154 if (!pattern) {
167 this.debug(this.pattern, set)
178 this.debug(this.pattern, set)
185 this.debug(this.pattern, set)
192 this.debug(this.pattern, set)
199 var pattern = this.pattern
206 for (var i = 0, l = pattern.length
207 ; i < l && pattern.charAt(i) === '!'
213 if (negateOffset) this.pattern = pattern.substr(negateOffset)
227 minimatch.braceExpand = function (pattern, options) { argument
228 return braceExpand(pattern, options)
233 function braceExpand (pattern, options) { argument
242 pattern = typeof pattern === 'undefined'
243 ? this.pattern : pattern
245 if (typeof pattern === 'undefined') {
250 !pattern.match(/\{.*\}/)) {
252 return [pattern]
255 return expand(pattern)
271 function parse (pattern, isSub) { argument
272 if (pattern.length > 1024 * 64) {
279 if (!options.noglobstar && pattern === '**') return GLOBSTAR
280 if (pattern === '') return ''
294 var patternStart = pattern.charAt(0) === '.' ? '' // anything
322 for (var i = 0, len = pattern.length, c
323 ; (i < len) && (c = pattern.charAt(i))
325 this.debug('%s\t%s %s %j', pattern, i, re, c)
352 this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
465 var cs = pattern.substring(classStart + 1, i)
508 cs = pattern.substr(classStart + 1)
617 return globUnescape(pattern)
631 regExp._glob = pattern
637 minimatch.makeRe = function (pattern, options) { argument
638 return new Minimatch(pattern, options || {}).makeRe()
664 var re = set.map(function (pattern) { argument
665 return pattern.map(function (p) {
687 minimatch.match = function (list, pattern, options) { argument
689 var mm = new Minimatch(pattern, options)
694 list.push(pattern)
701 this.debug('match', f, this.pattern)
718 this.debug(this.pattern, 'split', f)
726 this.debug(this.pattern, 'set', set)
737 var pattern = set[i]
739 if (options.matchBase && pattern.length === 1) {
742 var hit = this.matchOne(file, pattern, partial)
760 Minimatch.prototype.matchOne = function (file, pattern, partial) { argument
764 { 'this': this, file: file, pattern: pattern }) property
766 this.debug('matchOne', file.length, pattern.length)
771 pl = pattern.length
775 var p = pattern[pi]
778 this.debug(pattern, p, f)
785 this.debug('GLOBSTAR', [pattern, p, f])
830 this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)
833 if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
842 this.debug('dot detected!', file, fr, pattern, pr)
857 this.debug('\n>>> no match, partial?', file, fr, pattern, pr)