code
stringlengths 24
2.07M
| docstring
stringlengths 25
85.3k
| func_name
stringlengths 1
92
| language
stringclasses 1
value | repo
stringlengths 5
64
| path
stringlengths 4
172
| url
stringlengths 44
218
| license
stringclasses 7
values |
---|---|---|---|---|---|---|---|
function naiveLength() {
return 1;
} // lruList is a yallist where the head is the youngest
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
naiveLength
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function LRUCache(options) {
if (!(this instanceof LRUCache)) {
return new LRUCache(options);
}
if (typeof options === 'number') {
options = {
max: options
};
}
if (!options) {
options = {};
}
var max = this[MAX] = options.max; // Kind of weird to have a default max of Infinity, but oh well.
if (!max || !(typeof max === 'number') || max <= 0) {
this[MAX] = Infinity;
}
var lc = options.length || naiveLength;
if (typeof lc !== 'function') {
lc = naiveLength;
}
this[LENGTH_CALCULATOR] = lc;
this[ALLOW_STALE] = options.stale || false;
this[MAX_AGE] = options.maxAge || 0;
this[DISPOSE] = options.dispose;
this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
this.reset();
} // resize the cache when the max changes.
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
LRUCache
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function forEachStep(self, fn, node, thisp) {
var hit = node.value;
if (isStale(self, hit)) {
del(self, node);
if (!self[ALLOW_STALE]) {
hit = undefined;
}
}
if (hit) {
fn.call(thisp, hit.value, hit.key, self);
}
}
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
forEachStep
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function get(self, key, doUse) {
var node = self[CACHE].get(key);
if (node) {
var hit = node.value;
if (isStale(self, hit)) {
del(self, node);
if (!self[ALLOW_STALE]) hit = undefined;
} else {
if (doUse) {
self[LRU_LIST].unshiftNode(node);
}
}
if (hit) hit = hit.value;
}
return hit;
}
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
get
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function isStale(self, hit) {
if (!hit || !hit.maxAge && !self[MAX_AGE]) {
return false;
}
var stale = false;
var diff = Date.now() - hit.now;
if (hit.maxAge) {
stale = diff > hit.maxAge;
} else {
stale = self[MAX_AGE] && diff > self[MAX_AGE];
}
return stale;
}
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
isStale
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function trim$2(self) {
if (self[LENGTH] > self[MAX]) {
for (var walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null;) {
// We know that we're about to delete this one, and also
// what the next least recently used key will be, so just
// go ahead and set it now.
var prev = walker.prev;
del(self, walker);
walker = prev;
}
}
}
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
trim$2
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function del(self, node) {
if (node) {
var hit = node.value;
if (self[DISPOSE]) {
self[DISPOSE](hit.key, hit.value);
}
self[LENGTH] -= hit.length;
self[CACHE].delete(hit.key);
self[LRU_LIST].removeNode(node);
}
} // classy, since V8 prefers predictable objects.
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
del
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function Entry$1(key, value, length, now, maxAge) {
this.key = key;
this.value = value;
this.length = length;
this.now = now;
this.maxAge = maxAge || 0;
}
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
Entry$1
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function sigmund(subject, maxSessions) {
maxSessions = maxSessions || 10;
var notes = [];
var analysis = '';
var RE = RegExp;
function psychoAnalyze(subject, session) {
if (session > maxSessions) return;
if (typeof subject === 'function' || typeof subject === 'undefined') {
return;
}
if (typeof subject !== 'object' || !subject || subject instanceof RE) {
analysis += subject;
return;
}
if (notes.indexOf(subject) !== -1 || session === maxSessions) return;
notes.push(subject);
analysis += '{';
Object.keys(subject).forEach(function (issue, _, __) {
// pseudo-private values. skip those.
if (issue.charAt(0) === '_') return;
var to = typeof subject[issue];
if (to === 'function' || to === 'undefined') return;
analysis += issue;
psychoAnalyze(subject[issue], session + 1);
});
}
psychoAnalyze(subject, 0);
return analysis;
} // vim: set softtabstop=4 shiftwidth=4:
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
sigmund
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function psychoAnalyze(subject, session) {
if (session > maxSessions) return;
if (typeof subject === 'function' || typeof subject === 'undefined') {
return;
}
if (typeof subject !== 'object' || !subject || subject instanceof RE) {
analysis += subject;
return;
}
if (notes.indexOf(subject) !== -1 || session === maxSessions) return;
notes.push(subject);
analysis += '{';
Object.keys(subject).forEach(function (issue, _, __) {
// pseudo-private values. skip those.
if (issue.charAt(0) === '_') return;
var to = typeof subject[issue];
if (to === 'function' || to === 'undefined') return;
analysis += issue;
psychoAnalyze(subject[issue], session + 1);
});
}
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
psychoAnalyze
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function charSet(s) {
return s.split("").reduce(function (set, c) {
set[c] = true;
return set;
}, {});
} // normalizes slashes.
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
charSet
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function monkeyPatch() {
var desc = Object.getOwnPropertyDescriptor(String.prototype, "match");
var orig = desc.value;
desc.value = function (p) {
if (p instanceof Minimatch) return p.match(this);
return orig.call(this, p);
};
Object.defineProperty(String.prototype, desc);
}
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
monkeyPatch
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function filter(pattern, options) {
options = options || {};
return function (p, i, list) {
return minimatch(p, pattern, options);
};
}
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
filter
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function ext(a, b) {
a = a || {};
b = b || {};
var t = {};
Object.keys(b).forEach(function (k) {
t[k] = b[k];
});
Object.keys(a).forEach(function (k) {
t[k] = a[k];
});
return t;
}
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
ext
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
m = function minimatch(p, pattern, options) {
return orig.minimatch(p, pattern, ext(def, options));
}
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
m
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function minimatch(p, pattern, options) {
if (typeof pattern !== "string") {
throw new TypeError("glob pattern string required");
}
if (!options) options = {}; // shortcut: comments match nothing.
if (!options.nocomment && pattern.charAt(0) === "#") {
return false;
} // "" only matches ""
if (pattern.trim() === "") return p === "";
return new Minimatch(pattern, options).match(p);
}
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
minimatch
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function Minimatch(pattern, options) {
if (!(this instanceof Minimatch)) {
return new Minimatch(pattern, options, cache);
}
if (typeof pattern !== "string") {
throw new TypeError("glob pattern string required");
}
if (!options) options = {}; // windows: need to use /, not \
// On other platforms, \ is a valid (albeit bad) filename char.
if (platform === "win32") {
pattern = pattern.split("\\").join("/");
} // lru storage.
// these things aren't particularly big, but walking down the string
// and turning it into a regexp can get pretty costly.
var cacheKey = pattern + "\n" + sigmund_1(options);
var cached = minimatch.cache.get(cacheKey);
if (cached) return cached;
minimatch.cache.set(cacheKey, this);
this.options = options;
this.set = [];
this.pattern = pattern;
this.regexp = null;
this.negate = false;
this.comment = false;
this.empty = false; // make the set of regexps etc.
this.make();
}
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
Minimatch
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function make() {
// don't do it more than once.
if (this._made) return;
var pattern = this.pattern;
var options = this.options; // empty patterns and comments match nothing.
if (!options.nocomment && pattern.charAt(0) === "#") {
this.comment = true;
return;
}
if (!pattern) {
this.empty = true;
return;
} // step 1: figure out negation, etc.
this.parseNegate(); // step 2: expand braces
var set = this.globSet = this.braceExpand();
if (options.debug) console.error(this.pattern, set); // step 3: now we have a set, so turn each one into a series of path-portion
// matching patterns.
// These will be regexps, except in the case of "**", which is
// set to the GLOBSTAR object for globstar behavior,
// and will not contain any / characters
set = this.globParts = set.map(function (s) {
return s.split(slashSplit);
});
if (options.debug) console.error(this.pattern, set); // glob --> regexps
set = set.map(function (s, si, set) {
return s.map(this.parse, this);
}, this);
if (options.debug) console.error(this.pattern, set); // filter out everything that didn't compile properly.
set = set.filter(function (s) {
return -1 === s.indexOf(false);
});
if (options.debug) console.error(this.pattern, set);
this.set = set;
}
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
make
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function parseNegate() {
var pattern = this.pattern,
negate = false,
options = this.options,
negateOffset = 0;
if (options.nonegate) return;
for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
negate = !negate;
negateOffset++;
}
if (negateOffset) this.pattern = pattern.substr(negateOffset);
this.negate = negate;
} // Brace expansion:
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
parseNegate
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function braceExpand(pattern, options) {
options = options || this.options;
pattern = typeof pattern === "undefined" ? this.pattern : pattern;
if (typeof pattern === "undefined") {
throw new Error("undefined pattern");
}
if (options.nobrace || !pattern.match(/\{.*\}/)) {
// shortcut. no need to expand.
return [pattern];
}
var escaping = false; // examples and comments refer to this crazy pattern:
// a{b,c{d,e},{f,g}h}x{y,z}
// expected:
// abxy
// abxz
// acdxy
// acdxz
// acexy
// acexz
// afhxy
// afhxz
// aghxy
// aghxz
// everything before the first \{ is just a prefix.
// So, we pluck that off, and work with the rest,
// and then prepend it to everything we find.
if (pattern.charAt(0) !== "{") {
// console.error(pattern)
var prefix = null;
for (var i = 0, l = pattern.length; i < l; i++) {
var c = pattern.charAt(i); // console.error(i, c)
if (c === "\\") {
escaping = !escaping;
} else if (c === "{" && !escaping) {
prefix = pattern.substr(0, i);
break;
}
} // actually no sets, all { were escaped.
if (prefix === null) {
// console.error("no sets")
return [pattern];
}
var tail = braceExpand(pattern.substr(i), options);
return tail.map(function (t) {
return prefix + t;
});
} // now we have something like:
// {b,c{d,e},{f,g}h}x{y,z}
// walk through the set, expanding each part, until
// the set ends. then, we'll expand the suffix.
// If the set only has a single member, then'll put the {} back
// first, handle numeric sets, since they're easier
var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);
if (numset) {
// console.error("numset", numset[1], numset[2])
var suf = braceExpand(pattern.substr(numset[0].length), options),
start = +numset[1],
end = +numset[2],
inc = start > end ? -1 : 1,
set = [];
for (var i = start; i != end + inc; i += inc) {
// append all the suffixes
for (var ii = 0, ll = suf.length; ii < ll; ii++) {
set.push(i + suf[ii]);
}
}
return set;
} // ok, walk through the set
// We hope, somewhat optimistically, that there
// will be a } at the end.
// If the closing brace isn't found, then the pattern is
// interpreted as braceExpand("\\" + pattern) so that
// the leading \{ will be interpreted literally.
var i = 1 // skip the \{
,
depth = 1,
set = [],
member = "",
escaping = false;
function addMember() {
set.push(member);
member = "";
} // console.error("Entering for")
FOR: for (i = 1, l = pattern.length; i < l; i++) {
var c = pattern.charAt(i); // console.error("", i, c)
if (escaping) {
escaping = false;
member += "\\" + c;
} else {
switch (c) {
case "\\":
escaping = true;
continue;
case "{":
depth++;
member += "{";
continue;
case "}":
depth--; // if this closes the actual set, then we're done
if (depth === 0) {
addMember(); // pluck off the close-brace
i++;
break FOR;
} else {
member += c;
continue;
}
case ",":
if (depth === 1) {
addMember();
} else {
member += c;
}
continue;
default:
member += c;
continue;
} // switch
} // else
} // for
// now we've either finished the set, and the suffix is
// pattern.substr(i), or we have *not* closed the set,
// and need to escape the leading brace
if (depth !== 0) {
// console.error("didn't close", pattern)
return braceExpand("\\" + pattern, options);
} // x{y,z} -> ["xy", "xz"]
// console.error("set", set)
// console.error("suffix", pattern.substr(i))
var suf = braceExpand(pattern.substr(i), options); // ["b", "c{d,e}","{f,g}h"] ->
// [["b"], ["cd", "ce"], ["fh", "gh"]]
var addBraces = set.length === 1; // console.error("set pre-expanded", set)
set = set.map(function (p) {
return braceExpand(p, options);
}); // console.error("set expanded", set)
// [["b"], ["cd", "ce"], ["fh", "gh"]] ->
// ["b", "cd", "ce", "fh", "gh"]
set = set.reduce(function (l, r) {
return l.concat(r);
});
if (addBraces) {
set = set.map(function (s) {
return "{" + s + "}";
});
} // now attach the suffixes.
var ret = [];
for (var i = 0, l = set.length; i < l; i++) {
for (var ii = 0, ll = suf.length; ii < ll; ii++) {
ret.push(set[i] + suf[ii]);
}
}
return ret;
} // parse a component of the expanded set.
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
braceExpand
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function addMember() {
set.push(member);
member = "";
} // console.error("Entering for")
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
addMember
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function parse(pattern, isSub) {
var options = this.options; // shortcuts
if (!options.noglobstar && pattern === "**") return GLOBSTAR;
if (pattern === "") return "";
var re = "",
hasMagic = !!options.nocase,
escaping = false // ? => one single character
,
patternListStack = [],
plType,
stateChar,
inClass = false,
reClassStart = -1,
classStart = -1 // . and .. never match anything that doesn't start with .,
// even when options.dot is set.
,
patternStart = pattern.charAt(0) === "." ? "" // anything
// not (start or / followed by . or .. followed by / or end)
: options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" : "(?!\\.)";
function clearStateChar() {
if (stateChar) {
// we had some state-tracking character
// that wasn't consumed by this pass.
switch (stateChar) {
case "*":
re += star;
hasMagic = true;
break;
case "?":
re += qmark;
hasMagic = true;
break;
default:
re += "\\" + stateChar;
break;
}
stateChar = false;
}
}
for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) {
if (options.debug) {
console.error("%s\t%s %s %j", pattern, i, re, c);
} // skip over any that are escaped.
if (escaping && reSpecials[c]) {
re += "\\" + c;
escaping = false;
continue;
}
switch (c) {
case "/":
// completely not allowed, even escaped.
// Should already be path-split by now.
return false;
case "\\":
clearStateChar();
escaping = true;
continue;
// the various stateChar values
// for the "extglob" stuff.
case "?":
case "*":
case "+":
case "@":
case "!":
if (options.debug) {
console.error("%s\t%s %s %j <-- stateChar", pattern, i, re, c);
} // all of those are literals inside a class, except that
// the glob [!a] means [^a] in regexp
if (inClass) {
if (c === "!" && i === classStart + 1) c = "^";
re += c;
continue;
} // if we already have a stateChar, then it means
// that there was something like ** or +? in there.
// Handle the stateChar, then proceed with this one.
clearStateChar();
stateChar = c; // if extglob is disabled, then +(asdf|foo) isn't a thing.
// just clear the statechar *now*, rather than even diving into
// the patternList stuff.
if (options.noext) clearStateChar();
continue;
case "(":
if (inClass) {
re += "(";
continue;
}
if (!stateChar) {
re += "\\(";
continue;
}
plType = stateChar;
patternListStack.push({
type: plType,
start: i - 1,
reStart: re.length
}); // negation is (?:(?!js)[^/]*)
re += stateChar === "!" ? "(?:(?!" : "(?:";
stateChar = false;
continue;
case ")":
if (inClass || !patternListStack.length) {
re += "\\)";
continue;
}
hasMagic = true;
re += ")";
plType = patternListStack.pop().type; // negation is (?:(?!js)[^/]*)
// The others are (?:<pattern>)<type>
switch (plType) {
case "!":
re += "[^/]*?)";
break;
case "?":
case "+":
case "*":
re += plType;
// the default anyway
}
continue;
case "|":
if (inClass || !patternListStack.length || escaping) {
re += "\\|";
escaping = false;
continue;
}
re += "|";
continue;
// these are mostly the same in regexp and glob
case "[":
// swallow any state-tracking char before the [
clearStateChar();
if (inClass) {
re += "\\" + c;
continue;
}
inClass = true;
classStart = i;
reClassStart = re.length;
re += c;
continue;
case "]":
// a right bracket shall lose its special
// meaning and represent itself in
// a bracket expression if it occurs
// first in the list. -- POSIX.2 2.8.3.2
if (i === classStart + 1 || !inClass) {
re += "\\" + c;
escaping = false;
continue;
} // finish up the class.
hasMagic = true;
inClass = false;
re += c;
continue;
default:
// swallow any state char that wasn't consumed
clearStateChar();
if (escaping) {
// no need
escaping = false;
} else if (reSpecials[c] && !(c === "^" && inClass)) {
re += "\\";
}
re += c;
} // switch
} // for
// handle the case where we left a class open.
// "[abc" is valid, equivalent to "\[abc"
if (inClass) {
// split where the last [ was, and escape it
// this is a huge pita. We now have to re-walk
// the contents of the would-be class to re-translate
// any characters that were passed through as-is
var cs = pattern.substr(classStart + 1),
sp = this.parse(cs, SUBPARSE);
re = re.substr(0, reClassStart) + "\\[" + sp[0];
hasMagic = hasMagic || sp[1];
} // handle the case where we had a +( thing at the *end*
// of the pattern.
// each pattern list stack adds 3 chars, and we need to go through
// and escape any | chars that were passed through as-is for the regexp.
// Go through and escape them, taking care not to double-escape any
// | chars that were already escaped.
var pl;
while (pl = patternListStack.pop()) {
var tail = re.slice(pl.reStart + 3); // maybe some even number of \, then maybe 1 \, followed by a |
tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) {
if (!$2) {
// the | isn't already escaped, so escape it.
$2 = "\\";
} // need to escape all those slashes *again*, without escaping the
// one that we need for escaping the | character. As it works out,
// escaping an even number of slashes can be done by simply repeating
// it exactly after itself. That's why this trick works.
//
// I am sorry that you have to see this.
return $1 + $1 + $2 + "|";
}); // console.error("tail=%j\n %s", tail, tail)
var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
hasMagic = true;
re = re.slice(0, pl.reStart) + t + "\\(" + tail;
} // handle trailing things that only matter at the very end.
clearStateChar();
if (escaping) {
// trailing \\
re += "\\\\";
} // only need to apply the nodot start if the re starts with
// something that could conceivably capture a dot
var addPatternStart = false;
switch (re.charAt(0)) {
case ".":
case "[":
case "(":
addPatternStart = true;
} // if the re is not "" at this point, then we need to make sure
// it doesn't match against an empty path part.
// Otherwise a/* will match a/, which it should not.
if (re !== "" && hasMagic) re = "(?=.)" + re;
if (addPatternStart) re = patternStart + re; // parsing just a piece of a larger pattern.
if (isSub === SUBPARSE) {
return [re, hasMagic];
} // skip the regexp for non-magical patterns
// unescape anything in it, though, so that it'll be
// an exact match against a file etc.
if (!hasMagic) {
return globUnescape(pattern);
}
var flags = options.nocase ? "i" : "",
regExp = new RegExp("^" + re + "$", flags);
regExp._glob = pattern;
regExp._src = re;
return regExp;
}
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
parse
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function clearStateChar() {
if (stateChar) {
// we had some state-tracking character
// that wasn't consumed by this pass.
switch (stateChar) {
case "*":
re += star;
hasMagic = true;
break;
case "?":
re += qmark;
hasMagic = true;
break;
default:
re += "\\" + stateChar;
break;
}
stateChar = false;
}
}
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
clearStateChar
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function makeRe() {
if (this.regexp || this.regexp === false) return this.regexp; // at this point, this.set is a 2d array of partial
// pattern strings, or "**".
//
// It's better to use .match(). This function shouldn't
// be used, really, but it's pretty convenient sometimes,
// when you just want to work with a regex.
var set = this.set;
if (!set.length) return this.regexp = false;
var options = this.options;
var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot,
flags = options.nocase ? "i" : "";
var re = set.map(function (pattern) {
return pattern.map(function (p) {
return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
}).join("\\\/");
}).join("|"); // must match entire pattern
// ending in a * or ** will make it less strict.
re = "^(?:" + re + ")$"; // can match anything, as long as it's not this.
if (this.negate) re = "^(?!" + re + ").*$";
try {
return this.regexp = new RegExp(re, flags);
} catch (ex) {
return this.regexp = false;
}
}
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
makeRe
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function match(f, partial) {
// console.error("match", f, this.pattern)
// short-circuit in the case of busted things.
// comments, etc.
if (this.comment) return false;
if (this.empty) return f === "";
if (f === "/" && partial) return true;
var options = this.options; // windows: need to use /, not \
// On other platforms, \ is a valid (albeit bad) filename char.
if (platform === "win32") {
f = f.split("\\").join("/");
} // treat the test path as a set of pathparts.
f = f.split(slashSplit);
if (options.debug) {
console.error(this.pattern, "split", f);
} // just ONE of the pattern sets in this.set needs to match
// in order for it to be valid. If negating, then just one
// match means that we have failed.
// Either way, return on the first hit.
var set = this.set; // console.error(this.pattern, "set", set)
for (var i = 0, l = set.length; i < l; i++) {
var pattern = set[i];
var hit = this.matchOne(f, pattern, partial);
if (hit) {
if (options.flipNegate) return true;
return !this.negate;
}
} // didn't get any hits. this is success if it's a negative
// pattern, failure otherwise.
if (options.flipNegate) return false;
return this.negate;
} // set partial to true to test if, for example,
|
/c)
// - b matches b
// - doublestar
// - matchOne(x/y/z/c, c) -> no
// - matchOne(y/z/c, c) -> no
// - matchOne(z/c, c) -> no
// - matchOne(c, c) yes, hit
var fr = fi;
var pr = pi + 1;
if (pr === pl) {
this.debug('** at the end'); // a ** at the end will just swallow the rest.
// We have found a match.
// however, it will not swallow /.x, unless
// options.dot is set.
// . and .. are *never* matched by **, for explosively
// exponential reasons.
for (; fi < fl; fi++) {
if (file[fi] === '.' || file[fi] === '..' || !options.dot && file[fi].charAt(0) === '.') return false;
}
return true;
} // ok, let's see if we can swallow whatever we can.
while (fr < fl) {
var swallowee = file[fr];
this.debug('\nglobstar while', file, fr, pattern, pr, swallowee); // XXX remove this slice. Just pass the start index.
if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
this.debug('globstar found match!', fr, fl, swallowee); // found a match.
return true;
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === '.' || swallowee === '..' || !options.dot && swallowee.charAt(0) === '.') {
this.debug('dot detected!', file, fr, pattern, pr);
break;
} // ** swallows a segment, and continue.
this.debug('globstar swallow a segment, and continue');
fr++;
}
} // no match was found.
// However, in partial mode, we can't say this is necessarily over.
// If there's more *pattern* left, then
if (partial) {
// ran out of file
this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
if (fr === fl) return true;
}
return false;
} // something other than **
// non-magic patterns just have to match exactly
// patterns with magic have been turned into regexps.
var hit;
if (typeof p === 'string') {
if (options.nocase) {
hit = f.toLowerCase() === p.toLowerCase();
} else {
hit = f === p;
}
this.debug('string match', p, f, hit);
} else {
hit = f.match(p);
this.debug('pattern match', p, f, hit);
}
if (!hit) return false;
} // Note: ending in / means that we'll get a final ""
// at the end of the pattern. This can only match a
// corresponding "" at the end of the file.
// If the file ends in /, then it can only match a
// a pattern that ends in /, unless the pattern just
// doesn't have any more for it. But, a/b/ should *not*
// match "a/b/*", even though "" matches against the
// [^/]*? pattern, except in partial mode, where it might
// simply not be reached yet.
// However, a/b/ should still satisfy a/*
// now either we fell off the end of the pattern, or we're done.
if (fi === fl && pi === pl) {
// ran out of pattern and filename at the same time.
// an exact hit!
return true;
} else if (fi === fl) {
// ran out of file, but still had pattern left.
// this is ok if we're doing the match as part of
// a glob fs traversal.
return partial;
} else if (pi === pl) {
// ran out of pattern, still have file left.
// this is only acceptable if we're on the very last
// empty segment of a file with a trailing slash.
// a/* should match a/b/
var emptyFileEnd = fi === fl - 1 && file[fi] === '';
return emptyFileEnd;
} // should be unreachable.
throw new Error('wtf?');
}; // replace stuff like \* with *
function globUnescape(s) {
return s.replace(/\\(.)/g, '$1');
}
function regExpEscape(s) {
return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
}
const copyProperty = (to, from, property, ignoreNonConfigurable) => {
// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.
// `Function#prototype` is non-writable and non-configurable so can never be modified.
if (property === 'length' || property === 'prototype') {
return;
}
const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {
return;
}
Object.defineProperty(to, property, fromDescriptor);
}; // `Object.defineProperty()` throws if the property exists, is not configurable and either:
// - one its descriptors is changed
// - it is non-writable and its value is changed
const canCopyProperty = function (toDescriptor, fromDescriptor) {
return toDescriptor === undefined || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
};
const changePrototype = (to, from) => {
const fromPrototype = Object.getPrototypeOf(from);
if (fromPrototype === Object.getPrototypeOf(to)) {
return;
}
Object.setPrototypeOf(to, fromPrototype);
};
const wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}
|
match
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function parse(file) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2
/*return*/
, new Promise(function (resolve, reject) {
fs.readFile(file, 'utf8', function (err, data) {
if (err) {
reject(err);
return;
}
resolve(parseString(data));
});
})];
});
});
}
|
Parses an .ini file
@param file The location of the .ini file
|
parse
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function parseSync(file) {
return parseString(fs.readFileSync(file, 'utf8'));
}
|
Parses an .ini file
@param file The location of the .ini file
|
parseSync
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function parseString(data) {
var sectionBody = {};
var sectionName = null;
var value = [[sectionName, sectionBody]];
var lines = data.split(/\r\n|\r|\n/);
lines.forEach(function (line) {
var match;
if (regex.comment.test(line)) {
return;
}
if (regex.param.test(line)) {
match = line.match(regex.param);
sectionBody[match[1]] = match[2];
} else if (regex.section.test(line)) {
match = line.match(regex.section);
sectionName = match[1];
sectionBody = {};
value.push([sectionName, sectionBody]);
}
});
return value;
}
|
Parses an .ini file
@param file The location of the .ini file
|
parseString
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function extendProps(props, options) {
if (props === void 0) {
props = {};
}
if (options === void 0) {
options = {};
}
for (var key in options) {
if (options.hasOwnProperty(key)) {
var value = options[key];
var key2 = key.toLowerCase();
var value2 = value;
if (knownProps[key2]) {
value2 = value.toLowerCase();
}
try {
value2 = JSON.parse(value);
} catch (e) {}
if (typeof value === 'undefined' || value === null) {
// null and undefined are values specific to JSON (no special meaning
// in editorconfig) & should just be returned as regular strings.
value2 = String(value);
}
props[key2] = value2;
}
}
return props;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
extendProps
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function parseFromConfigs(configs, filepath, options) {
return processMatches(configs.reverse().reduce(function (matches, file) {
var pathPrefix = path.dirname(file.name);
file.contents.forEach(function (section) {
var glob = section[0];
var options2 = section[1];
if (!glob) {
return;
}
var fullGlob = buildFullGlob(pathPrefix, glob);
if (!fnmatch$1(filepath, fullGlob)) {
return;
}
matches = extendProps(matches, options2);
});
return matches;
}, {}), options.version);
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
parseFromConfigs
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function getConfigsForFiles(files) {
var configs = [];
for (var i in files) {
if (files.hasOwnProperty(i)) {
var file = files[i];
var contents = ini.parseString(file.contents);
configs.push({
name: file.name,
contents: contents
});
if ((contents[0][1].root || '').toLowerCase() === 'true') {
break;
}
}
}
return configs;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
getConfigsForFiles
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function readConfigFiles(filepaths) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2
/*return*/
, Promise.all(filepaths.map(function (name) {
return new Promise(function (resolve) {
fs.readFile(name, 'utf8', function (err, data) {
resolve({
name: name,
contents: err ? '' : data
});
});
});
}))];
});
});
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
readConfigFiles
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function readConfigFilesSync(filepaths) {
var files = [];
var file;
filepaths.forEach(function (filepath) {
try {
file = fs.readFileSync(filepath, 'utf8');
} catch (e) {
file = '';
}
files.push({
name: filepath,
contents: file
});
});
return files;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
readConfigFilesSync
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function opts(filepath, options) {
if (options === void 0) {
options = {};
}
var resolvedFilePath = path.resolve(filepath);
return [resolvedFilePath, processOptions(options, resolvedFilePath)];
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
opts
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function parseFromFiles(filepath, files, options) {
if (options === void 0) {
options = {};
}
return __awaiter(this, void 0, void 0, function () {
var _a, resolvedFilePath, processedOptions;
return __generator(this, function (_b) {
_a = opts(filepath, options), resolvedFilePath = _a[0], processedOptions = _a[1];
return [2
/*return*/
, files.then(getConfigsForFiles).then(function (configs) {
return parseFromConfigs(configs, resolvedFilePath, processedOptions);
})];
});
});
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
parseFromFiles
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function parseFromFilesSync(filepath, files, options) {
if (options === void 0) {
options = {};
}
var _a = opts(filepath, options),
resolvedFilePath = _a[0],
processedOptions = _a[1];
return parseFromConfigs(getConfigsForFiles(files), resolvedFilePath, processedOptions);
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
parseFromFilesSync
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function parse(_filepath, _options) {
if (_options === void 0) {
_options = {};
}
return __awaiter(this, void 0, void 0, function () {
var _a, resolvedFilePath, processedOptions, filepaths;
return __generator(this, function (_b) {
_a = opts(_filepath, _options), resolvedFilePath = _a[0], processedOptions = _a[1];
filepaths = getConfigFileNames(resolvedFilePath, processedOptions);
return [2
/*return*/
, readConfigFiles(filepaths).then(getConfigsForFiles).then(function (configs) {
return parseFromConfigs(configs, resolvedFilePath, processedOptions);
})];
});
});
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
parse
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function parseSync(_filepath, _options) {
if (_options === void 0) {
_options = {};
}
var _a = opts(_filepath, _options),
resolvedFilePath = _a[0],
processedOptions = _a[1];
var filepaths = getConfigFileNames(resolvedFilePath, processedOptions);
var files = readConfigFilesSync(filepaths);
return parseFromConfigs(getConfigsForFiles(files), resolvedFilePath, processedOptions);
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
parseSync
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function removeUnset(editorConfig) {
const result = {};
const keys = Object.keys(editorConfig);
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
if (editorConfig[key] === "unset") {
continue;
}
result[key] = editorConfig[key];
}
return result;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
removeUnset
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function editorConfigToPrettier(editorConfig) {
if (!editorConfig) {
return null;
}
editorConfig = removeUnset(editorConfig);
if (Object.keys(editorConfig).length === 0) {
return null;
}
const result = {};
if (editorConfig.indent_style) {
result.useTabs = editorConfig.indent_style === "tab";
}
if (editorConfig.indent_size === "tab") {
result.useTabs = true;
}
if (result.useTabs && editorConfig.tab_width) {
result.tabWidth = editorConfig.tab_width;
} else if (editorConfig.indent_style === "space" && editorConfig.indent_size && editorConfig.indent_size !== "tab") {
result.tabWidth = editorConfig.indent_size;
} else if (editorConfig.tab_width !== undefined) {
result.tabWidth = editorConfig.tab_width;
}
if (editorConfig.max_line_length && editorConfig.max_line_length !== "off") {
result.printWidth = editorConfig.max_line_length;
}
if (editorConfig.quote_type === "single") {
result.singleQuote = true;
} else if (editorConfig.quote_type === "double") {
result.singleQuote = false;
}
if (["cr", "crlf", "lf"].indexOf(editorConfig.end_of_line) !== -1) {
result.endOfLine = editorConfig.end_of_line;
}
return result;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
editorConfigToPrettier
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function markerExists(files, markers) {
return markers.some(function (marker) {
return files.some(function (file) {
return file === marker;
});
});
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
markerExists
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function traverseFolder(directory, levels, markers) {
var files = fs$3.readdirSync(directory);
if (levels === 0) {
return null;
} else if (markerExists(files, markers)) {
return directory;
} else {
return traverseFolder(path$2.resolve(directory, '..'), levels - 1, markers);
}
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
traverseFolder
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
findProjectRoot = function findRoot(dir, opts) {
if (!dir) throw new Error("Directory not defined");
opts = opts || {};
var levels = opts.maxDepth || findRoot.MAX_DEPTH;
var markers = opts.markers || findRoot.MARKERS;
return traverseFolder(dir, levels, markers);
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
findProjectRoot
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
jsonStringifyMem = fn => mem_1(fn, {
cacheKey: JSON.stringify
})
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
jsonStringifyMem
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
jsonStringifyMem = fn => mem_1(fn, {
cacheKey: JSON.stringify
})
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
jsonStringifyMem
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
maybeParse = (filePath, parse) => {
// findProjectRoot will throw an error if we pass a nonexistent directory to
// it, which is possible, for example, when the path is given via
// --stdin-filepath. So, first, traverse up until we find an existing
// directory.
let dirPath = path$2.dirname(path$2.resolve(filePath));
const fsRoot = path$2.parse(dirPath).root;
while (dirPath !== fsRoot && !fs$3.existsSync(dirPath)) {
dirPath = path$2.dirname(dirPath);
}
const root = findProjectRoot(dirPath);
return filePath && parse(filePath, {
root
});
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
maybeParse
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
maybeParse = (filePath, parse) => {
// findProjectRoot will throw an error if we pass a nonexistent directory to
// it, which is possible, for example, when the path is given via
// --stdin-filepath. So, first, traverse up until we find an existing
// directory.
let dirPath = path$2.dirname(path$2.resolve(filePath));
const fsRoot = path$2.parse(dirPath).root;
while (dirPath !== fsRoot && !fs$3.existsSync(dirPath)) {
dirPath = path$2.dirname(dirPath);
}
const root = findProjectRoot(dirPath);
return filePath && parse(filePath, {
root
});
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
maybeParse
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
editorconfigAsyncNoCache = async filePath => {
const editorConfig = await maybeParse(filePath, src.parse);
return editorconfigToPrettier(editorConfig);
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
editorconfigAsyncNoCache
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
editorconfigAsyncNoCache = async filePath => {
const editorConfig = await maybeParse(filePath, src.parse);
return editorconfigToPrettier(editorConfig);
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
editorconfigAsyncNoCache
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
editorconfigSyncNoCache = filePath => {
return editorconfigToPrettier(maybeParse(filePath, src.parseSync));
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
editorconfigSyncNoCache
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
editorconfigSyncNoCache = filePath => {
return editorconfigToPrettier(maybeParse(filePath, src.parseSync));
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
editorconfigSyncNoCache
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function getLoadFunction(opts) {
if (!opts.editorconfig) {
return () => null;
}
if (opts.sync) {
return opts.cache ? editorconfigSyncWithCache : editorconfigSyncNoCache;
}
return opts.cache ? editorconfigAsyncWithCache : editorconfigAsyncNoCache;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
getLoadFunction
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function clearCache() {
mem_1.clear(editorconfigSyncWithCache);
mem_1.clear(editorconfigAsyncWithCache);
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
clearCache
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
constructor(msg, filename, linenumber) {
super('[ParserError] ' + msg, filename, linenumber);
this.name = 'ParserError';
this.code = 'ParserError';
if (Error.captureStackTrace) Error.captureStackTrace(this, ParserError);
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
constructor
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
constructor(parser) {
this.parser = parser;
this.buf = '';
this.returned = null;
this.result = null;
this.resultTable = null;
this.resultArr = null;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
constructor
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
constructor() {
this.pos = 0;
this.col = 0;
this.line = 0;
this.obj = {};
this.ctx = this.obj;
this.stack = [];
this._buf = '';
this.char = null;
this.ii = 0;
this.state = new State(this.parseStart);
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
constructor
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
parse(str) {
/* istanbul ignore next */
if (str.length === 0 || str.length == null) return;
this._buf = String(str);
this.ii = -1;
this.char = -1;
let getNext;
while (getNext === false || this.nextChar()) {
getNext = this.runOne();
}
this._buf = null;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
parse
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
nextChar() {
if (this.char === 0x0A) {
++this.line;
this.col = -1;
}
++this.ii;
this.char = this._buf.codePointAt(this.ii);
++this.pos;
++this.col;
return this.haveBuffer();
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
nextChar
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
haveBuffer() {
return this.ii < this._buf.length;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
haveBuffer
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
runOne() {
return this.state.parser.call(this, this.state.returned);
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
runOne
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
finish() {
this.char = ParserEND;
let last;
do {
last = this.state.parser;
this.runOne();
} while (this.state.parser !== last);
this.ctx = null;
this.state = null;
this._buf = null;
return this.obj;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
finish
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
next(fn) {
/* istanbul ignore next */
if (typeof fn !== 'function') throw new ParserError('Tried to set state to non-existent state: ' + JSON.stringify(fn));
this.state.parser = fn;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
next
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
goto(fn) {
this.next(fn);
return this.runOne();
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
goto
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
call(fn, returnWith) {
if (returnWith) this.next(returnWith);
this.stack.push(this.state);
this.state = new State(fn);
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
call
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
callNow(fn, returnWith) {
this.call(fn, returnWith);
return this.runOne();
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
callNow
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
return(value) {
/* istanbul ignore next */
if (this.stack.length === 0) throw this.error(new ParserError('Stack underflow'));
if (value === undefined) value = this.state.buf;
this.state = this.stack.pop();
this.state.returned = value;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
return
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
returnNow(value) {
this.return(value);
return this.runOne();
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
returnNow
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
consume() {
/* istanbul ignore next */
if (this.char === ParserEND) throw this.error(new ParserError('Unexpected end-of-buffer'));
this.state.buf += this._buf[this.ii];
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
consume
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
error(err) {
err.line = this.line;
err.col = this.col;
err.pos = this.pos;
return err;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
error
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
parseStart() {
throw new ParserError('Must declare a parseStart method');
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
parseStart
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
createDatetime = value => {
const date = new Date(value);
/* istanbul ignore if */
if (isNaN(date)) {
throw new TypeError('Invalid Datetime');
} else {
return date;
}
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
createDatetime
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
formatNum = (d, num) => {
num = String(num);
while (num.length < d) num = '0' + num;
return num;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
formatNum
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
constructor(value) {
super(value + 'Z');
this.isFloating = true;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
constructor
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
toISOString() {
const date = `${this.getUTCFullYear()}-${formatNum(2, this.getUTCMonth() + 1)}-${formatNum(2, this.getUTCDate())}`;
const time = `${formatNum(2, this.getUTCHours())}:${formatNum(2, this.getUTCMinutes())}:${formatNum(2, this.getUTCSeconds())}.${formatNum(3, this.getUTCMilliseconds())}`;
return `${date}T${time}`;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
toISOString
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
createDatetimeFloat = value => {
const date = new FloatingDateTime(value);
/* istanbul ignore if */
if (isNaN(date)) {
throw new TypeError('Invalid Datetime');
} else {
return date;
}
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
createDatetimeFloat
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
constructor(value) {
super(value);
this.isDate = true;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
constructor
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
toISOString() {
return `${this.getUTCFullYear()}-${formatNum(2, this.getUTCMonth() + 1)}-${formatNum(2, this.getUTCDate())}`;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
toISOString
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
createDate = value => {
const date = new Date$1(value);
/* istanbul ignore if */
if (isNaN(date)) {
throw new TypeError('Invalid Datetime');
} else {
return date;
}
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
createDate
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
constructor(value) {
super(`0000-01-01T${value}Z`);
this.isTime = true;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
constructor
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
toISOString() {
return `${formatNum(2, this.getUTCHours())}:${formatNum(2, this.getUTCMinutes())}:${formatNum(2, this.getUTCSeconds())}.${formatNum(3, this.getUTCMilliseconds())}`;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
toISOString
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
createTime = value => {
const date = new Time(value);
/* istanbul ignore if */
if (isNaN(date)) {
throw new TypeError('Invalid Datetime');
} else {
return date;
}
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
createTime
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
constructor(msg) {
super(msg);
this.name = 'TomlError';
/* istanbul ignore next */
if (Error.captureStackTrace) Error.captureStackTrace(this, TomlError);
this.fromTOML = true;
this.wrapped = null;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
constructor
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function isDigit(cp) {
return cp >= CHAR_0 && cp <= CHAR_9;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
isDigit
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function isHexit(cp) {
return cp >= CHAR_A && cp <= CHAR_F || cp >= CHAR_a && cp <= CHAR_f || cp >= CHAR_0 && cp <= CHAR_9;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
isHexit
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function isBit(cp) {
return cp === CHAR_1 || cp === CHAR_0;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
isBit
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function isOctit(cp) {
return cp >= CHAR_0 && cp <= CHAR_7;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
isOctit
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function isAlphaNumQuoteHyphen(cp) {
return cp >= CHAR_A && cp <= CHAR_Z || cp >= CHAR_a && cp <= CHAR_z || cp >= CHAR_0 && cp <= CHAR_9 || cp === CHAR_APOS || cp === CHAR_QUOT || cp === CHAR_LOWBAR || cp === CHAR_HYPHEN;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
isAlphaNumQuoteHyphen
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function isAlphaNumHyphen(cp) {
return cp >= CHAR_A && cp <= CHAR_Z || cp >= CHAR_a && cp <= CHAR_z || cp >= CHAR_0 && cp <= CHAR_9 || cp === CHAR_LOWBAR || cp === CHAR_HYPHEN;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
isAlphaNumHyphen
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function hasKey(obj, key) {
if (hasOwnProperty$1.call(obj, key)) return true;
if (key === '__proto__') defineProperty(obj, '__proto__', descriptor);
return false;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
hasKey
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function InlineTable() {
return Object.defineProperties({}, {
[_type]: {
value: INLINE_TABLE
}
});
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
InlineTable
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function isInlineTable(obj) {
if (obj === null || typeof obj !== 'object') return false;
return obj[_type] === INLINE_TABLE;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
isInlineTable
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function Table() {
return Object.defineProperties({}, {
[_type]: {
value: TABLE
},
[_declared]: {
value: false,
writable: true
}
});
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
Table
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function isTable(obj) {
if (obj === null || typeof obj !== 'object') return false;
return obj[_type] === TABLE;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
isTable
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function InlineList(type) {
return Object.defineProperties([], {
[_type]: {
value: INLINE_LIST
},
[_contentType]: {
value: type
}
});
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
InlineList
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function isInlineList(obj) {
if (obj === null || typeof obj !== 'object') return false;
return obj[_type] === INLINE_LIST;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
isInlineList
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function List() {
return Object.defineProperties([], {
[_type]: {
value: LIST
}
});
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
List
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
function isList(obj) {
if (obj === null || typeof obj !== 'object') return false;
return obj[_type] === LIST;
} // in an eval, to let bundlers not slurp in a util proxy
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
isList
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
constructor(value) {
try {
this.value = global.BigInt.asIntN(64, value);
} catch (_) {
/* istanbul ignore next */
this.value = null;
}
Object.defineProperty(this, _type, {
value: INTEGER
});
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
constructor
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
isNaN() {
return this.value === null;
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
isNaN
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
toString() {
return String(this.value);
}
|
/**}');
return fnmatch_1.default(filepath, glob, matchOptions);
}
function getConfigFileNames(filepath, options) {
var paths = [];
do {
filepath = path.dirname(filepath);
paths.push(path.join(filepath, options.config));
} while (filepath !== options.root);
return paths;
}
function processMatches(matches, version) {
// Set indent_size to 'tab' if indent_size is unspecified and
// indent_style is set to 'tab'.
if ('indent_style' in matches && matches.indent_style === 'tab' && !('indent_size' in matches) && semver.gte(version, '0.10.0')) {
matches.indent_size = 'tab';
} // Set tab_width to indent_size if indent_size is specified and
// tab_width is unspecified
if ('indent_size' in matches && !('tab_width' in matches) && matches.indent_size !== 'tab') {
matches.tab_width = matches.indent_size;
} // Set indent_size to tab_width if indent_size is 'tab'
if ('indent_size' in matches && 'tab_width' in matches && matches.indent_size === 'tab') {
matches.indent_size = matches.tab_width;
}
return matches;
}
function processOptions(options, filepath) {
if (options === void 0) {
options = {};
}
return {
config: options.config || '.editorconfig',
version: options.version || package_json_1.default.version,
root: path.resolve(options.root || path.parse(filepath).root)
};
}
function buildFullGlob(pathPrefix, glob) {
switch (glob.indexOf('/')) {
case -1:
glob = '*
|
toString
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/index.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/index.js
|
Apache-2.0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.