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 |
---|---|---|---|---|---|---|---|
picomatch = (glob, options, returnState = false) => {
if (Array.isArray(glob)) {
const fns = glob.map(input => picomatch(input, options, returnState));
const arrayMatcher = str => {
for (const isMatch of fns) {
const state = isMatch(str);
if (state) return state;
}
return false;
};
return arrayMatcher;
}
const isState = isObject$2(glob) && glob.tokens && glob.input;
if (glob === '' || typeof glob !== 'string' && !isState) {
throw new TypeError('Expected pattern to be a non-empty string');
}
const opts = options || {};
const posix = utils$1.isWindows(options);
const regex = isState ? picomatch.compileRe(glob, options) : picomatch.makeRe(glob, options, false, true);
const state = regex.state;
delete regex.state;
let isIgnored = () => false;
if (opts.ignore) {
const ignoreOpts = Object.assign(Object.assign({}, options), {}, {
ignore: null,
onMatch: null,
onResult: null
});
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
}
const matcher = (input, returnObject = false) => {
const {
isMatch,
match,
output
} = picomatch.test(input, regex, options, {
glob,
posix
});
const result = {
glob,
state,
regex,
posix,
input,
output,
match,
isMatch
};
if (typeof opts.onResult === 'function') {
opts.onResult(result);
}
if (isMatch === false) {
result.isMatch = false;
return returnObject ? result : false;
}
if (isIgnored(input)) {
if (typeof opts.onIgnore === 'function') {
opts.onIgnore(result);
}
result.isMatch = false;
return returnObject ? result : false;
}
if (typeof opts.onMatch === 'function') {
opts.onMatch(result);
}
return returnObject ? result : true;
};
if (returnState) {
matcher.state = state;
}
return matcher;
}
|
Creates a matcher function from one or more glob patterns. The
returned function takes a string to match as its first argument,
and returns true if the string is a match. The returned matcher
function also takes a boolean as the second argument that, when true,
returns an object with additional information.
```js
const picomatch = require('picomatch');
// picomatch(glob[, options]);
const isMatch = picomatch('*.!(*a)');
console.log(isMatch('a.a')); //=> false
console.log(isMatch('a.b')); //=> true
```
@name picomatch
@param {String|Array} `globs` One or more glob patterns.
@param {Object=} `options`
@return {Function=} Returns a matcher function.
@api public
|
picomatch
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
arrayMatcher = str => {
for (const isMatch of fns) {
const state = isMatch(str);
if (state) return state;
}
return false;
}
|
Creates a matcher function from one or more glob patterns. The
returned function takes a string to match as its first argument,
and returns true if the string is a match. The returned matcher
function also takes a boolean as the second argument that, when true,
returns an object with additional information.
```js
const picomatch = require('picomatch');
// picomatch(glob[, options]);
const isMatch = picomatch('*.!(*a)');
console.log(isMatch('a.a')); //=> false
console.log(isMatch('a.b')); //=> true
```
@name picomatch
@param {String|Array} `globs` One or more glob patterns.
@param {Object=} `options`
@return {Function=} Returns a matcher function.
@api public
|
arrayMatcher
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
arrayMatcher = str => {
for (const isMatch of fns) {
const state = isMatch(str);
if (state) return state;
}
return false;
}
|
Creates a matcher function from one or more glob patterns. The
returned function takes a string to match as its first argument,
and returns true if the string is a match. The returned matcher
function also takes a boolean as the second argument that, when true,
returns an object with additional information.
```js
const picomatch = require('picomatch');
// picomatch(glob[, options]);
const isMatch = picomatch('*.!(*a)');
console.log(isMatch('a.a')); //=> false
console.log(isMatch('a.b')); //=> true
```
@name picomatch
@param {String|Array} `globs` One or more glob patterns.
@param {Object=} `options`
@return {Function=} Returns a matcher function.
@api public
|
arrayMatcher
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
matcher = (input, returnObject = false) => {
const {
isMatch,
match,
output
} = picomatch.test(input, regex, options, {
glob,
posix
});
const result = {
glob,
state,
regex,
posix,
input,
output,
match,
isMatch
};
if (typeof opts.onResult === 'function') {
opts.onResult(result);
}
if (isMatch === false) {
result.isMatch = false;
return returnObject ? result : false;
}
if (isIgnored(input)) {
if (typeof opts.onIgnore === 'function') {
opts.onIgnore(result);
}
result.isMatch = false;
return returnObject ? result : false;
}
if (typeof opts.onMatch === 'function') {
opts.onMatch(result);
}
return returnObject ? result : true;
}
|
Creates a matcher function from one or more glob patterns. The
returned function takes a string to match as its first argument,
and returns true if the string is a match. The returned matcher
function also takes a boolean as the second argument that, when true,
returns an object with additional information.
```js
const picomatch = require('picomatch');
// picomatch(glob[, options]);
const isMatch = picomatch('*.!(*a)');
console.log(isMatch('a.a')); //=> false
console.log(isMatch('a.b')); //=> true
```
@name picomatch
@param {String|Array} `globs` One or more glob patterns.
@param {Object=} `options`
@return {Function=} Returns a matcher function.
@api public
|
matcher
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
matcher = (input, returnObject = false) => {
const {
isMatch,
match,
output
} = picomatch.test(input, regex, options, {
glob,
posix
});
const result = {
glob,
state,
regex,
posix,
input,
output,
match,
isMatch
};
if (typeof opts.onResult === 'function') {
opts.onResult(result);
}
if (isMatch === false) {
result.isMatch = false;
return returnObject ? result : false;
}
if (isIgnored(input)) {
if (typeof opts.onIgnore === 'function') {
opts.onIgnore(result);
}
result.isMatch = false;
return returnObject ? result : false;
}
if (typeof opts.onMatch === 'function') {
opts.onMatch(result);
}
return returnObject ? result : true;
}
|
Creates a matcher function from one or more glob patterns. The
returned function takes a string to match as its first argument,
and returns true if the string is a match. The returned matcher
function also takes a boolean as the second argument that, when true,
returns an object with additional information.
```js
const picomatch = require('picomatch');
// picomatch(glob[, options]);
const isMatch = picomatch('*.!(*a)');
console.log(isMatch('a.a')); //=> false
console.log(isMatch('a.b')); //=> true
```
@name picomatch
@param {String|Array} `globs` One or more glob patterns.
@param {Object=} `options`
@return {Function=} Returns a matcher function.
@api public
|
matcher
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
micromatch = (list, patterns, options) => {
patterns = [].concat(patterns);
list = [].concat(list);
let omit = new Set();
let keep = new Set();
let items = new Set();
let negatives = 0;
let onResult = state => {
items.add(state.output);
if (options && options.onResult) {
options.onResult(state);
}
};
for (let i = 0; i < patterns.length; i++) {
let isMatch = picomatch$1(String(patterns[i]), Object.assign(Object.assign({}, options), {}, {
onResult
}), true);
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
if (negated) negatives++;
for (let item of list) {
let matched = isMatch(item, true);
let match = negated ? !matched.isMatch : matched.isMatch;
if (!match) continue;
if (negated) {
omit.add(matched.output);
} else {
omit.delete(matched.output);
keep.add(matched.output);
}
}
}
let result = negatives === patterns.length ? [...items] : [...keep];
let matches = result.filter(item => !omit.has(item));
if (options && matches.length === 0) {
if (options.failglob === true) {
throw new Error(`No matches found for "${patterns.join(', ')}"`);
}
if (options.nonull === true || options.nullglob === true) {
return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns;
}
}
return matches;
}
|
Returns an array of strings that match one or more glob patterns.
```js
const mm = require('micromatch');
// mm(list, patterns[, options]);
console.log(mm(['a.js', 'a.txt'], ['*.js']));
//=> [ 'a.js' ]
```
@param {String|Array<string>} list List of strings to match.
@param {String|Array<string>} patterns One or more glob patterns to use for matching.
@param {Object} options See available [options](#options)
@return {Array} Returns an array of matches
@summary false
@api public
|
micromatch
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
micromatch = (list, patterns, options) => {
patterns = [].concat(patterns);
list = [].concat(list);
let omit = new Set();
let keep = new Set();
let items = new Set();
let negatives = 0;
let onResult = state => {
items.add(state.output);
if (options && options.onResult) {
options.onResult(state);
}
};
for (let i = 0; i < patterns.length; i++) {
let isMatch = picomatch$1(String(patterns[i]), Object.assign(Object.assign({}, options), {}, {
onResult
}), true);
let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
if (negated) negatives++;
for (let item of list) {
let matched = isMatch(item, true);
let match = negated ? !matched.isMatch : matched.isMatch;
if (!match) continue;
if (negated) {
omit.add(matched.output);
} else {
omit.delete(matched.output);
keep.add(matched.output);
}
}
}
let result = negatives === patterns.length ? [...items] : [...keep];
let matches = result.filter(item => !omit.has(item));
if (options && matches.length === 0) {
if (options.failglob === true) {
throw new Error(`No matches found for "${patterns.join(', ')}"`);
}
if (options.nonull === true || options.nullglob === true) {
return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns;
}
}
return matches;
}
|
Returns an array of strings that match one or more glob patterns.
```js
const mm = require('micromatch');
// mm(list, patterns[, options]);
console.log(mm(['a.js', 'a.txt'], ['*.js']));
//=> [ 'a.js' ]
```
@param {String|Array<string>} list List of strings to match.
@param {String|Array<string>} patterns One or more glob patterns to use for matching.
@param {Object} options See available [options](#options)
@return {Array} Returns an array of matches
@summary false
@api public
|
micromatch
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
onResult = state => {
items.add(state.output);
if (options && options.onResult) {
options.onResult(state);
}
}
|
Returns an array of strings that match one or more glob patterns.
```js
const mm = require('micromatch');
// mm(list, patterns[, options]);
console.log(mm(['a.js', 'a.txt'], ['*.js']));
//=> [ 'a.js' ]
```
@param {String|Array<string>} list List of strings to match.
@param {String|Array<string>} patterns One or more glob patterns to use for matching.
@param {Object} options See available [options](#options)
@return {Array} Returns an array of matches
@summary false
@api public
|
onResult
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
onResult = state => {
items.add(state.output);
if (options && options.onResult) {
options.onResult(state);
}
}
|
Returns an array of strings that match one or more glob patterns.
```js
const mm = require('micromatch');
// mm(list, patterns[, options]);
console.log(mm(['a.js', 'a.txt'], ['*.js']));
//=> [ 'a.js' ]
```
@param {String|Array<string>} list List of strings to match.
@param {String|Array<string>} patterns One or more glob patterns to use for matching.
@param {Object} options See available [options](#options)
@return {Array} Returns an array of matches
@summary false
@api public
|
onResult
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
onResult = state => {
if (options.onResult) options.onResult(state);
items.push(state.output);
}
|
Returns a list of strings that _**do not match any**_ of the given `patterns`.
```js
const mm = require('micromatch');
// mm.not(list, patterns[, options]);
console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
//=> ['b.b', 'c.c']
```
@param {Array} `list` Array of strings to match.
@param {String|Array} `patterns` One or more glob pattern to use for matching.
@param {Object} `options` See available [options](#options) for changing how matches are performed
@return {Array} Returns an array of strings that **do not match** the given patterns.
@api public
|
onResult
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
onResult = state => {
if (options.onResult) options.onResult(state);
items.push(state.output);
}
|
Returns a list of strings that _**do not match any**_ of the given `patterns`.
```js
const mm = require('micromatch');
// mm.not(list, patterns[, options]);
console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
//=> ['b.b', 'c.c']
```
@param {Array} `list` Array of strings to match.
@param {String|Array} `patterns` One or more glob pattern to use for matching.
@param {Object} `options` See available [options](#options) for changing how matches are performed
@return {Array} Returns an array of strings that **do not match** the given patterns.
@api public
|
onResult
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function convertToPositivePattern(pattern) {
return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
convertToPositivePattern
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function convertToNegativePattern(pattern) {
return '!' + pattern;
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
convertToNegativePattern
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function isNegativePattern(pattern) {
return pattern.startsWith('!') && pattern[1] !== '(';
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
isNegativePattern
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function isPositivePattern(pattern) {
return !isNegativePattern(pattern);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
isPositivePattern
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function getNegativePatterns(patterns) {
return patterns.filter(isNegativePattern);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
getNegativePatterns
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function getPositivePatterns(patterns) {
return patterns.filter(isPositivePattern);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
getPositivePatterns
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function getBaseDirectory(pattern) {
return globParent(pattern, {
flipBackslashes: false
});
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
getBaseDirectory
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function hasGlobStar(pattern) {
return pattern.includes(GLOBSTAR);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
hasGlobStar
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function endsWithSlashGlobStar(pattern) {
return pattern.endsWith('/' + GLOBSTAR);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
endsWithSlashGlobStar
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function isAffectDepthOfReadingPattern(pattern) {
const basename = path.basename(pattern);
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
isAffectDepthOfReadingPattern
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function expandPatternsWithBraceExpansion(patterns) {
return patterns.reduce((collection, pattern) => {
return collection.concat(expandBraceExpansion(pattern));
}, []);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
expandPatternsWithBraceExpansion
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function expandBraceExpansion(pattern) {
return micromatch_1.braces(pattern, {
expand: true,
nodupes: true
});
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
expandBraceExpansion
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function getPatternParts(pattern, options) {
const info = picomatch$1.scan(pattern, Object.assign(Object.assign({}, options), {
parts: true
})); // See micromatch/picomatch#58 for more details
if (info.parts.length === 0) {
return [pattern];
}
return info.parts;
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
getPatternParts
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function makeRe(pattern, options) {
return micromatch_1.makeRe(pattern, options);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
makeRe
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function convertPatternsToRe(patterns, options) {
return patterns.map(pattern => makeRe(pattern, options));
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
convertPatternsToRe
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function matchAny(entry, patternsRe) {
return patternsRe.some(patternRe => patternRe.test(entry));
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
matchAny
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function merge2() {
const streamsQueue = [];
let merging = false;
const args = slice.call(arguments);
let options = args[args.length - 1];
if (options && !Array.isArray(options) && options.pipe == null) args.pop();else options = {};
const doEnd = options.end !== false;
if (options.objectMode == null) options.objectMode = true;
if (options.highWaterMark == null) options.highWaterMark = 64 * 1024;
const mergedStream = PassThrough(options);
function addStream() {
for (let i = 0, len = arguments.length; i < len; i++) {
streamsQueue.push(pauseStreams(arguments[i], options));
}
mergeStream();
return this;
}
function mergeStream() {
if (merging) return;
merging = true;
let streams = streamsQueue.shift();
if (!streams) {
process.nextTick(endStream);
return;
}
if (!Array.isArray(streams)) streams = [streams];
let pipesCount = streams.length + 1;
function next() {
if (--pipesCount > 0) return;
merging = false;
mergeStream();
}
function pipe(stream) {
function onend() {
stream.removeListener('merge2UnpipeEnd', onend);
stream.removeListener('end', onend);
next();
} // skip ended stream
if (stream._readableState.endEmitted) return next();
stream.on('merge2UnpipeEnd', onend);
stream.on('end', onend);
stream.pipe(mergedStream, {
end: false
}); // compatible for old stream
stream.resume();
}
for (let i = 0; i < streams.length; i++) pipe(streams[i]);
next();
}
function endStream() {
merging = false; // emit 'queueDrain' when all streams merged.
mergedStream.emit('queueDrain');
return doEnd && mergedStream.end();
}
mergedStream.setMaxListeners(0);
mergedStream.add = addStream;
mergedStream.on('unpipe', function (stream) {
stream.emit('merge2UnpipeEnd');
});
if (args.length) addStream.apply(null, args);
return mergedStream;
} // check and pause streams for pipe.
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
merge2
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function addStream() {
for (let i = 0, len = arguments.length; i < len; i++) {
streamsQueue.push(pauseStreams(arguments[i], options));
}
mergeStream();
return this;
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
addStream
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function mergeStream() {
if (merging) return;
merging = true;
let streams = streamsQueue.shift();
if (!streams) {
process.nextTick(endStream);
return;
}
if (!Array.isArray(streams)) streams = [streams];
let pipesCount = streams.length + 1;
function next() {
if (--pipesCount > 0) return;
merging = false;
mergeStream();
}
function pipe(stream) {
function onend() {
stream.removeListener('merge2UnpipeEnd', onend);
stream.removeListener('end', onend);
next();
} // skip ended stream
if (stream._readableState.endEmitted) return next();
stream.on('merge2UnpipeEnd', onend);
stream.on('end', onend);
stream.pipe(mergedStream, {
end: false
}); // compatible for old stream
stream.resume();
}
for (let i = 0; i < streams.length; i++) pipe(streams[i]);
next();
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
mergeStream
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function next() {
if (--pipesCount > 0) return;
merging = false;
mergeStream();
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
next
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function pipe(stream) {
function onend() {
stream.removeListener('merge2UnpipeEnd', onend);
stream.removeListener('end', onend);
next();
} // skip ended stream
if (stream._readableState.endEmitted) return next();
stream.on('merge2UnpipeEnd', onend);
stream.on('end', onend);
stream.pipe(mergedStream, {
end: false
}); // compatible for old stream
stream.resume();
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
pipe
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function onend() {
stream.removeListener('merge2UnpipeEnd', onend);
stream.removeListener('end', onend);
next();
} // skip ended stream
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
onend
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function endStream() {
merging = false; // emit 'queueDrain' when all streams merged.
mergedStream.emit('queueDrain');
return doEnd && mergedStream.end();
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
endStream
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function pauseStreams(streams, options) {
if (!Array.isArray(streams)) {
// Backwards-compat with old-style streams
if (!streams._readableState && streams.pipe) streams = streams.pipe(PassThrough(options));
if (!streams._readableState || !streams.pause || !streams.pipe) {
throw new Error('Only readable stream can be merged.');
}
streams.pause();
} else {
for (let i = 0, len = streams.length; i < len; i++) streams[i] = pauseStreams(streams[i], options);
}
return streams;
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
pauseStreams
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function merge(streams) {
const mergedStream = merge2_1(streams);
streams.forEach(stream => {
stream.once('error', error => mergedStream.emit('error', error));
});
mergedStream.once('close', () => propagateCloseEventToSources(streams));
mergedStream.once('end', () => propagateCloseEventToSources(streams));
return mergedStream;
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
merge
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function propagateCloseEventToSources(streams) {
streams.forEach(stream => stream.emit('close'));
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
propagateCloseEventToSources
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function isString(input) {
return typeof input === 'string';
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
isString
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function isEmpty(input) {
return input === '';
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
isEmpty
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function generate(patterns, settings) {
const positivePatterns = getPositivePatterns(patterns);
const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
const staticPatterns = positivePatterns.filter(pattern => utils$2.pattern.isStaticPattern(pattern, settings));
const dynamicPatterns = positivePatterns.filter(pattern => utils$2.pattern.isDynamicPattern(pattern, settings));
const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns,
/* dynamic */
false);
const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns,
/* dynamic */
true);
return staticTasks.concat(dynamicTasks);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
generate
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function getPositivePatterns(patterns) {
return utils$2.pattern.getPositivePatterns(patterns);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
getPositivePatterns
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function getNegativePatternsAsPositive(patterns, ignore) {
const negative = utils$2.pattern.getNegativePatterns(patterns).concat(ignore);
const positive = negative.map(utils$2.pattern.convertToPositivePattern);
return positive;
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
getNegativePatternsAsPositive
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function groupPatternsByBaseDirectory(patterns) {
const group = {};
return patterns.reduce((collection, pattern) => {
const base = utils$2.pattern.getBaseDirectory(pattern);
if (base in collection) {
collection[base].push(pattern);
} else {
collection[base] = [pattern];
}
return collection;
}, group);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
groupPatternsByBaseDirectory
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function convertPatternGroupsToTasks(positive, negative, dynamic) {
return Object.keys(positive).map(base => {
return convertPatternGroupToTask(base, positive[base], negative, dynamic);
});
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
convertPatternGroupsToTasks
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function convertPatternGroupToTask(base, positive, negative, dynamic) {
return {
dynamic,
positive,
negative,
base,
patterns: [].concat(positive, negative.map(utils$2.pattern.convertToNegativePattern))
};
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
convertPatternGroupToTask
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function read(path, settings, callback) {
settings.fs.lstat(path, (lstatError, lstat) => {
if (lstatError !== null) {
return callFailureCallback(callback, lstatError);
}
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
return callSuccessCallback(callback, lstat);
}
settings.fs.stat(path, (statError, stat) => {
if (statError !== null) {
if (settings.throwErrorOnBrokenSymbolicLink) {
return callFailureCallback(callback, statError);
}
return callSuccessCallback(callback, lstat);
}
if (settings.markSymbolicLink) {
stat.isSymbolicLink = () => true;
}
callSuccessCallback(callback, stat);
});
});
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
read
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function callSuccessCallback(callback, result) {
callback(null, result);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
callSuccessCallback
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function read(path, settings) {
const lstat = settings.fs.lstatSync(path);
if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
return lstat;
}
try {
const stat = settings.fs.statSync(path);
if (settings.markSymbolicLink) {
stat.isSymbolicLink = () => true;
}
return stat;
} catch (error) {
if (!settings.throwErrorOnBrokenSymbolicLink) {
return lstat;
}
throw error;
}
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
read
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function createFileSystemAdapter(fsMethods) {
if (fsMethods === undefined) {
return exports.FILE_SYSTEM_ADAPTER;
}
return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
createFileSystemAdapter
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
constructor(_options = {}) {
this._options = _options;
this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
this.fs = fs_1$1.createFileSystemAdapter(this._options.fs);
this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
constructor
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
_getValue(option, value) {
return option === undefined ? value : option;
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
_getValue
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function stat(path, optionsOrSettingsOrCallback, callback) {
if (typeof optionsOrSettingsOrCallback === 'function') {
return async.read(path, getSettings(), optionsOrSettingsOrCallback);
}
async.read(path, getSettings(optionsOrSettingsOrCallback), callback);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
stat
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function statSync(path, optionsOrSettings) {
const settings = getSettings(optionsOrSettings);
return sync.read(path, settings);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
statSync
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function getSettings(settingsOrOptions = {}) {
if (settingsOrOptions instanceof settings.default) {
return settingsOrOptions;
}
return new settings.default(settingsOrOptions);
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
getSettings
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function runParallel(tasks, cb) {
var results, pending, keys;
var isSync = true;
if (Array.isArray(tasks)) {
results = [];
pending = tasks.length;
} else {
keys = Object.keys(tasks);
results = {};
pending = keys.length;
}
function done(err) {
function end() {
if (cb) cb(err, results);
cb = null;
}
if (isSync) process.nextTick(end);else end();
}
function each(i, err, result) {
results[i] = result;
if (--pending === 0 || err) {
done(err);
}
}
if (!pending) {
// empty
done(null);
} else if (keys) {
// object
keys.forEach(function (key) {
tasks[key](function (err, result) {
each(key, err, result);
});
});
} else {
// array
tasks.forEach(function (task, i) {
task(function (err, result) {
each(i, err, result);
});
});
}
isSync = false;
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
runParallel
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function done(err) {
function end() {
if (cb) cb(err, results);
cb = null;
}
if (isSync) process.nextTick(end);else end();
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
done
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function end() {
if (cb) cb(err, results);
cb = null;
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
end
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function each(i, err, result) {
results[i] = result;
if (--pending === 0 || err) {
done(err);
}
}
|
When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
filepath directly (without read directory).
|
each
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
constructor(name, stats) {
this.name = name;
this.isBlockDevice = stats.isBlockDevice.bind(stats);
this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
this.isDirectory = stats.isDirectory.bind(stats);
this.isFIFO = stats.isFIFO.bind(stats);
this.isFile = stats.isFile.bind(stats);
this.isSocket = stats.isSocket.bind(stats);
this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
}
|
IS `true` for Node.js 10.10 and greater.
|
constructor
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function createDirentFromStats(name, stats) {
return new DirentFromStats(name, stats);
}
|
IS `true` for Node.js 10.10 and greater.
|
createDirentFromStats
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function read(directory, settings, callback) {
if (!settings.stats && constants$2.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
return readdirWithFileTypes(directory, settings, callback);
}
return readdir(directory, settings, callback);
}
|
IS `true` for Node.js 10.10 and greater.
|
read
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function readdirWithFileTypes(directory, settings, callback) {
settings.fs.readdir(directory, {
withFileTypes: true
}, (readdirError, dirents) => {
if (readdirError !== null) {
return callFailureCallback(callback, readdirError);
}
const entries = dirents.map(dirent => ({
dirent,
name: dirent.name,
path: `${directory}${settings.pathSegmentSeparator}${dirent.name}`
}));
if (!settings.followSymbolicLinks) {
return callSuccessCallback(callback, entries);
}
const tasks = entries.map(entry => makeRplTaskEntry(entry, settings));
runParallel_1(tasks, (rplError, rplEntries) => {
if (rplError !== null) {
return callFailureCallback(callback, rplError);
}
callSuccessCallback(callback, rplEntries);
});
});
}
|
IS `true` for Node.js 10.10 and greater.
|
readdirWithFileTypes
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function makeRplTaskEntry(entry, settings) {
return done => {
if (!entry.dirent.isSymbolicLink()) {
return done(null, entry);
}
settings.fs.stat(entry.path, (statError, stats) => {
if (statError !== null) {
if (settings.throwErrorOnBrokenSymbolicLink) {
return done(statError);
}
return done(null, entry);
}
entry.dirent = utils$3.fs.createDirentFromStats(entry.name, stats);
return done(null, entry);
});
};
}
|
IS `true` for Node.js 10.10 and greater.
|
makeRplTaskEntry
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function readdir(directory, settings, callback) {
settings.fs.readdir(directory, (readdirError, names) => {
if (readdirError !== null) {
return callFailureCallback(callback, readdirError);
}
const filepaths = names.map(name => `${directory}${settings.pathSegmentSeparator}${name}`);
const tasks = filepaths.map(filepath => {
return done => out.stat(filepath, settings.fsStatSettings, done);
});
runParallel_1(tasks, (rplError, results) => {
if (rplError !== null) {
return callFailureCallback(callback, rplError);
}
const entries = [];
names.forEach((name, index) => {
const stats = results[index];
const entry = {
name,
path: filepaths[index],
dirent: utils$3.fs.createDirentFromStats(name, stats)
};
if (settings.stats) {
entry.stats = stats;
}
entries.push(entry);
});
callSuccessCallback(callback, entries);
});
});
}
|
IS `true` for Node.js 10.10 and greater.
|
readdir
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function callSuccessCallback(callback, result) {
callback(null, result);
}
|
IS `true` for Node.js 10.10 and greater.
|
callSuccessCallback
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function read(directory, settings) {
if (!settings.stats && constants$2.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
return readdirWithFileTypes(directory, settings);
}
return readdir(directory, settings);
}
|
IS `true` for Node.js 10.10 and greater.
|
read
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function readdirWithFileTypes(directory, settings) {
const dirents = settings.fs.readdirSync(directory, {
withFileTypes: true
});
return dirents.map(dirent => {
const entry = {
dirent,
name: dirent.name,
path: `${directory}${settings.pathSegmentSeparator}${dirent.name}`
};
if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
try {
const stats = settings.fs.statSync(entry.path);
entry.dirent = utils$3.fs.createDirentFromStats(entry.name, stats);
} catch (error) {
if (settings.throwErrorOnBrokenSymbolicLink) {
throw error;
}
}
}
return entry;
});
}
|
IS `true` for Node.js 10.10 and greater.
|
readdirWithFileTypes
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function readdir(directory, settings) {
const names = settings.fs.readdirSync(directory);
return names.map(name => {
const entryPath = `${directory}${settings.pathSegmentSeparator}${name}`;
const stats = out.statSync(entryPath, settings.fsStatSettings);
const entry = {
name,
path: entryPath,
dirent: utils$3.fs.createDirentFromStats(name, stats)
};
if (settings.stats) {
entry.stats = stats;
}
return entry;
});
}
|
IS `true` for Node.js 10.10 and greater.
|
readdir
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function createFileSystemAdapter(fsMethods) {
if (fsMethods === undefined) {
return exports.FILE_SYSTEM_ADAPTER;
}
return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
}
|
IS `true` for Node.js 10.10 and greater.
|
createFileSystemAdapter
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
constructor(_options = {}) {
this._options = _options;
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
this.fs = fs_1$3.createFileSystemAdapter(this._options.fs);
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path.sep);
this.stats = this._getValue(this._options.stats, false);
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
this.fsStatSettings = new out.Settings({
followSymbolicLink: this.followSymbolicLinks,
fs: this.fs,
throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
});
}
|
IS `true` for Node.js 10.10 and greater.
|
constructor
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
_getValue(option, value) {
return option === undefined ? value : option;
}
|
IS `true` for Node.js 10.10 and greater.
|
_getValue
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function scandir(path, optionsOrSettingsOrCallback, callback) {
if (typeof optionsOrSettingsOrCallback === 'function') {
return async$1.read(path, getSettings(), optionsOrSettingsOrCallback);
}
async$1.read(path, getSettings(optionsOrSettingsOrCallback), callback);
}
|
IS `true` for Node.js 10.10 and greater.
|
scandir
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function scandirSync(path, optionsOrSettings) {
const settings = getSettings(optionsOrSettings);
return sync$1.read(path, settings);
}
|
IS `true` for Node.js 10.10 and greater.
|
scandirSync
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function getSettings(settingsOrOptions = {}) {
if (settingsOrOptions instanceof settings$1.default) {
return settingsOrOptions;
}
return new settings$1.default(settingsOrOptions);
}
|
IS `true` for Node.js 10.10 and greater.
|
getSettings
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function reusify(Constructor) {
var head = new Constructor();
var tail = head;
function get() {
var current = head;
if (current.next) {
head = current.next;
} else {
head = new Constructor();
tail = head;
}
current.next = null;
return current;
}
function release(obj) {
tail.next = obj;
tail = obj;
}
return {
get: get,
release: release
};
}
|
IS `true` for Node.js 10.10 and greater.
|
reusify
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function get() {
var current = head;
if (current.next) {
head = current.next;
} else {
head = new Constructor();
tail = head;
}
current.next = null;
return current;
}
|
IS `true` for Node.js 10.10 and greater.
|
get
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function release(obj) {
tail.next = obj;
tail = obj;
}
|
IS `true` for Node.js 10.10 and greater.
|
release
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function fastqueue(context, worker, concurrency) {
if (typeof context === 'function') {
concurrency = worker;
worker = context;
context = null;
}
var cache = reusify_1(Task);
var queueHead = null;
var queueTail = null;
var _running = 0;
var self = {
push: push,
drain: noop,
saturated: noop,
pause: pause,
paused: false,
concurrency: concurrency,
running: running,
resume: resume,
idle: idle,
length: length,
unshift: unshift,
empty: noop,
kill: kill,
killAndDrain: killAndDrain
};
return self;
function running() {
return _running;
}
function pause() {
self.paused = true;
}
function length() {
var current = queueHead;
var counter = 0;
while (current) {
current = current.next;
counter++;
}
return counter;
}
function resume() {
if (!self.paused) return;
self.paused = false;
for (var i = 0; i < self.concurrency; i++) {
_running++;
release();
}
}
function idle() {
return _running === 0 && self.length() === 0;
}
function push(value, done) {
var current = cache.get();
current.context = context;
current.release = release;
current.value = value;
current.callback = done || noop;
if (_running === self.concurrency || self.paused) {
if (queueTail) {
queueTail.next = current;
queueTail = current;
} else {
queueHead = current;
queueTail = current;
self.saturated();
}
} else {
_running++;
worker.call(context, current.value, current.worked);
}
}
function unshift(value, done) {
var current = cache.get();
current.context = context;
current.release = release;
current.value = value;
current.callback = done || noop;
if (_running === self.concurrency || self.paused) {
if (queueHead) {
current.next = queueHead;
queueHead = current;
} else {
queueHead = current;
queueTail = current;
self.saturated();
}
} else {
_running++;
worker.call(context, current.value, current.worked);
}
}
function release(holder) {
if (holder) {
cache.release(holder);
}
var next = queueHead;
if (next) {
if (!self.paused) {
if (queueTail === queueHead) {
queueTail = null;
}
queueHead = next.next;
next.next = null;
worker.call(context, next.value, next.worked);
if (queueTail === null) {
self.empty();
}
} else {
_running--;
}
} else if (--_running === 0) {
self.drain();
}
}
function kill() {
queueHead = null;
queueTail = null;
self.drain = noop;
}
function killAndDrain() {
queueHead = null;
queueTail = null;
self.drain();
self.drain = noop;
}
}
|
IS `true` for Node.js 10.10 and greater.
|
fastqueue
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function running() {
return _running;
}
|
IS `true` for Node.js 10.10 and greater.
|
running
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function pause() {
self.paused = true;
}
|
IS `true` for Node.js 10.10 and greater.
|
pause
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function length() {
var current = queueHead;
var counter = 0;
while (current) {
current = current.next;
counter++;
}
return counter;
}
|
IS `true` for Node.js 10.10 and greater.
|
length
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function resume() {
if (!self.paused) return;
self.paused = false;
for (var i = 0; i < self.concurrency; i++) {
_running++;
release();
}
}
|
IS `true` for Node.js 10.10 and greater.
|
resume
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function idle() {
return _running === 0 && self.length() === 0;
}
|
IS `true` for Node.js 10.10 and greater.
|
idle
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function push(value, done) {
var current = cache.get();
current.context = context;
current.release = release;
current.value = value;
current.callback = done || noop;
if (_running === self.concurrency || self.paused) {
if (queueTail) {
queueTail.next = current;
queueTail = current;
} else {
queueHead = current;
queueTail = current;
self.saturated();
}
} else {
_running++;
worker.call(context, current.value, current.worked);
}
}
|
IS `true` for Node.js 10.10 and greater.
|
push
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function unshift(value, done) {
var current = cache.get();
current.context = context;
current.release = release;
current.value = value;
current.callback = done || noop;
if (_running === self.concurrency || self.paused) {
if (queueHead) {
current.next = queueHead;
queueHead = current;
} else {
queueHead = current;
queueTail = current;
self.saturated();
}
} else {
_running++;
worker.call(context, current.value, current.worked);
}
}
|
IS `true` for Node.js 10.10 and greater.
|
unshift
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function release(holder) {
if (holder) {
cache.release(holder);
}
var next = queueHead;
if (next) {
if (!self.paused) {
if (queueTail === queueHead) {
queueTail = null;
}
queueHead = next.next;
next.next = null;
worker.call(context, next.value, next.worked);
if (queueTail === null) {
self.empty();
}
} else {
_running--;
}
} else if (--_running === 0) {
self.drain();
}
}
|
IS `true` for Node.js 10.10 and greater.
|
release
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function kill() {
queueHead = null;
queueTail = null;
self.drain = noop;
}
|
IS `true` for Node.js 10.10 and greater.
|
kill
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function killAndDrain() {
queueHead = null;
queueTail = null;
self.drain();
self.drain = noop;
}
|
IS `true` for Node.js 10.10 and greater.
|
killAndDrain
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function Task() {
this.value = null;
this.callback = noop;
this.next = null;
this.release = noop;
this.context = null;
var self = this;
this.worked = function worked(err, result) {
var callback = self.callback;
self.value = null;
self.callback = noop;
callback.call(self.context, err, result);
self.release(self);
};
}
|
IS `true` for Node.js 10.10 and greater.
|
Task
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function isFatalError(settings, error) {
if (settings.errorFilter === null) {
return true;
}
return !settings.errorFilter(error);
}
|
IS `true` for Node.js 10.10 and greater.
|
isFatalError
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function isAppliedFilter(filter, value) {
return filter === null || filter(value);
}
|
IS `true` for Node.js 10.10 and greater.
|
isAppliedFilter
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function replacePathSegmentSeparator(filepath, separator) {
return filepath.split(/[\\/]/).join(separator);
}
|
IS `true` for Node.js 10.10 and greater.
|
replacePathSegmentSeparator
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
function joinPathSegments(a, b, separator) {
if (a === '') {
return b;
}
return a + separator + b;
}
|
IS `true` for Node.js 10.10 and greater.
|
joinPathSegments
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
constructor(_root, _settings) {
this._root = _root;
this._settings = _settings;
this._root = common.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
}
|
IS `true` for Node.js 10.10 and greater.
|
constructor
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
constructor(_root, _settings) {
super(_root, _settings);
this._settings = _settings;
this._scandir = out$1.scandir;
this._emitter = new events.EventEmitter();
this._queue = queue(this._worker.bind(this), this._settings.concurrency);
this._isFatalError = false;
this._isDestroyed = false;
this._queue.drain = () => {
if (!this._isFatalError) {
this._emitter.emit('end');
}
};
}
|
IS `true` for Node.js 10.10 and greater.
|
constructor
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
read() {
this._isFatalError = false;
this._isDestroyed = false;
setImmediate(() => {
this._pushToQueue(this._root, this._settings.basePath);
});
return this._emitter;
}
|
IS `true` for Node.js 10.10 and greater.
|
read
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
destroy() {
if (this._isDestroyed) {
throw new Error('The reader is already destroyed');
}
this._isDestroyed = true;
this._queue.killAndDrain();
}
|
IS `true` for Node.js 10.10 and greater.
|
destroy
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
onEntry(callback) {
this._emitter.on('entry', callback);
}
|
IS `true` for Node.js 10.10 and greater.
|
onEntry
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
onError(callback) {
this._emitter.once('error', callback);
}
|
IS `true` for Node.js 10.10 and greater.
|
onError
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
onEnd(callback) {
this._emitter.once('end', callback);
}
|
IS `true` for Node.js 10.10 and greater.
|
onEnd
|
javascript
|
douyu/juno
|
assets/public/js/prettier/v2.0.5/bin-prettier.js
|
https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/bin-prettier.js
|
Apache-2.0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.