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 |
---|---|---|---|---|---|---|---|
parseFalse_a() {
if (this.char === CHAR_a) {
this.consume();
return this.next(this.parseFalse_l);
} else {
throw this.error(new TomlError('Invalid boolean, expected true or 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 = '*
|
parseFalse_a
|
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
|
parseFalse_l() {
if (this.char === CHAR_l) {
this.consume();
return this.next(this.parseFalse_s);
} else {
throw this.error(new TomlError('Invalid boolean, expected true or 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 = '*
|
parseFalse_l
|
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
|
parseFalse_s() {
if (this.char === CHAR_s) {
this.consume();
return this.next(this.parseFalse_e);
} else {
throw this.error(new TomlError('Invalid boolean, expected true or 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 = '*
|
parseFalse_s
|
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
|
parseFalse_e() {
if (this.char === CHAR_e) {
return this.return(false);
} else {
throw this.error(new TomlError('Invalid boolean, expected true or 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 = '*
|
parseFalse_e
|
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
|
parseInlineList() {
if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {
return null;
} else if (this.char === Parser.END) {
throw this.error(new TomlError('Unterminated inline array'));
} else if (this.char === CHAR_NUM) {
return this.call(this.parseComment);
} else if (this.char === CHAR_RSQB) {
return this.return(this.state.resultArr || InlineList());
} else {
return this.callNow(this.parseValue, this.recordInlineListValue);
}
}
|
/**}');
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 = '*
|
parseInlineList
|
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
|
recordInlineListValue(value) {
if (this.state.resultArr) {
const listType = this.state.resultArr[_contentType];
const valueType = tomlType(value);
if (listType !== valueType) {
throw this.error(new TomlError(`Inline lists must be a single type, not a mix of ${listType} and ${valueType}`));
}
} else {
this.state.resultArr = InlineList(tomlType(value));
}
if (isFloat(value) || isInteger(value)) {
// unbox now that we've verified they're ok
this.state.resultArr.push(value.valueOf());
} else {
this.state.resultArr.push(value);
}
return this.goto(this.parseInlineListNext);
}
|
/**}');
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 = '*
|
recordInlineListValue
|
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
|
parseInlineListNext() {
if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {
return null;
} else if (this.char === CHAR_NUM) {
return this.call(this.parseComment);
} else if (this.char === CHAR_COMMA) {
return this.next(this.parseInlineList);
} else if (this.char === CHAR_RSQB) {
return this.goto(this.parseInlineList);
} else {
throw this.error(new TomlError('Invalid character, expected whitespace, comma (,) or close bracket (])'));
}
}
|
/**}');
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 = '*
|
parseInlineListNext
|
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
|
parseInlineTable() {
if (this.char === CHAR_SP || this.char === CTRL_I) {
return null;
} else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {
throw this.error(new TomlError('Unterminated inline array'));
} else if (this.char === CHAR_RCUB) {
return this.return(this.state.resultTable || InlineTable());
} else {
if (!this.state.resultTable) this.state.resultTable = InlineTable();
return this.callNow(this.parseAssign, this.recordInlineTableValue);
}
}
|
/**}');
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 = '*
|
parseInlineTable
|
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
|
recordInlineTableValue(kv) {
let target = this.state.resultTable;
let finalKey = kv.key.pop();
for (let kw of kv.key) {
if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) {
throw this.error(new TomlError("Can't redefine existing key"));
}
target = target[kw] = target[kw] || Table();
}
if (hasKey(target, finalKey)) {
throw this.error(new TomlError("Can't redefine existing key"));
}
if (isInteger(kv.value) || isFloat(kv.value)) {
target[finalKey] = kv.value.valueOf();
} else {
target[finalKey] = kv.value;
}
return this.goto(this.parseInlineTableNext);
}
|
/**}');
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 = '*
|
recordInlineTableValue
|
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
|
parseInlineTableNext() {
if (this.char === CHAR_SP || this.char === CTRL_I) {
return null;
} else if (this.char === Parser.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {
throw this.error(new TomlError('Unterminated inline array'));
} else if (this.char === CHAR_COMMA) {
return this.next(this.parseInlineTable);
} else if (this.char === CHAR_RCUB) {
return this.goto(this.parseInlineTable);
} else {
throw this.error(new TomlError('Invalid character, expected whitespace, comma (,) or close bracket (])'));
}
}
|
/**}');
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 = '*
|
parseInlineTableNext
|
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 prettyError(err, buf) {
/* istanbul ignore if */
if (err.pos == null || err.line == null) return err;
let msg = err.message;
msg += ` at row ${err.line + 1}, col ${err.col + 1}, pos ${err.pos}:\n`;
/* istanbul ignore else */
if (buf && buf.split) {
const lines = buf.split(/\n/);
const lineNumWidth = String(Math.min(lines.length, err.line + 3)).length;
let linePadding = ' ';
while (linePadding.length < lineNumWidth) linePadding += ' ';
for (let ii = Math.max(0, err.line - 1); ii < Math.min(lines.length, err.line + 2); ++ii) {
let lineNum = String(ii + 1);
if (lineNum.length < lineNumWidth) lineNum = ' ' + lineNum;
if (err.line === ii) {
msg += lineNum + '> ' + lines[ii] + '\n';
msg += linePadding + ' ';
for (let hh = 0; hh < err.col; ++hh) {
msg += ' ';
}
msg += '^\n';
} else {
msg += lineNum + ': ' + lines[ii] + '\n';
}
}
}
err.message = msg + '\n';
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 = '*
|
prettyError
|
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(str) {
if (global.Buffer && global.Buffer.isBuffer(str)) {
str = str.toString('utf8');
}
const parser = new tomlParser();
try {
parser.parse(str);
return parser.finish();
} catch (err) {
throw parsePrettyError(err, str);
}
}
|
/**}');
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 = '*
|
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
|
loadToml = function (filePath, content) {
try {
return parseString_1(content);
} catch (error) {
error.message = `TOML Error in ${filePath}:\n${error.message}`;
throw error;
}
}
|
/**}');
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 = '*
|
loadToml
|
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
|
caller = function () {
// see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
var origPrepareStackTrace = Error.prepareStackTrace;
Error.prepareStackTrace = function (_, stack) {
return stack;
};
var stack = new Error().stack;
Error.prepareStackTrace = origPrepareStackTrace;
return stack[2].getFileName();
}
|
/**}');
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 = '*
|
caller
|
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 win32SplitPath(filename) {
// Separate device+slash from tail
var result = splitDeviceRe.exec(filename),
device = (result[1] || '') + (result[2] || ''),
tail = result[3] || ''; // Split the tail into dir, basename and extension
var result2 = splitTailRe.exec(tail),
dir = result2[1],
basename = result2[2],
ext = result2[3];
return [device, dir, basename, ext];
}
|
/**}');
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 = '*
|
win32SplitPath
|
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 posixSplitPath(filename) {
return splitPathRe.exec(filename).slice(1);
}
|
/**}');
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 = '*
|
posixSplitPath
|
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
|
getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) {
var prefix = '/';
if (/^([A-Za-z]:)/.test(absoluteStart)) {
prefix = '';
} else if (/^\\\\/.test(absoluteStart)) {
prefix = '\\\\';
}
var paths = [absoluteStart];
var parsed = parse$2(absoluteStart);
while (parsed.dir !== paths[paths.length - 1]) {
paths.push(parsed.dir);
parsed = parse$2(parsed.dir);
}
return paths.reduce(function (dirs, aPath) {
return dirs.concat(modules.map(function (moduleDir) {
return path$2.resolve(prefix, aPath, moduleDir);
}));
}, []);
}
|
/**}');
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 = '*
|
getNodeModulesDirs
|
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
|
nodeModulesPaths = function nodeModulesPaths(start, opts, request) {
var modules = opts && opts.moduleDirectory ? [].concat(opts.moduleDirectory) : ['node_modules'];
if (opts && typeof opts.paths === 'function') {
return opts.paths(request, start, function () {
return getNodeModulesDirs(start, modules);
}, opts);
}
var dirs = getNodeModulesDirs(start, modules);
return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
}
|
/**}');
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 = '*
|
nodeModulesPaths
|
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
|
normalizeOptions$2 = function (x, opts) {
/**
* This file is purposefully a passthrough. It's expected that third-party
* environments will override it at runtime in order to inject special logic
* into `resolve` (by manipulating the options). One such example is the PnP
* code path in Yarn.
*/
return opts || {};
}
|
/**}');
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 = '*
|
normalizeOptions$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 specifierIncluded(specifier) {
var parts = specifier.split(' ');
var op = parts.length > 1 ? parts[0] : '=';
var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');
for (var i = 0; i < 3; ++i) {
var cur = Number(current[i] || 0);
var ver = Number(versionParts[i] || 0);
if (cur === ver) {
continue; // eslint-disable-line no-restricted-syntax, no-continue
}
if (op === '<') {
return cur < ver;
} else if (op === '>=') {
return cur >= ver;
} else {
return false;
}
}
return op === '>=';
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
specifierIncluded
|
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 matchesRange(range) {
var specifiers = range.split(/ ?&& ?/);
if (specifiers.length === 0) {
return false;
}
for (var i = 0; i < specifiers.length; ++i) {
if (!specifierIncluded(specifiers[i])) {
return false;
}
}
return true;
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
matchesRange
|
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 versionIncluded(specifierValue) {
if (typeof specifierValue === 'boolean') {
return specifierValue;
}
if (specifierValue && typeof specifierValue === 'object') {
for (var i = 0; i < specifierValue.length; ++i) {
if (matchesRange(specifierValue[i])) {
return true;
}
}
return false;
}
return matchesRange(specifierValue);
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
versionIncluded
|
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
|
isCore = function isCore(x) {
return Object.prototype.hasOwnProperty.call(core_1, x);
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
isCore
|
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
|
defaultIsFile = function isFile(file, cb) {
fs$3.stat(file, function (err, stat) {
if (!err) {
return cb(null, stat.isFile() || stat.isFIFO());
}
if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
return cb(err);
});
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
defaultIsFile
|
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
|
defaultIsDir = function isDirectory(dir, cb) {
fs$3.stat(dir, function (err, stat) {
if (!err) {
return cb(null, stat.isDirectory());
}
if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
return cb(err);
});
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
defaultIsDir
|
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
|
defaultRealpath = function realpath(x, cb) {
realpathFS(x, function (realpathErr, realPath) {
if (realpathErr && realpathErr.code !== 'ENOENT') cb(realpathErr);else cb(null, realpathErr ? x : realPath);
});
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
defaultRealpath
|
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
|
maybeRealpath = function maybeRealpath(realpath, x, opts, cb) {
if (opts && opts.preserveSymlinks === false) {
realpath(x, cb);
} else {
cb(null, x);
}
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
maybeRealpath
|
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
|
getPackageCandidates = function getPackageCandidates(x, start, opts) {
var dirs = nodeModulesPaths(start, opts, x);
for (var i = 0; i < dirs.length; i++) {
dirs[i] = path$2.join(dirs[i], x);
}
return dirs;
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
getPackageCandidates
|
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 init(basedir) {
if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x)) {
res = path$2.resolve(basedir, x);
if (x === '.' || x === '..' || x.slice(-1) === '/') res += '/';
if (/\/$/.test(x) && res === basedir) {
loadAsDirectory(res, opts.package, onfile);
} else loadAsFile(res, opts.package, onfile);
} else if (isCore(x)) {
return cb(null, x);
} else loadNodeModules(x, basedir, function (err, n, pkg) {
if (err) cb(err);else if (n) {
return maybeRealpath(realpath, n, opts, function (err, realN) {
if (err) {
cb(err);
} else {
cb(null, realN, pkg);
}
});
} else {
var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
moduleError.code = 'MODULE_NOT_FOUND';
cb(moduleError);
}
});
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
init
|
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 onfile(err, m, pkg) {
if (err) cb(err);else if (m) cb(null, m, pkg);else loadAsDirectory(res, function (err, d, pkg) {
if (err) cb(err);else if (d) {
maybeRealpath(realpath, d, opts, function (err, realD) {
if (err) {
cb(err);
} else {
cb(null, realD, pkg);
}
});
} else {
var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
moduleError.code = 'MODULE_NOT_FOUND';
cb(moduleError);
}
});
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
onfile
|
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 loadAsFile(x, thePackage, callback) {
var loadAsFilePackage = thePackage;
var cb = callback;
if (typeof loadAsFilePackage === 'function') {
cb = loadAsFilePackage;
loadAsFilePackage = undefined;
}
var exts = [''].concat(extensions);
load(exts, x, loadAsFilePackage);
function load(exts, x, loadPackage) {
if (exts.length === 0) return cb(null, undefined, loadPackage);
var file = x + exts[0];
var pkg = loadPackage;
if (pkg) onpkg(null, pkg);else loadpkg(path$2.dirname(file), onpkg);
function onpkg(err, pkg_, dir) {
pkg = pkg_;
if (err) return cb(err);
if (dir && pkg && opts.pathFilter) {
var rfile = path$2.relative(dir, file);
var rel = rfile.slice(0, rfile.length - exts[0].length);
var r = opts.pathFilter(pkg, x, rel);
if (r) return load([''].concat(extensions.slice()), path$2.resolve(dir, r), pkg);
}
isFile(file, onex);
}
function onex(err, ex) {
if (err) return cb(err);
if (ex) return cb(null, file, pkg);
load(exts.slice(1), x, pkg);
}
}
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
loadAsFile
|
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 load(exts, x, loadPackage) {
if (exts.length === 0) return cb(null, undefined, loadPackage);
var file = x + exts[0];
var pkg = loadPackage;
if (pkg) onpkg(null, pkg);else loadpkg(path$2.dirname(file), onpkg);
function onpkg(err, pkg_, dir) {
pkg = pkg_;
if (err) return cb(err);
if (dir && pkg && opts.pathFilter) {
var rfile = path$2.relative(dir, file);
var rel = rfile.slice(0, rfile.length - exts[0].length);
var r = opts.pathFilter(pkg, x, rel);
if (r) return load([''].concat(extensions.slice()), path$2.resolve(dir, r), pkg);
}
isFile(file, onex);
}
function onex(err, ex) {
if (err) return cb(err);
if (ex) return cb(null, file, pkg);
load(exts.slice(1), x, pkg);
}
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
load
|
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 onpkg(err, pkg_, dir) {
pkg = pkg_;
if (err) return cb(err);
if (dir && pkg && opts.pathFilter) {
var rfile = path$2.relative(dir, file);
var rel = rfile.slice(0, rfile.length - exts[0].length);
var r = opts.pathFilter(pkg, x, rel);
if (r) return load([''].concat(extensions.slice()), path$2.resolve(dir, r), pkg);
}
isFile(file, onex);
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
onpkg
|
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 onex(err, ex) {
if (err) return cb(err);
if (ex) return cb(null, file, pkg);
load(exts.slice(1), x, pkg);
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
onex
|
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 loadpkg(dir, cb) {
if (dir === '' || dir === '/') return cb(null);
if (process.platform === 'win32' && /^\w:[/\\]*$/.test(dir)) {
return cb(null);
}
if (/[/\\]node_modules[/\\]*$/.test(dir)) return cb(null);
maybeRealpath(realpath, dir, opts, function (unwrapErr, pkgdir) {
if (unwrapErr) return loadpkg(path$2.dirname(dir), cb);
var pkgfile = path$2.join(pkgdir, 'package.json');
isFile(pkgfile, function (err, ex) {
// on err, ex is false
if (!ex) return loadpkg(path$2.dirname(dir), cb);
readFile(pkgfile, function (err, body) {
if (err) cb(err);
try {
var pkg = JSON.parse(body);
} catch (jsonErr) {}
if (pkg && opts.packageFilter) {
pkg = opts.packageFilter(pkg, pkgfile);
}
cb(null, pkg, dir);
});
});
});
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
loadpkg
|
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 processDirs(cb, dirs) {
if (dirs.length === 0) return cb(null, undefined);
var dir = dirs[0];
isDirectory(path$2.dirname(dir), isdir);
function isdir(err, isdir) {
if (err) return cb(err);
if (!isdir) return processDirs(cb, dirs.slice(1));
loadAsFile(dir, opts.package, onfile);
}
function onfile(err, m, pkg) {
if (err) return cb(err);
if (m) return cb(null, m, pkg);
loadAsDirectory(dir, opts.package, ondir);
}
function ondir(err, n, pkg) {
if (err) return cb(err);
if (n) return cb(null, n, pkg);
processDirs(cb, dirs.slice(1));
}
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
processDirs
|
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 isdir(err, isdir) {
if (err) return cb(err);
if (!isdir) return processDirs(cb, dirs.slice(1));
loadAsFile(dir, opts.package, onfile);
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
isdir
|
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 onfile(err, m, pkg) {
if (err) return cb(err);
if (m) return cb(null, m, pkg);
loadAsDirectory(dir, opts.package, ondir);
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
onfile
|
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 ondir(err, n, pkg) {
if (err) return cb(err);
if (n) return cb(null, n, pkg);
processDirs(cb, dirs.slice(1));
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
ondir
|
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 loadNodeModules(x, start, cb) {
var thunk = function () {
return getPackageCandidates(x, start, opts);
};
processDirs(cb, packageIterator ? packageIterator(x, start, thunk, opts) : thunk());
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
loadNodeModules
|
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
|
thunk = function () {
return getPackageCandidates(x, start, opts);
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
thunk
|
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
|
defaultIsFile$1 = function isFile(file) {
try {
var stat = fs$3.statSync(file);
} catch (e) {
if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
throw e;
}
return stat.isFile() || stat.isFIFO();
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
defaultIsFile$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
|
defaultIsDir$1 = function isDirectory(dir) {
try {
var stat = fs$3.statSync(dir);
} catch (e) {
if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
throw e;
}
return stat.isDirectory();
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
defaultIsDir$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
|
defaultRealpathSync = function realpathSync(x) {
try {
return realpathFS$1(x);
} catch (realpathErr) {
if (realpathErr.code !== 'ENOENT') {
throw realpathErr;
}
}
return x;
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
defaultRealpathSync
|
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
|
maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) {
if (opts && opts.preserveSymlinks === false) {
return realpathSync(x);
}
return x;
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
maybeRealpathSync
|
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
|
getPackageCandidates$1 = function getPackageCandidates(x, start, opts) {
var dirs = nodeModulesPaths(start, opts, x);
for (var i = 0; i < dirs.length; i++) {
dirs[i] = path$2.join(dirs[i], x);
}
return dirs;
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
getPackageCandidates$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 loadAsFileSync(x) {
var pkg = loadpkg(path$2.dirname(x));
if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
var rfile = path$2.relative(pkg.dir, x);
var r = opts.pathFilter(pkg.pkg, x, rfile);
if (r) {
x = path$2.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign
}
}
if (isFile(x)) {
return x;
}
for (var i = 0; i < extensions.length; i++) {
var file = x + extensions[i];
if (isFile(file)) {
return file;
}
}
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
loadAsFileSync
|
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 loadpkg(dir) {
if (dir === '' || dir === '/') return;
if (process.platform === 'win32' && /^\w:[/\\]*$/.test(dir)) {
return;
}
if (/[/\\]node_modules[/\\]*$/.test(dir)) return;
var pkgfile = path$2.join(maybeRealpathSync(realpathSync, dir, opts), 'package.json');
if (!isFile(pkgfile)) {
return loadpkg(path$2.dirname(dir));
}
var body = readFileSync(pkgfile);
try {
var pkg = JSON.parse(body);
} catch (jsonErr) {}
if (pkg && opts.packageFilter) {
// v2 will pass pkgfile
pkg = opts.packageFilter(pkg,
/*pkgfile,*/
dir); // eslint-disable-line spaced-comment
}
return {
pkg: pkg,
dir: dir
};
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
loadpkg
|
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 loadNodeModulesSync(x, start) {
var thunk = function () {
return getPackageCandidates$1(x, start, opts);
};
var dirs = packageIterator ? packageIterator(x, start, thunk, opts) : thunk();
for (var i = 0; i < dirs.length; i++) {
var dir = dirs[i];
if (isDirectory(path$2.dirname(dir))) {
var m = loadAsFileSync(dir);
if (m) return m;
var n = loadAsDirectorySync(dir);
if (n) return n;
}
}
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
loadNodeModulesSync
|
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
|
thunk = function () {
return getPackageCandidates$1(x, start, opts);
}
|
This file is purposefully a passthrough. It's expected that third-party
environments will override it at runtime in order to inject special logic
into `resolve` (by manipulating the options). One such example is the PnP
code path in Yarn.
|
thunk
|
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 getExplorer(opts) {
// Normalize opts before passing to a memoized function
opts = Object.assign({
sync: false,
cache: false
}, opts);
return getExplorerMemoized(opts);
}
|
@param {{ cache: boolean, sync: boolean }} opts
|
getExplorer
|
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 _resolveConfig(filePath, opts, sync) {
opts = Object.assign({
useCache: true
}, opts);
const loadOpts = {
cache: !!opts.useCache,
sync: !!sync,
editorconfig: !!opts.editorconfig
};
const {
load,
search
} = getExplorer(loadOpts);
const loadEditorConfig = resolveConfigEditorconfig.getLoadFunction(loadOpts);
const arr = [opts.config ? load(opts.config) : search(filePath), loadEditorConfig(filePath)];
const unwrapAndMerge = ([result, editorConfigured]) => {
const merged = Object.assign(Object.assign({}, editorConfigured), mergeOverrides(result, filePath));
["plugins", "pluginSearchDirs"].forEach(optionName => {
if (Array.isArray(merged[optionName])) {
merged[optionName] = merged[optionName].map(value => typeof value === "string" && value.startsWith(".") // relative path
? path$2.resolve(path$2.dirname(result.filepath), value) : value);
}
});
if (!result && !editorConfigured) {
return null;
}
return merged;
};
if (loadOpts.sync) {
return unwrapAndMerge(arr);
}
return Promise.all(arr).then(unwrapAndMerge);
}
|
@param {{ cache: boolean, sync: boolean }} opts
|
_resolveConfig
|
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
|
unwrapAndMerge = ([result, editorConfigured]) => {
const merged = Object.assign(Object.assign({}, editorConfigured), mergeOverrides(result, filePath));
["plugins", "pluginSearchDirs"].forEach(optionName => {
if (Array.isArray(merged[optionName])) {
merged[optionName] = merged[optionName].map(value => typeof value === "string" && value.startsWith(".") // relative path
? path$2.resolve(path$2.dirname(result.filepath), value) : value);
}
});
if (!result && !editorConfigured) {
return null;
}
return merged;
}
|
@param {{ cache: boolean, sync: boolean }} opts
|
unwrapAndMerge
|
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
|
unwrapAndMerge = ([result, editorConfigured]) => {
const merged = Object.assign(Object.assign({}, editorConfigured), mergeOverrides(result, filePath));
["plugins", "pluginSearchDirs"].forEach(optionName => {
if (Array.isArray(merged[optionName])) {
merged[optionName] = merged[optionName].map(value => typeof value === "string" && value.startsWith(".") // relative path
? path$2.resolve(path$2.dirname(result.filepath), value) : value);
}
});
if (!result && !editorConfigured) {
return null;
}
return merged;
}
|
@param {{ cache: boolean, sync: boolean }} opts
|
unwrapAndMerge
|
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$1() {
mem_1.clear(getExplorerMemoized);
resolveConfigEditorconfig.clearCache();
}
|
@param {{ cache: boolean, sync: boolean }} opts
|
clearCache$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
|
async function resolveConfigFile(filePath) {
const {
search
} = getExplorer({
sync: false
});
const result = await search(filePath);
return result ? result.filepath : null;
}
|
@param {{ cache: boolean, sync: boolean }} opts
|
resolveConfigFile
|
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 mergeOverrides(configResult, filePath) {
const {
config,
filepath: configPath
} = configResult || {};
const _ref = config || {},
{
overrides
} = _ref,
options = _objectWithoutPropertiesLoose(_ref, ["overrides"]);
if (filePath && overrides) {
const relativeFilePath = path$2.relative(path$2.dirname(configPath), filePath);
for (const override of overrides) {
if (pathMatchesGlobs(relativeFilePath, override.files, override.excludeFiles)) {
Object.assign(options, override.options);
}
}
}
return options;
} // Based on eslint: https://github.com/eslint/eslint/blob/master/lib/config/config-ops.js
|
@param {{ cache: boolean, sync: boolean }} opts
|
mergeOverrides
|
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 pathMatchesGlobs(filePath, patterns, excludedPatterns) {
const patternList = [].concat(patterns);
const excludedPatternList = [].concat(excludedPatterns || []);
const opts = {
matchBase: true,
dot: true
};
return patternList.some(pattern => minimatch_1(filePath, pattern, opts)) && !excludedPatternList.some(excludedPattern => minimatch_1(filePath, excludedPattern, opts));
}
|
@param {{ cache: boolean, sync: boolean }} opts
|
pathMatchesGlobs
|
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
|
async function getFileInfo(filePath, opts) {
if (typeof filePath !== "string") {
throw new TypeError(`expect \`filePath\` to be a string, got \`${typeof filePath}\``);
}
const ignorer = await createIgnorer_1(opts.ignorePath, opts.withNodeModules);
return _getFileInfo({
ignorer,
filePath: normalizeFilePath(filePath, opts.ignorePath),
plugins: opts.plugins,
resolveConfig: opts.resolveConfig,
sync: false
});
}
|
@param {string} filePath
@param {FileInfoOptions} opts
@returns {Promise<FileInfoResult>}
Please note that prettier.getFileInfo() expects opts.plugins to be an array of paths,
not an object. A transformation from this array to an object is automatically done
internally by the method wrapper. See withPlugins() in index.js.
|
getFileInfo
|
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 _getFileInfo({
ignorer,
filePath,
plugins,
resolveConfig = false,
sync = false
}) {
const fileInfo = {
ignored: ignorer.ignores(filePath),
inferredParser: options$1.inferParser(filePath, plugins) || null
};
if (!fileInfo.inferredParser && resolveConfig) {
if (!sync) {
return resolveConfig_1.resolveConfig(filePath).then(resolvedConfig => {
if (resolvedConfig && resolvedConfig.parser) {
fileInfo.inferredParser = resolvedConfig.parser;
}
return fileInfo;
});
}
const resolvedConfig = resolveConfig_1.resolveConfig.sync(filePath);
if (resolvedConfig && resolvedConfig.parser) {
fileInfo.inferredParser = resolvedConfig.parser;
}
}
return fileInfo;
}
|
@param {string} filePath
@param {FileInfoOptions} opts
@returns {FileInfoResult}
|
_getFileInfo
|
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 normalizeFilePath(filePath, ignorePath) {
return ignorePath ? path$2.relative(path$2.dirname(ignorePath), filePath) : filePath;
}
|
@param {string} filePath
@param {FileInfoOptions} opts
@returns {FileInfoResult}
|
normalizeFilePath
|
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 listCacheClear() {
this.__data__ = [];
this.size = 0;
}
|
Removes all key-value entries from the list cache.
@private
@name clear
@memberOf ListCache
|
listCacheClear
|
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 eq(value, other) {
return value === other || value !== value && other !== other;
}
|
Performs a
[`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
comparison between two values to determine if they are equivalent.
@static
@memberOf _
@since 4.0.0
@category Lang
@param {*} value The value to compare.
@param {*} other The other value to compare.
@returns {boolean} Returns `true` if the values are equivalent, else `false`.
@example
var object = { 'a': 1 };
var other = { 'a': 1 };
_.eq(object, object);
// => true
_.eq(object, other);
// => false
_.eq('a', 'a');
// => true
_.eq('a', Object('a'));
// => false
_.eq(NaN, NaN);
// => true
|
eq
|
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 assocIndexOf(array, key) {
var length = array.length;
while (length--) {
if (eq_1(array[length][0], key)) {
return length;
}
}
return -1;
}
|
Gets the index at which the `key` is found in `array` of key-value pairs.
@private
@param {Array} array The array to inspect.
@param {*} key The key to search for.
@returns {number} Returns the index of the matched value, else `-1`.
|
assocIndexOf
|
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 listCacheDelete(key) {
var data = this.__data__,
index = _assocIndexOf(data, key);
if (index < 0) {
return false;
}
var lastIndex = data.length - 1;
if (index == lastIndex) {
data.pop();
} else {
splice.call(data, index, 1);
}
--this.size;
return true;
}
|
Removes `key` and its value from the list cache.
@private
@name delete
@memberOf ListCache
@param {string} key The key of the value to remove.
@returns {boolean} Returns `true` if the entry was removed, else `false`.
|
listCacheDelete
|
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 listCacheGet(key) {
var data = this.__data__,
index = _assocIndexOf(data, key);
return index < 0 ? undefined : data[index][1];
}
|
Gets the list cache value for `key`.
@private
@name get
@memberOf ListCache
@param {string} key The key of the value to get.
@returns {*} Returns the entry value.
|
listCacheGet
|
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 listCacheHas(key) {
return _assocIndexOf(this.__data__, key) > -1;
}
|
Checks if a list cache value for `key` exists.
@private
@name has
@memberOf ListCache
@param {string} key The key of the entry to check.
@returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
listCacheHas
|
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 listCacheSet(key, value) {
var data = this.__data__,
index = _assocIndexOf(data, key);
if (index < 0) {
++this.size;
data.push([key, value]);
} else {
data[index][1] = value;
}
return this;
}
|
Sets the list cache `key` to `value`.
@private
@name set
@memberOf ListCache
@param {string} key The key of the value to set.
@param {*} value The value to set.
@returns {Object} Returns the list cache instance.
|
listCacheSet
|
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 ListCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
} // Add methods to `ListCache`.
|
Creates an list cache object.
@private
@constructor
@param {Array} [entries] The key-value pairs to cache.
|
ListCache
|
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 stackClear() {
this.__data__ = new _ListCache();
this.size = 0;
}
|
Removes all key-value entries from the stack.
@private
@name clear
@memberOf Stack
|
stackClear
|
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 stackDelete(key) {
var data = this.__data__,
result = data['delete'](key);
this.size = data.size;
return result;
}
|
Removes `key` and its value from the stack.
@private
@name delete
@memberOf Stack
@param {string} key The key of the value to remove.
@returns {boolean} Returns `true` if the entry was removed, else `false`.
|
stackDelete
|
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 stackGet(key) {
return this.__data__.get(key);
}
|
Gets the stack value for `key`.
@private
@name get
@memberOf Stack
@param {string} key The key of the value to get.
@returns {*} Returns the entry value.
|
stackGet
|
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 stackHas(key) {
return this.__data__.has(key);
}
|
Checks if a stack value for `key` exists.
@private
@name has
@memberOf Stack
@param {string} key The key of the entry to check.
@returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
stackHas
|
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 getRawTag(value) {
var isOwn = hasOwnProperty$2.call(value, symToStringTag),
tag = value[symToStringTag];
try {
value[symToStringTag] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
|
A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
@private
@param {*} value The value to query.
@returns {string} Returns the raw `toStringTag`.
|
getRawTag
|
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 objectToString(value) {
return nativeObjectToString$1.call(value);
}
|
Converts `value` to a string using `Object.prototype.toString`.
@private
@param {*} value The value to convert.
@returns {string} Returns the converted string.
|
objectToString
|
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 baseGetTag(value) {
if (value == null) {
return value === undefined ? undefinedTag : nullTag;
}
return symToStringTag$1 && symToStringTag$1 in Object(value) ? _getRawTag(value) : _objectToString(value);
}
|
The base implementation of `getTag` without fallbacks for buggy environments.
@private
@param {*} value The value to query.
@returns {string} Returns the `toStringTag`.
|
baseGetTag
|
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 isObject(value) {
var type = typeof value;
return value != null && (type == 'object' || type == 'function');
}
|
Checks if `value` is the
[language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
@static
@memberOf _
@since 0.1.0
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is an object, else `false`.
@example
_.isObject({});
// => true
_.isObject([1, 2, 3]);
// => true
_.isObject(_.noop);
// => true
_.isObject(null);
// => false
|
isObject
|
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 isFunction(value) {
if (!isObject_1(value)) {
return false;
} // The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 9 which returns 'object' for typed arrays and other constructors.
var tag = _baseGetTag(value);
return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
}
|
Checks if `value` is classified as a `Function` object.
@static
@memberOf _
@since 0.1.0
@category Lang
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is a function, else `false`.
@example
_.isFunction(_);
// => true
_.isFunction(/abc/);
// => false
|
isFunction
|
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 isMasked(func) {
return !!maskSrcKey && maskSrcKey in func;
}
|
Checks if `func` has its source masked.
@private
@param {Function} func The function to check.
@returns {boolean} Returns `true` if `func` is masked, else `false`.
|
isMasked
|
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 toSource(func) {
if (func != null) {
try {
return funcToString.call(func);
} catch (e) {}
try {
return func + '';
} catch (e) {}
}
return '';
}
|
Converts `func` to its source code.
@private
@param {Function} func The function to convert.
@returns {string} Returns the source code.
|
toSource
|
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 baseIsNative(value) {
if (!isObject_1(value) || _isMasked(value)) {
return false;
}
var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
return pattern.test(_toSource(value));
}
|
The base implementation of `_.isNative` without bad shim checks.
@private
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is a native function,
else `false`.
|
baseIsNative
|
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 getValue(object, key) {
return object == null ? undefined : object[key];
}
|
Gets the value at `key` of `object`.
@private
@param {Object} [object] The object to query.
@param {string} key The key of the property to get.
@returns {*} Returns the property value.
|
getValue
|
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 getNative(object, key) {
var value = _getValue(object, key);
return _baseIsNative(value) ? value : undefined;
}
|
Gets the native function at `key` of `object`.
@private
@param {Object} object The object to query.
@param {string} key The key of the method to get.
@returns {*} Returns the function if it's native, else `undefined`.
|
getNative
|
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 hashClear() {
this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
this.size = 0;
}
|
Removes all key-value entries from the hash.
@private
@name clear
@memberOf Hash
|
hashClear
|
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 hashDelete(key) {
var result = this.has(key) && delete this.__data__[key];
this.size -= result ? 1 : 0;
return result;
}
|
Removes `key` and its value from the hash.
@private
@name delete
@memberOf Hash
@param {Object} hash The hash to modify.
@param {string} key The key of the value to remove.
@returns {boolean} Returns `true` if the entry was removed, else `false`.
|
hashDelete
|
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 hashGet(key) {
var data = this.__data__;
if (_nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty$4.call(data, key) ? data[key] : undefined;
}
|
Gets the hash value for `key`.
@private
@name get
@memberOf Hash
@param {string} key The key of the value to get.
@returns {*} Returns the entry value.
|
hashGet
|
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 hashHas(key) {
var data = this.__data__;
return _nativeCreate ? data[key] !== undefined : hasOwnProperty$5.call(data, key);
}
|
Checks if a hash value for `key` exists.
@private
@name has
@memberOf Hash
@param {string} key The key of the entry to check.
@returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
hashHas
|
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 hashSet(key, value) {
var data = this.__data__;
this.size += this.has(key) ? 0 : 1;
data[key] = _nativeCreate && value === undefined ? HASH_UNDEFINED$1 : value;
return this;
}
|
Sets the hash `key` to `value`.
@private
@name set
@memberOf Hash
@param {string} key The key of the value to set.
@param {*} value The value to set.
@returns {Object} Returns the hash instance.
|
hashSet
|
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 Hash(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
} // Add methods to `Hash`.
|
Creates a hash object.
@private
@constructor
@param {Array} [entries] The key-value pairs to cache.
|
Hash
|
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 mapCacheClear() {
this.size = 0;
this.__data__ = {
'hash': new _Hash(),
'map': new (_Map || _ListCache)(),
'string': new _Hash()
};
}
|
Removes all key-value entries from the map.
@private
@name clear
@memberOf MapCache
|
mapCacheClear
|
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 isKeyable(value) {
var type = typeof value;
return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null;
}
|
Checks if `value` is suitable for use as unique object key.
@private
@param {*} value The value to check.
@returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
isKeyable
|
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 getMapData(map, key) {
var data = map.__data__;
return _isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map;
}
|
Gets the data for `map`.
@private
@param {Object} map The map to query.
@param {string} key The reference key.
@returns {*} Returns the map data.
|
getMapData
|
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 mapCacheDelete(key) {
var result = _getMapData(this, key)['delete'](key);
this.size -= result ? 1 : 0;
return result;
}
|
Removes `key` and its value from the map.
@private
@name delete
@memberOf MapCache
@param {string} key The key of the value to remove.
@returns {boolean} Returns `true` if the entry was removed, else `false`.
|
mapCacheDelete
|
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 mapCacheGet(key) {
return _getMapData(this, key).get(key);
}
|
Gets the map value for `key`.
@private
@name get
@memberOf MapCache
@param {string} key The key of the value to get.
@returns {*} Returns the entry value.
|
mapCacheGet
|
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 mapCacheHas(key) {
return _getMapData(this, key).has(key);
}
|
Checks if a map value for `key` exists.
@private
@name has
@memberOf MapCache
@param {string} key The key of the entry to check.
@returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
mapCacheHas
|
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 mapCacheSet(key, value) {
var data = _getMapData(this, key),
size = data.size;
data.set(key, value);
this.size += data.size == size ? 0 : 1;
return this;
}
|
Sets the map `key` to `value`.
@private
@name set
@memberOf MapCache
@param {string} key The key of the value to set.
@param {*} value The value to set.
@returns {Object} Returns the map cache instance.
|
mapCacheSet
|
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 MapCache(entries) {
var index = -1,
length = entries == null ? 0 : entries.length;
this.clear();
while (++index < length) {
var entry = entries[index];
this.set(entry[0], entry[1]);
}
} // Add methods to `MapCache`.
|
Creates a map cache object to store key-value pairs.
@private
@constructor
@param {Array} [entries] The key-value pairs to cache.
|
MapCache
|
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 stackSet(key, value) {
var data = this.__data__;
if (data instanceof _ListCache) {
var pairs = data.__data__;
if (!_Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
pairs.push([key, value]);
this.size = ++data.size;
return this;
}
data = this.__data__ = new _MapCache(pairs);
}
data.set(key, value);
this.size = data.size;
return this;
}
|
Sets the stack `key` to `value`.
@private
@name set
@memberOf Stack
@param {string} key The key of the value to set.
@param {*} value The value to set.
@returns {Object} Returns the stack cache instance.
|
stackSet
|
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 Stack(entries) {
var data = this.__data__ = new _ListCache(entries);
this.size = data.size;
} // Add methods to `Stack`.
|
Creates a stack cache object to store key-value pairs.
@private
@constructor
@param {Array} [entries] The key-value pairs to cache.
|
Stack
|
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 setCacheAdd(value) {
this.__data__.set(value, HASH_UNDEFINED$2);
return this;
}
|
Adds `value` to the array cache.
@private
@name add
@memberOf SetCache
@alias push
@param {*} value The value to cache.
@returns {Object} Returns the cache instance.
|
setCacheAdd
|
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.