code stringlengths 24 2.07M | docstring stringlengths 25 85.3k | func_name stringlengths 1 92 | language stringclasses 1
value | repo stringlengths 5 64 | path stringlengths 4 172 | url stringlengths 44 218 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
function splitTextIntoSentences(ast, options) {
return mapAst$1(ast, (node, index, [parentNode]) => {
if (node.type !== "text") {
return node;
}
let {
value
} = node;
if (parentNode.type === "paragraph") {
if (index === 0) {
value = value.trimStart()... | split text into whitespaces and words
@param {string} text
@return {Array<{ type: "whitespace", value: " " | "\n" | "" } | { type: "word", value: string }>} | splitTextIntoSentences | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function transformIndentedCodeblockAndMarkItsParentList(ast, options) {
return mapAst$1(ast, (node, index, parentStack) => {
if (node.type === "code") {
// the first char may point to `\n`, e.g. `\n\t\tbar`, just ignore it
const isIndented = /^\n?( {4,}|\t)/.test(options.originalText.slice(nod... | split text into whitespaces and words
@param {string} text
@return {Array<{ type: "whitespace", value: " " | "\n" | "" } | { type: "word", value: string }>} | transformIndentedCodeblockAndMarkItsParentList | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function markAlignedList(ast, options) {
return mapAst$1(ast, (node, index, parentStack) => {
if (node.type === "list" && node.children.length !== 0) {
// if one of its parents is not aligned, it's not possible to be aligned in sub-lists
for (let i = 0; i < parentStack.length; i++) {
... | split text into whitespaces and words
@param {string} text
@return {Array<{ type: "whitespace", value: " " | "\n" | "" } | { type: "word", value: string }>} | markAlignedList | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function getListItemStart(listItem) {
return listItem.children.length === 0 ? -1 : listItem.children[0].position.start.column - 1;
} | split text into whitespaces and words
@param {string} text
@return {Array<{ type: "whitespace", value: " " | "\n" | "" } | { type: "word", value: string }>} | getListItemStart | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function isAligned(list) {
if (!list.ordered) {
/**
* - 123
* - 123
*/
return true;
}
const [firstItem, secondItem] = list.children;
const firstInfo = getOrderedListItemInfo$1(firstItem, options.originalText);
if (firstInfo.leadingSpaces.length ... | split text into whitespaces and words
@param {string} text
@return {Array<{ type: "whitespace", value: " " | "\n" | "" } | { type: "word", value: string }>} | isAligned | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function isNode(value, types) {
return value && typeof value.type === "string" && (!types || types.includes(value.type));
} | @param {any} value
@param {string[]=} types | isNode | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function mapNode(node, callback, parent) {
return callback("children" in node ? Object.assign(Object.assign({}, node), {}, {
children: node.children.map(childNode => mapNode(childNode, callback, node))
}) : node, parent);
} | @param {any} value
@param {string[]=} types | mapNode | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function defineShortcut(x, key, getter) {
Object.defineProperty(x, key, {
get: getter,
enumerable: false
});
} | @param {any} value
@param {string[]=} types | defineShortcut | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function isNextLineEmpty$7(node, text) {
let newlineCount = 0;
const textLength = text.length;
for (let i = node.position.end.offset - 1; i < textLength; i++) {
const char = text[i];
if (char === "\n") {
newlineCount++;
}
if (newlineCount === 1 && /\S/.test(char)) {
... | @param {any} value
@param {string[]=} types | isNextLineEmpty$7 | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function isLastDescendantNode(path) {
const node = path.getValue();
switch (node.type) {
case "tag":
case "anchor":
case "comment":
return false;
}
const pathStackLength = path.stack.length;
for (let i = 1; i < pathStackLength; i++) {
const item = path.stack[i];
... | @param {any} value
@param {string[]=} types | isLastDescendantNode | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function getLastDescendantNode$1(node) {
return "children" in node && node.children.length !== 0 ? getLastDescendantNode$1(getLast$7(node.children)) : node;
} | @param {any} value
@param {string[]=} types | getLastDescendantNode$1 | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function isPrettierIgnore$2(comment) {
return comment.value.trim() === "prettier-ignore";
} | @param {any} value
@param {string[]=} types | isPrettierIgnore$2 | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function hasPrettierIgnore$7(path) {
const node = path.getValue();
if (node.type === "documentBody") {
const document = path.getParentNode();
return hasEndComments(document.head) && isPrettierIgnore$2(getLast$7(document.head.endComments));
}
return hasLeadingComments(node) && isPrettierIgn... | @param {any} value
@param {string[]=} types | hasPrettierIgnore$7 | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function isEmptyNode(node) {
return (!node.children || node.children.length === 0) && !hasComments(node);
} | @param {any} value
@param {string[]=} types | isEmptyNode | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function hasComments(node) {
return hasLeadingComments(node) || hasMiddleComments(node) || hasIndicatorComment(node) || hasTrailingComment$4(node) || hasEndComments(node);
} | @param {any} value
@param {string[]=} types | hasComments | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function hasLeadingComments(node) {
return node && node.leadingComments && node.leadingComments.length !== 0;
} | @param {any} value
@param {string[]=} types | hasLeadingComments | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function hasMiddleComments(node) {
return node && node.middleComments && node.middleComments.length !== 0;
} | @param {any} value
@param {string[]=} types | hasMiddleComments | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function hasIndicatorComment(node) {
return node && node.indicatorComment;
} | @param {any} value
@param {string[]=} types | hasIndicatorComment | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function hasTrailingComment$4(node) {
return node && node.trailingComment;
} | @param {any} value
@param {string[]=} types | hasTrailingComment$4 | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function hasEndComments(node) {
return node && node.endComments && node.endComments.length !== 0;
} | @param {any} value
@param {string[]=} types | hasEndComments | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/standalone.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/standalone.js | Apache-2.0 |
function comparativeDistance(x, y) {
return Math.pow(x[0] - y[0], 2) + Math.pow(x[1] - y[1], 2) + Math.pow(x[2] - y[2], 2);
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | comparativeDistance | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function buildGraph() {
var graph = {}; // https://jsperf.com/object-keys-vs-for-in-with-closure/3
var models = Object.keys(conversions);
for (var len = models.length, i = 0; i < len; i++) {
graph[models[i]] = {
// http://jsperf.com/1-vs-infinity
// micro-opt, but this is simple.
distance:... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | buildGraph | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function deriveBFS(fromModel) {
var graph = buildGraph();
var queue = [fromModel]; // unshift -> queue -> pop
graph[fromModel].distance = 0;
while (queue.length) {
var current = queue.pop();
var adjacents = Object.keys(conversions[current]);
for (var len = adjacents.length, i = 0; i < len; i++) {... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | deriveBFS | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function link(from, to) {
return function (args) {
return to(from(args));
};
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | link | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function wrapConversion(toModel, graph) {
var path = [graph[toModel].parent, toModel];
var fn = conversions[graph[toModel].parent][toModel];
var cur = graph[toModel].parent;
while (graph[cur].parent) {
path.unshift(graph[cur].parent);
fn = link(conversions[graph[cur].parent][cur], fn);
cur = graph[... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | wrapConversion | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
route = function (fromModel) {
var graph = deriveBFS(fromModel);
var conversion = {};
var models = Object.keys(graph);
for (var len = models.length, i = 0; i < len; i++) {
var toModel = models[i];
var node = graph[toModel];
if (node.parent === null) {
// no possible conversion, or this node ... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | route | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function wrapRaw(fn) {
var wrappedFn = function (args) {
if (args === undefined || args === null) {
return args;
}
if (arguments.length > 1) {
args = Array.prototype.slice.call(arguments);
}
return fn(args);
}; // preserve .conversion property if there is one
if ('conversion' i... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | wrapRaw | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
wrappedFn = function (args) {
if (args === undefined || args === null) {
return args;
}
if (arguments.length > 1) {
args = Array.prototype.slice.call(arguments);
}
return fn(args);
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | wrappedFn | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function wrapRounded(fn) {
var wrappedFn = function (args) {
if (args === undefined || args === null) {
return args;
}
if (arguments.length > 1) {
args = Array.prototype.slice.call(arguments);
}
var result = fn(args); // we're assuming the result is an array here.
// see notice i... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | wrapRounded | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
wrappedFn = function (args) {
if (args === undefined || args === null) {
return args;
}
if (arguments.length > 1) {
args = Array.prototype.slice.call(arguments);
}
var result = fn(args); // we're assuming the result is an array here.
// see notice in conversions.js; don't use box t... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | wrappedFn | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
wrapAnsi16 = (fn, offset) => function () {
const code = fn.apply(colorConvert, arguments);
return `\u001B[${code + offset}m`;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | wrapAnsi16 | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
wrapAnsi16 = (fn, offset) => function () {
const code = fn.apply(colorConvert, arguments);
return `\u001B[${code + offset}m`;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | wrapAnsi16 | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
wrapAnsi256 = (fn, offset) => function () {
const code = fn.apply(colorConvert, arguments);
return `\u001B[${38 + offset};5;${code}m`;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | wrapAnsi256 | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
wrapAnsi256 = (fn, offset) => function () {
const code = fn.apply(colorConvert, arguments);
return `\u001B[${38 + offset};5;${code}m`;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | wrapAnsi256 | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
wrapAnsi16m = (fn, offset) => function () {
const rgb = fn.apply(colorConvert, arguments);
return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | wrapAnsi16m | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
wrapAnsi16m = (fn, offset) => function () {
const rgb = fn.apply(colorConvert, arguments);
return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | wrapAnsi16m | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function assembleStyles() {
const codes = new Map();
const styles = {
modifier: {
reset: [0, 0],
// 21 isn't widely supported and 22 does the same thing
bold: [1, 22],
dim: [2, 22],
italic: [3, 23],
underline: [4, 24],
inverse: [7, 27],
hidde... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | assembleStyles | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
hasFlag = (flag, argv) => {
argv = argv || process.argv;
const prefix = flag.startsWith('-') ? '' : flag.length === 1 ? '-' : '--';
const pos = argv.indexOf(prefix + flag);
const terminatorPos = argv.indexOf('--');
return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | hasFlag | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function translateLevel(level) {
if (level === 0) {
return false;
}
return {
level,
hasBasic: true,
has256: level >= 2,
has16m: level >= 3
};
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | translateLevel | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function supportsColor(stream) {
if (forceColor === false) {
return 0;
}
if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) {
return 3;
}
if (hasFlag('color=256')) {
return 2;
}
if (stream && !stream.isTTY && forceColor !== true) {
return 0;
}
const mi... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | supportsColor | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function getSupportLevel(stream) {
const level = supportsColor(stream);
return translateLevel(level);
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | getSupportLevel | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function unescape(c) {
if (c[0] === 'u' && c.length === 5 || c[0] === 'x' && c.length === 3) {
return String.fromCharCode(parseInt(c.slice(1), 16));
}
return ESCAPES.get(c) || c;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | unescape | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function parseArguments(name, args) {
const results = [];
const chunks = args.trim().split(/\s*,\s*/g);
let matches;
for (const chunk of chunks) {
if (!isNaN(chunk)) {
results.push(Number(chunk));
} else if (matches = chunk.match(STRING_REGEX)) {
results.push(matches[2].replace(ESCAPE_REGEX... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | parseArguments | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function parseStyle(style) {
STYLE_REGEX.lastIndex = 0;
const results = [];
let matches;
while ((matches = STYLE_REGEX.exec(style)) !== null) {
const name = matches[1];
if (matches[2]) {
const args = parseArguments(name, matches[2]);
results.push([name].concat(args));
} else {
re... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | parseStyle | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function buildStyle(chalk, styles) {
const enabled = {};
for (const layer of styles) {
for (const style of layer.styles) {
enabled[style[0]] = layer.inverse ? null : style.slice(1);
}
}
let current = chalk;
for (const styleName of Object.keys(enabled)) {
if (Array.isArray(enabled[styleNam... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | buildStyle | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
templates = (chalk, tmp) => {
const styles = [];
const chunks = [];
let chunk = []; // eslint-disable-next-line max-params
tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {
if (escapeChar) {
chunk.push(unescape(escapeChar));
} else if (style) {
const str = chunk.j... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | templates | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function applyOptions(obj, options) {
options = options || {}; // Detect level if not set manually
const scLevel = stdoutColor ? stdoutColor.level : 0;
obj.level = options.level === undefined ? scLevel : options.level;
obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | applyOptions | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function Chalk(options) {
// We check for this.template here since calling `chalk.constructor()`
// by itself will have a `this` of a previously constructed chalk object
if (!this || !(this instanceof Chalk) || this.template) {
const chalk = {};
applyOptions(chalk, options);
chalk.templat... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | Chalk | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
get() {
const codes = ansiStyles[key];
return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | get | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
get() {
return build.call(this, this._styles || [], true, 'visible');
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | get | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
get() {
const level = this.level;
return function () {
const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
const codes = {
open,
close: ansiStyles.color.close,
closeRe: ansiStyles.color.closeRe
};
r... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | get | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
get() {
const level = this.level;
return function () {
const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
const codes = {
open,
close: ansiStyles.bgColor.close,
closeRe: ansiStyles.bgColor.closeRe
};
... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | get | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function build(_styles, _empty, key) {
const builder = function () {
return applyStyle.apply(builder, arguments);
};
builder._styles = _styles;
builder._empty = _empty;
const self = this;
Object.defineProperty(builder, 'level', {
enumerable: true,
get() {
return self.... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | build | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
builder = function () {
return applyStyle.apply(builder, arguments);
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | builder | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
builder = function () {
return applyStyle.apply(builder, arguments);
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | builder | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
get() {
return self.level;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | get | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
set(level) {
self.level = level;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | set | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
get() {
return self.enabled;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | get | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
set(enabled) {
self.enabled = enabled;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | set | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function applyStyle() {
// Support varags, but simply cast to string in case there's only one arg
const args = arguments;
const argsLen = args.length;
let str = String(arguments[0]);
if (argsLen === 0) {
return '';
}
if (argsLen > 1) {
// Don't slice `arguments`, it prevents V8... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | applyStyle | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function chalkTag(chalk, strings) {
if (!Array.isArray(strings)) {
// If chalk() was called by itself or with a string,
// return the string itself as a string.
return [].slice.call(arguments, 1).join(' ');
}
const args = [].slice.call(arguments, 2);
const parts = [strings.raw[0]];
... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | chalkTag | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | _interopRequireDefault | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function _getRequireWildcardCache() {
if (typeof WeakMap !== "function") return null;
var cache = new WeakMap();
_getRequireWildcardCache = function () {
return cache;
};
return cache;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | _getRequireWildcardCache | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
}
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
return {
default: obj
};
}
var cache = _getRequireWildcardCache();
if (cache && cache.has(obj)) {
retu... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | _interopRequireWildcard | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function getDefs(chalk) {
return {
keyword: chalk.cyan,
capitalized: chalk.yellow,
jsx_tag: chalk.yellow,
punctuator: chalk.yellow,
number: chalk.magenta,
string: chalk.green,
regex: chalk.magenta,
comment: chalk.grey,
invalid: chalk.white.bgRed.bold
};
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | getDefs | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function getTokenType(match) {
const [offset, text] = match.slice(-2);
const token = (0, _jsTokens.matchToToken)(match);
if (token.type === "name") {
if (_esutils.default.keyword.isReservedWordES6(token.value)) {
return "keyword";
}
if (JSX_TAG.test(token.value) && (text[offset -... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | getTokenType | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function highlightTokens(defs, text) {
return text.replace(_jsTokens.default, function (...args) {
const type = getTokenType(args);
const colorize = defs[type];
if (colorize) {
return args[0].split(NEWLINE).map(str => colorize(str)).join("\n");
} else {
return args[0];
... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | highlightTokens | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function shouldHighlight(options) {
return _chalk.default.supportsColor || options.forceColor;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | shouldHighlight | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function getChalk(options) {
let chalk = _chalk.default;
if (options.forceColor) {
chalk = new _chalk.default.constructor({
enabled: true,
level: 1
});
}
return chalk;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | getChalk | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function highlight(code, options = {}) {
if (shouldHighlight(options)) {
const chalk = getChalk(options);
const defs = getDefs(chalk);
return highlightTokens(defs, code);
} else {
return code;
}
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | highlight | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function _getRequireWildcardCache() {
if (typeof WeakMap !== "function") return null;
var cache = new WeakMap();
_getRequireWildcardCache = function () {
return cache;
};
return cache;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | _getRequireWildcardCache | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
}
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
return {
default: obj
};
}
var cache = _getRequireWildcardCache();
if (cache && cache.has(obj)) {
retu... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | _interopRequireWildcard | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function getDefs(chalk) {
return {
gutter: chalk.grey,
marker: chalk.red.bold,
message: chalk.red.bold
};
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | getDefs | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function getMarkerLines(loc, source, opts) {
const startLoc = Object.assign({
column: 0,
line: -1
}, loc.start);
const endLoc = Object.assign({}, startLoc, {}, loc.end);
const {
linesAbove = 2,
linesBelow = 3
} = opts || {};
const startLine = startLoc.line;
const star... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | getMarkerLines | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function codeFrameColumns(rawLines, loc, opts = {}) {
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
const chalk = (0, _highlight.getChalk)(opts);
const defs = getDefs(chalk);
const maybeHighlight = (chalkFn, string) => {
return highlighted ?... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | codeFrameColumns | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
maybeHighlight = (chalkFn, string) => {
return highlighted ? chalkFn(string) : string;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | maybeHighlight | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
maybeHighlight = (chalkFn, string) => {
return highlighted ? chalkFn(string) : string;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | maybeHighlight | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function _default(rawLines, lineNumber, colNumber, opts = {}) {
if (!deprecationWarningShown) {
deprecationWarningShown = true;
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
if (process.emitWarning) {
process.emitWar... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | _default | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
parseJson$1 = (string, reviver, filename) => {
if (typeof reviver === 'string') {
filename = reviver;
reviver = null;
}
try {
try {
return JSON.parse(string, reviver);
} catch (error) {
jsonParseBetterErrors(string, reviver);
throw error;
}
} catch (error) {
error.mess... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | parseJson$1 | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function findLineStarts(src) {
const ls = [0];
let offset = src.indexOf('\n');
while (offset !== -1) {
offset += 1;
ls.push(offset);
offset = src.indexOf('\n', offset);
}
return ls;
} | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | findLineStarts | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function getSrcInfo(cst) {
let lineStarts, src;
if (typeof cst === 'string') {
lineStarts = findLineStarts(cst);
src = cst;
} else {
if (Array.isArray(cst)) cst = cst[0];
if (cst && cst.context) {
if (!cst.lineStarts) cst.lineStarts = findLineStarts(cst.context.src);
... | See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance | getSrcInfo | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function getLinePos(offset, cst) {
if (typeof offset !== 'number' || offset < 0) return null;
const {
lineStarts,
src
} = getSrcInfo(cst);
if (!lineStarts || !src || offset > src.length) return null;
for (let i = 0; i < lineStarts.length; ++i) {
const start = lineStarts[i];
... | Determine the line/col position matching a character offset.
Accepts a source string or a CST document as the second parameter. With
the latter, starting indices for lines are cached in the document as
`lineStarts: number[]`.
Returns a one-indexed `{ line, col }` location if found, or
`undefined` otherwise.
@param {... | getLinePos | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function getLine(line, cst) {
const {
lineStarts,
src
} = getSrcInfo(cst);
if (!lineStarts || !(line >= 1) || line > lineStarts.length) return null;
const start = lineStarts[line - 1];
let end = lineStarts[line]; // undefined for last line; that's ok for slice()
while (end && end > ... | Get a specified line from the source.
Accepts a source string or a CST document as the second parameter. With
the latter, starting indices for lines are cached in the document as
`lineStarts: number[]`.
Returns the line as a string if found, or `null` otherwise.
@param {number} line One-indexed line number
@param {s... | getLine | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
setOrigRange(cr, offset) {
const {
start,
end
} = this;
if (cr.length === 0 || end <= cr[0]) {
this.origStart = start;
this.origEnd = end;
return offset;
}
let i = offset;
while (i < cr.length) {
if (cr[i] > start) break;else ++i;
... | Set `origStart` and `origEnd` to point to the original source range for
this node, which may differ due to dropped CR characters.
@param {number[]} cr - Positions of dropped CR characters
@param {number} offset - Starting index of `cr` from the last call
@returns {number} - The next offset, matching the one found for ... | setOrigRange | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
} | Set `origStart` and `origEnd` to point to the original source range for
this node, which may differ due to dropped CR characters.
@param {number[]} cr - Positions of dropped CR characters
@param {number} offset - Starting index of `cr` from the last call
@returns {number} - The next offset, matching the one found for ... | _interopRequireDefault | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
static endOfBlockIndent(src, indent, lineStart) {
const inEnd = Node.endOfIndent(src, lineStart);
if (inEnd > lineStart + indent) {
return inEnd;
} else {
const wsEnd = Node.endOfWhiteSpace(src, inEnd);
const ch = src[wsEnd];
if (!ch || ch === '\n') return wsEnd;
... | End of indentation, or null if the line's indent level is not more
than `indent`
@param {string} src
@param {number} indent
@param {number} lineStart
@returns {?number} | endOfBlockIndent | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
static atBlank(src, offset, endAsBlank) {
const ch = src[offset];
return ch === '\n' || ch === '\t' || ch === ' ' || endAsBlank && !ch;
} | End of indentation, or null if the line's indent level is not more
than `indent`
@param {string} src
@param {number} indent
@param {number} lineStart
@returns {?number} | atBlank | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
static nextNodeIsIndented(ch, indentDiff, indicatorAsIndent) {
if (!ch || indentDiff < 0) return false;
if (indentDiff > 0) return true;
return indicatorAsIndent && ch === '-';
} | End of indentation, or null if the line's indent level is not more
than `indent`
@param {string} src
@param {number} indent
@param {number} lineStart
@returns {?number} | nextNodeIsIndented | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
static normalizeOffset(src, offset) {
const ch = src[offset];
return !ch ? offset : ch !== '\n' && src[offset - 1] === '\n' ? offset - 1 : Node.endOfWhiteSpace(src, offset);
} | End of indentation, or null if the line's indent level is not more
than `indent`
@param {string} src
@param {number} indent
@param {number} lineStart
@returns {?number} | normalizeOffset | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
static foldNewline(src, offset, indent) {
let inCount = 0;
let error = false;
let fold = '';
let ch = src[offset + 1];
while (ch === ' ' || ch === '\t' || ch === '\n') {
switch (ch) {
case '\n':
inCount = 0;
offset += 1;
fold += '\n';
... | End of indentation, or null if the line's indent level is not more
than `indent`
@param {string} src
@param {number} indent
@param {number} lineStart
@returns {?number} | foldNewline | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
constructor(type, props, context) {
Object.defineProperty(this, 'context', {
value: context || null,
writable: true
});
this.error = null;
this.range = null;
this.valueRange = null;
this.props = props || [];
this.type = type;
this.value = null;
} | End of indentation, or null if the line's indent level is not more
than `indent`
@param {string} src
@param {number} indent
@param {number} lineStart
@returns {?number} | constructor | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
getPropValue(idx, key, skipKey) {
if (!this.context) return null;
const {
src
} = this.context;
const prop = this.props[idx];
return prop && src[prop.start] === key ? src.slice(prop.start + (skipKey ? 1 : 0), prop.end) : null;
} | End of indentation, or null if the line's indent level is not more
than `indent`
@param {string} src
@param {number} indent
@param {number} lineStart
@returns {?number} | getPropValue | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
get anchor() {
for (let i = 0; i < this.props.length; ++i) {
const anchor = this.getPropValue(i, constants.Char.ANCHOR, true);
if (anchor != null) return anchor;
}
return null;
} | End of indentation, or null if the line's indent level is not more
than `indent`
@param {string} src
@param {number} indent
@param {number} lineStart
@returns {?number} | anchor | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
get comment() {
const comments = [];
for (let i = 0; i < this.props.length; ++i) {
const comment = this.getPropValue(i, constants.Char.COMMENT, true);
if (comment != null) comments.push(comment);
}
return comments.length > 0 ? comments.join('\n') : null;
} | End of indentation, or null if the line's indent level is not more
than `indent`
@param {string} src
@param {number} indent
@param {number} lineStart
@returns {?number} | comment | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
commentHasRequiredWhitespace(start) {
const {
src
} = this.context;
if (this.header && start === this.header.end) return false;
if (!this.valueRange) return false;
const {
end
} = this.valueRange;
return start !== end || Node.atBlank(src, end - 1);
} | End of indentation, or null if the line's indent level is not more
than `indent`
@param {string} src
@param {number} indent
@param {number} lineStart
@returns {?number} | commentHasRequiredWhitespace | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
get hasComment() {
if (this.context) {
const {
src
} = this.context;
for (let i = 0; i < this.props.length; ++i) {
if (src[this.props[i].start] === constants.Char.COMMENT) return true;
}
}
return false;
} | End of indentation, or null if the line's indent level is not more
than `indent`
@param {string} src
@param {number} indent
@param {number} lineStart
@returns {?number} | hasComment | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
get hasProps() {
if (this.context) {
const {
src
} = this.context;
for (let i = 0; i < this.props.length; ++i) {
if (src[this.props[i].start] !== constants.Char.COMMENT) return true;
}
}
return false;
} | End of indentation, or null if the line's indent level is not more
than `indent`
@param {string} src
@param {number} indent
@param {number} lineStart
@returns {?number} | hasProps | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
get includesTrailingLines() {
return false;
} | End of indentation, or null if the line's indent level is not more
than `indent`
@param {string} src
@param {number} indent
@param {number} lineStart
@returns {?number} | includesTrailingLines | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
get jsonLike() {
const jsonLikeTypes = [constants.Type.FLOW_MAP, constants.Type.FLOW_SEQ, constants.Type.QUOTE_DOUBLE, constants.Type.QUOTE_SINGLE];
return jsonLikeTypes.indexOf(this.type) !== -1;
} | End of indentation, or null if the line's indent level is not more
than `indent`
@param {string} src
@param {number} indent
@param {number} lineStart
@returns {?number} | jsonLike | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
get rangeAsLinePos() {
if (!this.range || !this.context) return undefined;
const start = (0, sourceUtils.getLinePos)(this.range.start, this.context.root);
if (!start) return undefined;
const end = (0, sourceUtils.getLinePos)(this.range.end, this.context.root);
return {
start,
... | End of indentation, or null if the line's indent level is not more
than `indent`
@param {string} src
@param {number} indent
@param {number} lineStart
@returns {?number} | rangeAsLinePos | javascript | douyu/juno | assets/public/js/prettier/v2.0.5/third-party.js | https://github.com/douyu/juno/blob/master/assets/public/js/prettier/v2.0.5/third-party.js | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.