This commit is contained in:
Christopher Chedeau committed 2017-06-02 08:55:04 -07:00
1 parent 83c5253429
commit 7fd71fa386
6 files changed
+359 -254

No files matched your search

+6
View File
@@ -1,3 +1,9 @@
# 1.4.0
[link](https://github.com/jlongster/prettier/compare/1.3.1...1.4.0)
* [Release Notes](https://github.com/prettier/prettier/releases/tag/1.4.0)
# 1.3.1
* Respect template inline-ness (#1497)
+349 -250
View File
@@ -89,6 +89,7 @@ const literalline = concat$1([
{ type: "line", hard: true, literal: true },
breakParent$1
]);
const cursor$1 = { type: "cursor", placeholder: Symbol() };
function join$1(sep, arr) {
const res = [];
@@ -132,6 +133,7 @@ var docBuilders$1 = {
fill,
lineSuffix: lineSuffix$1,
lineSuffixBoundary,
cursor: cursor$1,
breakParent: breakParent$1,
ifBreak,
indent: indent$1,
@@ -536,6 +538,7 @@ const breakParent = docBuilders.breakParent;
const indent = docBuilders.indent;
const lineSuffix = docBuilders.lineSuffix;
const join = docBuilders.join;
const cursor = docBuilders.cursor;
const util$1 = util$2;
const childNodesCacheKey = Symbol("child-nodes");
const locStart = util$1.locStart;
@@ -1452,13 +1455,20 @@ function printDanglingComments(path, options, sameIndent) {
return indent(concat([hardline, join(hardline, parts)]));
}
function prependCursorPlaceholder(path, options, printed) {
if (path.getNode() === options.cursorNode) {
return concat([cursor, printed]);
}
return printed;
}
function printComments(path, print, options, needsSemi) {
const value = path.getValue();
const printed = print(path);
const comments = value && value.comments;
if (!comments || comments.length === 0) {
return printed;
return prependCursorPlaceholder(path, options, printed);
}
const leadingParts = [];
@@ -1485,7 +1495,11 @@ function printComments(path, print, options, needsSemi) {
}
}, "comments");
return concat(leadingParts.concat(trailingParts));
return prependCursorPlaceholder(
path,
options,
concat(leadingParts.concat(trailingParts))
);
}
var comments$1 = {
@@ -1496,15 +1510,15 @@ var comments$1 = {
};
var name = "prettier";
var version$1 = "1.4.0-beta";
var version$1 = "1.4.0";
var description = "Prettier is an opinionated JavaScript formatter";
var bin = {"prettier":"./bin/prettier.js"};
var repository = "prettier/prettier";
var author = "James Long";
var license = "MIT";
var main = "./index.js";
var dependencies = {"babel-code-frame":"6.22.0","babylon":"7.0.0-beta.10","chalk":"1.1.3","esutils":"2.0.2","flow-parser":"0.47.0","get-stdin":"5.0.1","glob":"7.1.1","jest-validate":"20.0.0","minimist":"1.2.0"};
var devDependencies = {"cross-spawn":"^5.1.0","diff":"3.2.0","eslint":"^3.19.0","eslint-plugin-prettier":"^2.1.1","jest":"20.0.0","mkdirp":"^0.5.1","postcss":"^6.0.1","postcss-less":"^1.0.0","postcss-media-query-parser":"^0.2.3","postcss-scss":"1.0.0","postcss-selector-parser":"^2.2.3","postcss-values-parser":"git://github.com/shellscape/postcss-values-parser.git#5e351360479116f3fe309602cdd15b0a233bc29f","prettier":"^1.3.1","rimraf":"^2.6.1","rollup":"0.41.1","rollup-plugin-commonjs":"7.0.0","rollup-plugin-json":"2.1.0","rollup-plugin-node-builtins":"2.0.0","rollup-plugin-node-globals":"1.1.0","rollup-plugin-node-resolve":"2.0.0","rollup-plugin-replace":"1.1.1","typescript":"2.3.2","typescript-eslint-parser":"git://github.com/eslint/typescript-eslint-parser.git#3dcba7d53f61f51069ed84b57e053802c014d703","uglify-es":"mishoo/UglifyJS2#harmony","webpack":"^2.6.1"};
var dependencies = {};
var devDependencies = {"babel-code-frame":"6.22.0","babylon":"7.0.0-beta.10","chalk":"1.1.3","cross-spawn":"5.1.0","diff":"3.2.0","eslint":"3.19.0","eslint-plugin-prettier":"2.1.1","esutils":"2.0.2","flow-parser":"0.47.0","get-stdin":"5.0.1","glob":"7.1.2","jest":"20.0.0","jest-validate":"20.0.3","minimist":"1.2.0","mkdirp":"^0.5.1","postcss":"^6.0.1","postcss-less":"^1.0.0","postcss-media-query-parser":"0.2.3","postcss-scss":"1.0.0","postcss-selector-parser":"2.2.3","postcss-values-parser":"git://github.com/shellscape/postcss-values-parser.git#5e351360479116f3fe309602cdd15b0a233bc29f","prettier":"1.3.1","rimraf":"2.6.1","rollup":"0.41.1","rollup-plugin-commonjs":"7.0.0","rollup-plugin-json":"2.1.0","rollup-plugin-node-builtins":"2.0.0","rollup-plugin-node-globals":"1.1.0","rollup-plugin-node-resolve":"2.0.0","rollup-plugin-replace":"1.1.1","typescript":"2.3.2","typescript-eslint-parser":"git://github.com/eslint/typescript-eslint-parser.git#32634f10b8c9bc4622762867d9d00e79ea1092fe","uglify-es":"mishoo/UglifyJS2#harmony","webpack":"2.6.1"};
var scripts = {"test":"jest","test-integration":"jest tests_integration","lint":"eslint .","build":"./scripts/build/build.sh","build:docs":"rollup -c docs/rollup.config.js"};
var jest = {"setupFiles":["<rootDir>/tests_config/run_spec.js"],"snapshotSerializers":["<rootDir>/tests_config/raw-serializer.js"],"testRegex":"jsfmt\\.spec\\.js$|__tests__/.*\\.js$","testPathIgnorePatterns":["tests/new_react","tests/more_react"]};
var _package = {
@@ -2057,6 +2071,9 @@ FastPath$1.prototype.needsParens = function() {
return false;
}
case "ObjectExpression":
return parent.type === "TSAsExpression";
case "ClassExpression":
return parent.type === "ExportDefaultDeclaration";
@@ -2867,10 +2884,18 @@ function genericPrint(path, options, printPath, args) {
prefix = "";
}
// #1817
if (
node.decorators.length === 1 &&
node.type !== "ClassDeclaration" &&
node.type !== "MethodDefinition" &&
(decorator.type === "Identifier" ||
decorator.type === "MemberExpression")
decorator.type === "MemberExpression" ||
(decorator.type === "CallExpression" &&
decorator.arguments.length === 1 &&
(isStringLiteral(decorator.arguments[0]) ||
decorator.arguments[0].type === "Identifier" ||
decorator.arguments[0].type === "MemberExpression")))
) {
separator = " ";
}
@@ -3235,12 +3260,12 @@ function genericPrintNoParens(path, options, print, args) {
}
case "MethodDefinition":
case "TSAbstractMethodDefinition":
if (n.static) {
parts.push("static ");
}
if (n.accessibility) {
parts.push(n.accessibility + " ");
}
if (n.static) {
parts.push("static ");
}
if (n.type === "TSAbstractMethodDefinition") {
parts.push("abstract ");
}
@@ -4441,6 +4466,9 @@ function genericPrintNoParens(path, options, print, args) {
if (n.type === "TSAbstractClassProperty") {
parts.push("abstract ");
}
if (n.readonly) {
parts.push("readonly ");
}
if (n.computed) {
parts.push("[", path.call(print, "key"), "]");
} else {
@@ -4573,7 +4601,10 @@ function genericPrintNoParens(path, options, print, args) {
printArrayItems(path, options, typesField, print)
])
),
ifBreak$1(shouldPrintComma(options) ? "," : ""),
// TypeScript doesn't support trailing commas in tuple types
n.type === "TSTupleType"
? ""
: ifBreak$1(shouldPrintComma(options) ? "," : ""),
comments$3.printDanglingComments(path, options, /* sameIndent */ true),
softline$1,
"]"
@@ -4643,9 +4674,10 @@ function genericPrintNoParens(path, options, print, args) {
const parentParentParent = path.getParentNode(2);
let isArrowFunctionTypeAnnotation =
n.type === "TSFunctionType" ||
!((!getFlowVariance(parent) &&
!((parent.type === "ObjectTypeProperty" &&
!getFlowVariance(parent) &&
!parent.optional &&
parent.type === "ObjectTypeProperty") ||
util$4.locStart(parent) === util$4.locStart(n)) ||
parent.type === "ObjectTypeCallProperty" ||
(parentParentParent &&
parentParentParent.type === "DeclareFunction"));
@@ -5000,6 +5032,7 @@ function genericPrintNoParens(path, options, print, args) {
if (n.static) {
parts.push("static ");
}
if (n.readonly) {
parts.push("readonly ");
}
@@ -5173,7 +5206,15 @@ function genericPrintNoParens(path, options, print, args) {
return concat$2(parts);
case "TSNamespaceExportDeclaration":
if (n.declaration) {
parts.push("export ", path.call(print, "declaration"));
// Temporary fix until https://github.com/eslint/typescript-eslint-parser/issues/263
const isDefault = options.originalText
.slice(util$4.locStart(n), util$4.locStart(n.declaration))
.match(/\bdefault\b/);
parts.push(
"export ",
isDefault ? "default " : "",
path.call(print, "declaration")
);
} else {
parts.push("export as namespace ", path.call(print, "name"));
@@ -6137,8 +6178,21 @@ function printExportDeclaration(path, options, print) {
const parts = ["export "];
if (decl["default"] || decl.type === "ExportDefaultDeclaration") {
// Temp fix, delete after https://github.com/eslint/typescript-eslint-parser/issues/304
if (
decl.declaration &&
/=/.test(
options.originalText.slice(
util$4.locStart(decl),
util$4.locStart(decl.declaration)
)
)
) {
parts.push("= ");
} else {
parts.push("default ");
}
}
parts.push(
comments$3.printDanglingComments(path, options, /* sameIndent */ true)
@@ -7600,6 +7654,7 @@ var printer = { printAstToDoc: printAstToDoc$1 };
const docBuilders$4 = docBuilders$1;
const concat$3 = docBuilders$4.concat;
const fill$2 = docBuilders$4.fill;
const cursor$2 = docBuilders$4.cursor;
const MODE_BREAK = 1;
const MODE_FLAT = 2;
@@ -7753,6 +7808,10 @@ function printDocToString$1(doc, options) {
pos += doc.length;
} else {
switch (doc.type) {
case "cursor":
out.push(cursor$2.placeholder);
break;
case "concat":
for (let i = doc.parts.length - 1; i >= 0; i--) {
cmds.push([ind, mode, doc.parts[i]]);
@@ -8008,7 +8067,19 @@ function printDocToString$1(doc, options) {
}
}
}
return out.join("");
const cursorPlaceholderIndex = out.indexOf(cursor$2.placeholder);
if (cursorPlaceholderIndex !== -1) {
const beforeCursor = out.slice(0, cursorPlaceholderIndex).join("");
const afterCursor = out.slice(cursorPlaceholderIndex + 1).join("");
return {
formatted: beforeCursor + afterCursor,
cursor: beforeCursor.length
};
}
return { formatted: out.join("") };
}
var docPrinter = { printDocToString: printDocToString$1 };
@@ -8276,7 +8347,7 @@ index$4.hasColor = hasColor;
index$4.stripColor = stripColor;
index$4.supportsColor = supportsColor_1;
var index$24 = {
var index$26 = {
"aliceblue": [240, 248, 255],
"antiquewhite": [250, 235, 215],
"aqua": [0, 255, 255],
@@ -8429,7 +8500,7 @@ var index$24 = {
var conversions$1 = createCommonjsModule(function (module) {
/* MIT license */
var cssKeywords = index$24;
var cssKeywords = index$26;
// NOTE: conversions should only return primitive values (i.e. arrays, or
// values that give correct `typeof` results).
@@ -9466,11 +9537,11 @@ models.forEach(function (fromModel) {
});
});
var index$22 = convert;
var index$24 = convert;
var index$20 = createCommonjsModule(function (module) {
var index$22 = createCommonjsModule(function (module) {
'use strict';
const colorConvert = index$22;
const colorConvert = index$24;
const wrapAnsi16 = (fn, offset) => function () {
const code = fn.apply(colorConvert, arguments);
@@ -9635,7 +9706,7 @@ colors) =>
const test = object => object && object.$$typeof === asymmetricMatcher;
var AsymmetricMatcher = { print: print$1, test };
var AsymmetricMatcher$1 = { print: print$1, test };
const ansiRegex$2 = index$12; /**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
@@ -9645,7 +9716,7 @@ const ansiRegex$2 = index$12; /**
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/const toHumanReadableAnsi = text => {const style = index$20;return text.replace(ansiRegex$2(), (match, offset, string) => {switch (match) {case style.red.close:case style.green.close:case style.reset.open:
*/const toHumanReadableAnsi = text => {const style = index$22;return text.replace(ansiRegex$2(), (match, offset, string) => {switch (match) {case style.red.close:case style.green.close:case style.reset.open:
case style.reset.close:
return '</>';
case style.red.open:
@@ -9811,7 +9882,7 @@ colors) =>
return result;
};
var HTMLElement = { print: print$3, test: test$2 };
var HTMLElement$1 = { print: print$3, test: test$2 };
var _slicedToArray = function () {function sliceIterator(arr, i) {var _arr = [];var _n = true;var _d = false;var _e = undefined;try {for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {_arr.push(_s.value);if (i && _arr.length === i) break;}} catch (err) {_d = true;_e = err;} finally {try {if (!_n && _i["return"]) _i["return"]();} finally {if (_d) throw _e;}}return _arr;}return function (arr, i) {if (Array.isArray(arr)) {return arr;} else if (Symbol.iterator in Object(arr)) {return sliceIterator(arr, i);} else {throw new TypeError("Invalid attempt to destructure non-iterable instance");}};}();
@@ -10090,7 +10161,7 @@ colors) =>
const test$9 = object => object && object.$$typeof === reactElement;
var ReactElement = { print: print$10, test: test$9 };
var ReactElement$1 = { print: print$10, test: test$9 };
const escapeHTML$3 = escapeHTML_1; /**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
@@ -10194,7 +10265,7 @@ object && object.$$typeof === reactTestInstance;
var ReactTestComponent = { print: print$11, test: test$10 };
const style = index$20; /**
const style = index$22; /**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -11041,7 +11112,7 @@ function createIndent(indent) {
return new Array(indent + 1).join(' ');
}
function prettyFormat(val, initialOptions) {
function prettyFormat$1(val, initialOptions) {
let opts;
if (!initialOptions) {
opts = DEFAULTS;
@@ -11136,167 +11207,27 @@ function prettyFormat(val, initialOptions) {
}
prettyFormat.plugins = {
AsymmetricMatcher: AsymmetricMatcher,
prettyFormat$1.plugins = {
AsymmetricMatcher: AsymmetricMatcher$1,
ConvertAnsi: ConvertAnsi,
HTMLElement: HTMLElement,
HTMLElement: HTMLElement$1,
Immutable: ImmutablePlugins,
ReactElement: ReactElement,
ReactElement: ReactElement$1,
ReactTestComponent: ReactTestComponent };
var index$18 = prettyFormat;
/* eslint-disable no-nested-ternary */
var arr = [];
var charCodeCache = [];
var index$26 = function (a, b) {
if (a === b) {
return 0;
}
var swap = a;
// Swapping the strings if `a` is longer than `b` so we know which one is the
// shortest & which one is the longest
if (a.length > b.length) {
a = b;
b = swap;
}
var aLen = a.length;
var bLen = b.length;
if (aLen === 0) {
return bLen;
}
if (bLen === 0) {
return aLen;
}
// Performing suffix trimming:
// We can linearly drop suffix common to both strings since they
// don't increase distance at all
// Note: `~-` is the bitwise way to perform a `- 1` operation
while (aLen > 0 && (a.charCodeAt(~-aLen) === b.charCodeAt(~-bLen))) {
aLen--;
bLen--;
}
if (aLen === 0) {
return bLen;
}
// Performing prefix trimming
// We can linearly drop prefix common to both strings since they
// don't increase distance at all
var start = 0;
while (start < aLen && (a.charCodeAt(start) === b.charCodeAt(start))) {
start++;
}
aLen -= start;
bLen -= start;
if (aLen === 0) {
return bLen;
}
var bCharCode;
var ret;
var tmp;
var tmp2;
var i = 0;
var j = 0;
while (i < aLen) {
charCodeCache[start + i] = a.charCodeAt(start + i);
arr[i] = ++i;
}
while (j < bLen) {
bCharCode = b.charCodeAt(start + j);
tmp = j++;
ret = j;
for (i = 0; i < aLen; i++) {
tmp2 = bCharCode === charCodeCache[start + i] ? tmp : tmp + 1;
tmp = arr[i];
ret = arr[i] = tmp > ret ? tmp2 > ret ? ret + 1 : tmp2 : tmp2 > tmp ? tmp + 1 : tmp2;
}
}
return ret;
};
var index$20 = prettyFormat$1;
const chalk$1 = index$4;
const BULLET = chalk$1.bold('\u25cf');
const DEPRECATION = `${BULLET} Deprecation Warning`;
const ERROR$1 = `${BULLET} Validation Error`;
const WARNING = `${BULLET} Validation Warning`;
const format$2 = value =>
typeof value === 'function' ?
value.toString() :
index$18(value, { min: true });
class ValidationError$1 extends Error {
constructor(name, message, comment) {
super();
comment = comment ? '\n\n' + comment : '\n';
this.name = '';
this.message = chalk$1.red(chalk$1.bold(name) + ':\n\n' + message + comment);
Error.captureStackTrace(this, () => {});
}}
const logValidationWarning = (
name,
message,
comment) =>
{
comment = comment ? '\n\n' + comment : '\n';
console.warn(chalk$1.yellow(chalk$1.bold(name) + ':\n\n' + message + comment));
};
const createDidYouMeanMessage = (
unrecognized,
allowedOptions) =>
{
const leven = index$26;
const suggestion = allowedOptions.find(option => {
const steps = leven(option, unrecognized);
return steps < 3;
});
return suggestion ? `Did you mean ${chalk$1.bold(format$2(suggestion))}?` : '';
};
var utils$2 = {
DEPRECATION,
ERROR: ERROR$1,
ValidationError: ValidationError$1,
WARNING,
createDidYouMeanMessage,
format: format$2,
logValidationWarning };
const chalk$2 = index$4;
const prettyFormat$1 = index$18;var _require$plugins =
const prettyFormat = index$20;var _require$plugins =
index$18.plugins;const AsymmetricMatcher$2 = _require$plugins.AsymmetricMatcher; const ReactElement$2 = _require$plugins.ReactElement; const HTMLElement$2 = _require$plugins.HTMLElement; const Immutable = _require$plugins.Immutable;
index$20.plugins;const AsymmetricMatcher = _require$plugins.AsymmetricMatcher; const ReactElement = _require$plugins.ReactElement; const HTMLElement = _require$plugins.HTMLElement; const Immutable = _require$plugins.Immutable;
const PLUGINS = [AsymmetricMatcher$2, ReactElement$2, HTMLElement$2].concat(
const PLUGINS = [AsymmetricMatcher, ReactElement, HTMLElement].concat(
Immutable);
@@ -11314,10 +11245,10 @@ Immutable);
const EXPECTED_COLOR = chalk$2.green;
const EXPECTED_BG = chalk$2.bgGreen;
const RECEIVED_COLOR = chalk$2.red;
const RECEIVED_BG = chalk$2.bgRed;
const EXPECTED_COLOR = chalk$1.green;
const EXPECTED_BG = chalk$1.bgGreen;
const RECEIVED_COLOR = chalk$1.red;
const RECEIVED_BG = chalk$1.bgRed;
const NUMBERS = [
'zero',
@@ -11375,13 +11306,13 @@ const stringify = function (object) {let maxDepth = arguments.length > 1 && argu
let result;
try {
result = prettyFormat$1(object, {
result = prettyFormat(object, {
maxDepth,
min: true,
plugins: PLUGINS });
} catch (e) {
result = prettyFormat$1(object, {
result = prettyFormat(object, {
callToJSON: false,
maxDepth,
min: true,
@@ -11472,16 +11403,16 @@ matcherName)
const secondArgument = options && options.secondArgument;
const isDirectExpectCall = options && options.isDirectExpectCall;
return (
chalk$2.dim('expect' + (isDirectExpectCall ? '' : '(')) +
chalk$1.dim('expect' + (isDirectExpectCall ? '' : '(')) +
RECEIVED_COLOR(received) +
chalk$2.dim((isDirectExpectCall ? '' : ')') + matcherName + '(') +
chalk$1.dim((isDirectExpectCall ? '' : ')') + matcherName + '(') +
EXPECTED_COLOR(expected) + (
secondArgument ? `, ${EXPECTED_COLOR(secondArgument)}` : '') +
chalk$2.dim(')'));
chalk$1.dim(')'));
};
var index$28 = {
var index$18 = {
EXPECTED_BG,
EXPECTED_COLOR,
RECEIVED_BG,
@@ -11499,15 +11430,156 @@ var index$28 = {
printWithType,
stringify };
const chalk = index$4;var _require =
utils$2;const format$1 = _require.format; const ValidationError = _require.ValidationError; const ERROR = _require.ERROR;var _require2 =
index$28;const getType = _require2.getType;
/* eslint-disable no-nested-ternary */
var arr = [];
var charCodeCache = [];
const errorMessage = (
option,
received,
defaultValue,
options) =>
var index$28 = function (a, b) {
if (a === b) {
return 0;
}
var swap = a;
// Swapping the strings if `a` is longer than `b` so we know which one is the
// shortest & which one is the longest
if (a.length > b.length) {
a = b;
b = swap;
}
var aLen = a.length;
var bLen = b.length;
if (aLen === 0) {
return bLen;
}
if (bLen === 0) {
return aLen;
}
// Performing suffix trimming:
// We can linearly drop suffix common to both strings since they
// don't increase distance at all
// Note: `~-` is the bitwise way to perform a `- 1` operation
while (aLen > 0 && (a.charCodeAt(~-aLen) === b.charCodeAt(~-bLen))) {
aLen--;
bLen--;
}
if (aLen === 0) {
return bLen;
}
// Performing prefix trimming
// We can linearly drop prefix common to both strings since they
// don't increase distance at all
var start = 0;
while (start < aLen && (a.charCodeAt(start) === b.charCodeAt(start))) {
start++;
}
aLen -= start;
bLen -= start;
if (aLen === 0) {
return bLen;
}
var bCharCode;
var ret;
var tmp;
var tmp2;
var i = 0;
var j = 0;
while (i < aLen) {
charCodeCache[start + i] = a.charCodeAt(start + i);
arr[i] = ++i;
}
while (j < bLen) {
bCharCode = b.charCodeAt(start + j);
tmp = j++;
ret = j;
for (i = 0; i < aLen; i++) {
tmp2 = bCharCode === charCodeCache[start + i] ? tmp : tmp + 1;
tmp = arr[i];
ret = arr[i] = tmp > ret ? tmp2 > ret ? ret + 1 : tmp2 : tmp2 > tmp ? tmp + 1 : tmp2;
}
}
return ret;
};
const chalk$2 = index$4;
const BULLET = chalk$2.bold('\u25cf');
const DEPRECATION = `${BULLET} Deprecation Warning`;
const ERROR$1 = `${BULLET} Validation Error`;
const WARNING = `${BULLET} Validation Warning`;
const format$2 = value =>
typeof value === 'function' ?
value.toString() :
index$20(value, { min: true });
class ValidationError$1 extends Error {
constructor(name, message, comment) {
super();
comment = comment ? '\n\n' + comment : '\n';
this.name = '';
this.stack = '';
this.message = chalk$2.red(chalk$2.bold(name) + ':\n\n' + message + comment);
Error.captureStackTrace(this, () => {});
}}
const logValidationWarning = (
name,
message,
comment) =>
{
comment = comment ? '\n\n' + comment : '\n';
console.warn(chalk$2.yellow(chalk$2.bold(name) + ':\n\n' + message + comment));
};
const createDidYouMeanMessage = (
unrecognized,
allowedOptions) =>
{
const leven = index$28;
const suggestion = allowedOptions.find(option => {
const steps = leven(option, unrecognized);
return steps < 3;
});
return suggestion ? `Did you mean ${chalk$2.bold(format$2(suggestion))}?` : '';
};
var utils$2 = {
DEPRECATION,
ERROR: ERROR$1,
ValidationError: ValidationError$1,
WARNING,
createDidYouMeanMessage,
format: format$2,
logValidationWarning };
const chalk = index$4; /**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/var _require = index$18;const getType = _require.getType;var _require2 = utils$2;const format$1 = _require2.format; const ValidationError = _require2.ValidationError; const ERROR = _require2.ERROR;const errorMessage = (option, received, defaultValue, options) =>
{
const message = ` Option ${chalk.bold(`"${option}"`)} must be of type:
${chalk.bold.green(getType(defaultValue))}
@@ -11533,15 +11605,23 @@ var _require$2 =
utils$2;const logValidationWarning$1 = _require$2.logValidationWarning; const DEPRECATION$2 = _require$2.DEPRECATION;
const deprecationMessage = (message, options) => {
const comment = options.comment;
const name = options.title && options.title.deprecation || DEPRECATION$2;
logValidationWarning$1(name, message, comment);
};
utils$2;const logValidationWarning$1 = _require$2.logValidationWarning; const DEPRECATION$2 = _require$2.DEPRECATION; /**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/const deprecationMessage = (message, options) => {const comment = options.comment;const name = options.title && options.title.deprecation || DEPRECATION$2;logValidationWarning$1(name, message, comment);};
const deprecationWarning$1 = (
config,
option,
@@ -11560,15 +11640,15 @@ options) =>
var deprecated = {
deprecationWarning: deprecationWarning$1 };
const chalk$3 = index$4;var _require$3 =
utils$2;const format$3 = _require$3.format; const logValidationWarning$2 = _require$3.logValidationWarning; const createDidYouMeanMessage$1 = _require$3.createDidYouMeanMessage; const WARNING$2 = _require$3.WARNING;
const unknownOptionWarning$1 = (
const chalk$3 = index$4; /**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/var _require$3 = utils$2;const format$3 = _require$3.format; const logValidationWarning$2 = _require$3.logValidationWarning; const createDidYouMeanMessage$1 = _require$3.createDidYouMeanMessage; const WARNING$2 = _require$3.WARNING;const unknownOptionWarning$1 = (
config,
exampleConfig,
option,
@@ -11578,12 +11658,10 @@ options) =>
option,
Object.keys(exampleConfig));
/* eslint-disable max-len */
const message =
` Unknown option ${chalk$3.bold(`"${option}"`)} with value ${chalk$3.bold(format$3(config[option]))} was found.` + (
didYouMean && ` ${didYouMean}`) +
`\n This is probably a typing mistake. Fixing it will remove this message.`;
/* eslint-enable max-len */
const comment = options.comment;
const name = options.title && options.title.warning || WARNING$2;
@@ -11594,16 +11672,6 @@ options) =>
var warnings = {
unknownOptionWarning: unknownOptionWarning$1 };
/**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
const config = {
comment: ' A comment',
condition: (option, validOption) => true,
@@ -11618,12 +11686,7 @@ const config = {
error: 'Validation Error',
warning: 'Validation Warning' },
unknown: (config, option, options) => {} };
var exampleConfig$2 = config;
/**
unknown: (config, option, options) => {} }; /**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
@@ -11631,7 +11694,7 @@ var exampleConfig$2 = config;
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/
*/var exampleConfig$2 = config;
const toString$1 = Object.prototype.toString;
@@ -11649,15 +11712,23 @@ var _require$1 =
deprecated;const deprecationWarning = _require$1.deprecationWarning;var _require2$1 =
warnings;const unknownOptionWarning = _require2$1.unknownOptionWarning;var _require3 =
errors;const errorMessage$1 = _require3.errorMessage;
const exampleConfig$1 = exampleConfig$2;
const validationCondition = condition;var _require4 =
utils$2;const ERROR$2 = _require4.ERROR; const DEPRECATION$1 = _require4.DEPRECATION; const WARNING$1 = _require4.WARNING;
var defaultConfig$1 = {
comment: '',
deprecated;const deprecationWarning = _require$1.deprecationWarning; /**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/var _require2$1 = warnings;const unknownOptionWarning = _require2$1.unknownOptionWarning;var _require3 = errors;const errorMessage$1 = _require3.errorMessage;const exampleConfig$1 = exampleConfig$2;const validationCondition = condition;var _require4 = utils$2;const ERROR$2 = _require4.ERROR; const DEPRECATION$1 = _require4.DEPRECATION; const WARNING$1 = _require4.WARNING;var defaultConfig$1 = { comment: '',
condition: validationCondition,
deprecate: deprecationWarning,
deprecatedConfig: {},
@@ -11670,15 +11741,15 @@ var defaultConfig$1 = {
unknown: unknownOptionWarning };
const defaultConfig = defaultConfig$1;
const _validate = (config, options) => {
let hasDeprecationWarnings = false;
for (const key in config) {
if (
options.deprecatedConfig &&
key in options.deprecatedConfig &&
const defaultConfig = defaultConfig$1; /**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*
*/const _validate = (config, options) => {let hasDeprecationWarnings = false;for (const key in config) {if (options.deprecatedConfig && key in options.deprecatedConfig &&
typeof options.deprecate === 'function')
{
const isDeprecatedKey = options.deprecate(
@@ -11749,6 +11820,7 @@ const validate = index$2.validate;
const deprecatedConfig = deprecated_1;
const defaults = {
cursorOffset: -1,
rangeStart: 0,
rangeEnd: Infinity,
useTabs: false,
@@ -11999,7 +12071,7 @@ function parse(text, opts) {
if (loc) {
const codeFrame = index$30;
error.codeFrame = codeFrame(text, loc.line, loc.column + 1, {
error.codeFrame = codeFrame(text, loc.line, loc.column, {
highlightCode: true
});
error.message += "\n" + error.codeFrame;
@@ -12134,10 +12206,10 @@ var docDebug = {
}
};
var require$$1$12 = ( _package$1 && _package$1['default'] ) || _package$1;
var require$$1$13 = ( _package$1 && _package$1['default'] ) || _package$1;
const comments = comments$1;
const version = require$$1$12.version;
const version = require$$1$13.version;
const printAstToDoc = printer.printAstToDoc;
const util = util$2;
const printDocToString = docPrinter.printDocToString;
@@ -12189,26 +12261,50 @@ function ensureAllCommentsPrinted(astComments) {
});
}
function format(text, opts, addAlignmentSize) {
function formatWithCursor(text, opts, addAlignmentSize) {
addAlignmentSize = addAlignmentSize || 0;
const ast = parser.parse(text, opts);
const formattedRangeOnly = formatRange(text, opts, ast);
if (formattedRangeOnly) {
return formattedRangeOnly;
return { formatted: formattedRangeOnly };
}
let cursorOffset;
if (opts.cursorOffset >= 0) {
const cursorNodeAndParents = findNodeAtOffset(ast, opts.cursorOffset);
const cursorNode = cursorNodeAndParents.node;
if (cursorNode) {
cursorOffset = opts.cursorOffset - util.locStart(cursorNode);
opts.cursorNode = cursorNode;
}
}
const astComments = attachComments(text, ast, opts);
const doc = printAstToDoc(ast, opts, addAlignmentSize);
opts.newLine = guessLineEnding(text);
const str = printDocToString(doc, opts);
const toStringResult = printDocToString(doc, opts);
const str = toStringResult.formatted;
const cursorOffsetResult = toStringResult.cursor;
ensureAllCommentsPrinted(astComments);
// Remove extra leading indentation as well as the added indentation after last newline
if (addAlignmentSize > 0) {
return str.trim() + opts.newLine;
return { formatted: str.trim() + opts.newLine };
}
return str;
if (cursorOffset !== undefined) {
return {
formatted: str,
cursorOffset: cursorOffsetResult + cursorOffset
};
}
return { formatted: str };
}
function format(text, opts, addAlignmentSize) {
return formatWithCursor(text, opts, addAlignmentSize).formatted;
}
function findSiblingAncestors(startNodeAndParents, endNodeAndParents) {
@@ -12378,6 +12474,9 @@ function formatWithShebang(text, opts) {
}
var index = {
formatWithCursor: function(text, opts) {
return formatWithCursor(text, normalizeOptions(opts));
},
format: function(text, opts) {
return formatWithShebang(text, normalizeOptions(opts));
},
+1 -1
View File
@@ -8,7 +8,7 @@ function createCommonjsModule(fn, module) {
}
var parserBabylon_1 = createCommonjsModule(function (module) {
"use strict";function createCommonjsModule$$1(t,e){return e={exports:{}},t(e,e.exports),e.exports}function parse(t){const e=index,s={sourceType:"module",allowImportExportEverywhere:!1,allowReturnOutsideFunction:!0,plugins:["jsx","flow","doExpressions","objectRestSpread","decorators","classProperties","exportExtensions","asyncGenerators","functionBind","functionSent","dynamicImport"]};let i;try{i=e.parse(t,s);}catch(i){try{return e.parse(t,Object.assign({},s,{strictMode:!1}))}catch(t){throw i}}return delete i.tokens,i}var index=createCommonjsModule$$1(function(t,e){function s(t){var e={};for(var s in b)e[s]=t&&s in t?t[s]:b[s];return e}function i(t){var e=t.split(" ");return function(t){return e.indexOf(t)>=0}}function r(t,e){for(var s=65536,i=0;i<e.length;i+=2){if((s+=e[i])>t)return!1;if((s+=e[i+1])>=t)return!0}return!1}function a(t){return t<65?36===t:t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&j.test(String.fromCharCode(t)):r(t,D)))}function n(t){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&R.test(String.fromCharCode(t)):r(t,D)||r(t,O))))}function o(t){return 10===t||13===t||8232===t||8233===t}function h(t,e){for(var s=1,i=0;;){F.lastIndex=i;var r=F.exec(t);if(!(r&&r.index<e))return new U(s,e-i);++s,i=r.index+r[0].length;}throw new Error("Unreachable")}function p(t){return t[t.length-1]}function c(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}function l(t){for(var e={},s=t,i=Array.isArray(s),r=0,s=i?s:s[Symbol.iterator]();;){var a;if(i){if(r>=s.length)break;a=s[r++];}else{if((r=s.next()).done)break;a=r.value;}e[a]=!0;}return e}function u(t){return null!=t&&"Property"===t.type&&"init"===t.kind&&!1===t.method}function d(t){return"DeclareExportAllDeclaration"===t.type||"DeclareExportDeclaration"===t.type&&(!t.declaration||"TypeAlias"!==t.declaration.type&&"InterfaceDeclaration"!==t.declaration.type)}function f(t){if("JSXIdentifier"===t.type)return t.name;if("JSXNamespacedName"===t.type)return t.namespace.name+":"+t.name.name;if("JSXMemberExpression"===t.type)return f(t.object)+"."+f(t.property);throw new Error("Node had unexpected type: "+t.type)}function m(t,e){return x(e,t).parse()}function y(t,e){var s=x(e,t);return s.options.strictMode&&(s.state.strict=!0),s.getExpression()}function x(t,e){return new(t&&t.plugins?v(t.plugins):tt)(t,e)}function v(t){var e=t.filter(function(t){return"estree"===t||"flow"===t||"jsx"===t});e.indexOf("flow")>=0&&(e=e.filter(function(t){return"flow"!==t})).push("flow"),e.indexOf("estree")>=0&&(e=e.filter(function(t){return"estree"!==t})).unshift("estree");var s=e.join("/"),i=pt[s];if(!i){i=tt;for(var r=e,a=Array.isArray(r),n=0,r=a?r:r[Symbol.iterator]();;){var o;if(a){if(n>=r.length)break;o=r[n++];}else{if((n=r.next()).done)break;o=n.value;}i=Z[o](i);}pt[s]=i;}return i}Object.defineProperty(e,"__esModule",{value:!0});var b={sourceType:"script",sourceFilename:void 0,startLine:1,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,plugins:[],strictMode:null,ranges:!1},g=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},w=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);},P=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},A=!0,k=function t(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};g(this,t),this.label=e,this.keyword=s.keyword,this.beforeExpr=!!s.beforeExpr,this.startsExpr=!!s.startsExpr,this.rightAssociative=!!s.rightAssociative,this.isLoop=!!s.isLoop,this.isAssign=!!s.isAssign,this.prefix=!!s.prefix,this.postfix=!!s.postfix,this.binop=s.binop||null,this.updateContext=null;},E=function(t){function e(s){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return g(this,e),i.keyword=s,P(this,t.call(this,s,i))}return w(e,t),e}(k),T=function(t){function e(s,i){return g(this,e),P(this,t.call(this,s,{beforeExpr:A,binop:i}))}return w(e,t),e}(k),C={num:new k("num",{startsExpr:!0}),regexp:new k("regexp",{startsExpr:!0}),string:new k("string",{startsExpr:!0}),name:new k("name",{startsExpr:!0}),eof:new k("eof"),bracketL:new k("[",{beforeExpr:A,startsExpr:!0}),bracketR:new k("]"),braceL:new k("{",{beforeExpr:A,startsExpr:!0}),braceBarL:new k("{|",{beforeExpr:A,startsExpr:!0}),braceR:new k("}"),braceBarR:new k("|}"),parenL:new k("(",{beforeExpr:A,startsExpr:!0}),parenR:new k(")"),comma:new k(",",{beforeExpr:A}),semi:new k(";",{beforeExpr:A}),colon:new k(":",{beforeExpr:A}),doubleColon:new k("::",{beforeExpr:A}),dot:new k("."),question:new k("?",{beforeExpr:A}),arrow:new k("=>",{beforeExpr:A}),template:new k("template"),eLine truncated
"use strict";function createError$1(t,e,s){const i=new SyntaxError(t+" ("+e+":"+s+")");return i.loc={line:e,column:s},i}function createCommonjsModule$$1(t,e){return e={exports:{}},t(e,e.exports),e.exports}function parse(t){const e=index,s={sourceType:"module",allowImportExportEverywhere:!1,allowReturnOutsideFunction:!0,plugins:["jsx","flow","doExpressions","objectRestSpread","decorators","classProperties","exportExtensions","asyncGenerators","functionBind","functionSent","dynamicImport"]};let i;try{i=e.parse(t,s);}catch(i){try{return e.parse(t,Object.assign({},s,{strictMode:!1}))}catch(t){throw createError(i.message.replace(/ \(.*\)/,""),i.loc.line,i.loc.column+1)}}return delete i.tokens,i}var parserCreateError=createError$1,index=createCommonjsModule$$1(function(t,e){function s(t){var e={};for(var s in b)e[s]=t&&s in t?t[s]:b[s];return e}function i(t){var e=t.split(" ");return function(t){return e.indexOf(t)>=0}}function r(t,e){for(var s=65536,i=0;i<e.length;i+=2){if((s+=e[i])>t)return!1;if((s+=e[i+1])>=t)return!0}return!1}function a(t){return t<65?36===t:t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&j.test(String.fromCharCode(t)):r(t,D)))}function n(t){return t<48?36===t:t<58||!(t<65)&&(t<91||(t<97?95===t:t<123||(t<=65535?t>=170&&R.test(String.fromCharCode(t)):r(t,D)||r(t,O))))}function o(t){return 10===t||13===t||8232===t||8233===t}function h(t,e){for(var s=1,i=0;;){F.lastIndex=i;var r=F.exec(t);if(!(r&&r.index<e))return new U(s,e-i);++s,i=r.index+r[0].length;}throw new Error("Unreachable")}function p(t){return t[t.length-1]}function c(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+(t-65536>>10),56320+(t-65536&1023))}function l(t){for(var e={},s=t,i=Array.isArray(s),r=0,s=i?s:s[Symbol.iterator]();;){var a;if(i){if(r>=s.length)break;a=s[r++];}else{if((r=s.next()).done)break;a=r.value;}e[a]=!0;}return e}function u(t){return null!=t&&"Property"===t.type&&"init"===t.kind&&!1===t.method}function d(t){return"DeclareExportAllDeclaration"===t.type||"DeclareExportDeclaration"===t.type&&(!t.declaration||"TypeAlias"!==t.declaration.type&&"InterfaceDeclaration"!==t.declaration.type)}function f(t){if("JSXIdentifier"===t.type)return t.name;if("JSXNamespacedName"===t.type)return t.namespace.name+":"+t.name.name;if("JSXMemberExpression"===t.type)return f(t.object)+"."+f(t.property);throw new Error("Node had unexpected type: "+t.type)}function m(t,e){return x(e,t).parse()}function y(t,e){var s=x(e,t);return s.options.strictMode&&(s.state.strict=!0),s.getExpression()}function x(t,e){return new(t&&t.plugins?v(t.plugins):tt)(t,e)}function v(t){var e=t.filter(function(t){return"estree"===t||"flow"===t||"jsx"===t});e.indexOf("flow")>=0&&(e=e.filter(function(t){return"flow"!==t})).push("flow"),e.indexOf("estree")>=0&&(e=e.filter(function(t){return"estree"!==t})).unshift("estree");var s=e.join("/"),i=pt[s];if(!i){i=tt;for(var r=e,a=Array.isArray(r),n=0,r=a?r:r[Symbol.iterator]();;){var o;if(a){if(n>=r.length)break;o=r[n++];}else{if((n=r.next()).done)break;o=n.value;}i=Z[o](i);}pt[s]=i;}return i}Object.defineProperty(e,"__esModule",{value:!0});var b={sourceType:"script",sourceFilename:void 0,startLine:1,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,plugins:[],strictMode:null,ranges:!1},g=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},w=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);},P=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},A=!0,k=function t(e){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};g(this,t),this.label=e,this.keyword=s.keyword,this.beforeExpr=!!s.beforeExpr,this.startsExpr=!!s.startsExpr,this.rightAssociative=!!s.rightAssociative,this.isLoop=!!s.isLoop,this.isAssign=!!s.isAssign,this.prefix=!!s.prefix,this.postfix=!!s.postfix,this.binop=s.binop||null,this.updateContext=null;},E=function(t){function e(s){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return g(this,e),i.keyword=s,P(this,t.call(this,s,i))}return w(e,t),e}(k),T=function(t){function e(s,i){return g(this,e),P(this,t.call(this,s,{beforeExpr:A,binop:i}))}return w(e,t),e}(k),C={num:new k("num",{startsExpr:!0}),regexp:new k("regexp",{startsExpr:!0}),string:new k("string",{startsExpr:!0}),name:new k("name",{startsExpr:!0}),eof:new k("eof"),bracketL:new k("[",{beforeExpr:A,startsExpr:!0}),bracketR:new k("]"),braceL:new k("{",{beforeExpr:A,startsExpr:!0}),braceBarL:new k("{|",{beforeExpr:A,startsExpr:!0}),braceR:new k("}"),braceBarR:new k("|}"),parenL:new k("(",{beforeExpr:A,startsExpr:!0}),parenR:new k(")"),comma:new k(",",{beforeExpr:A}),semi:Line truncated
});
var parserBabylon = unwrapExports(parserBabylon_1);
+1 -1
View File
@@ -1,5 +1,5 @@
var flow = (function () {
function createError$1(t,r,e){const n=new SyntaxError(t+" ("+r+":"+e+")");return n.loc={line:r,column:e},n}function createCommonjsModule(t,r){return r={exports:{}},t(r,r.exports),r.exports}function parse(t){const r=flow_parser.parse(t,{esproposal_class_instance_fields:!0,esproposal_class_static_fields:!0,esproposal_export_star_as:!0});if(r.errors.length>0)throw createError(r.errors[0].message,r.errors[0].loc.start.line,r.errors[0].loc.start.column);return r}var parserCreateError=createError$1; var flow_parser=createCommonjsModule(function(t,r){!function(t){"use strict";function e(t,r){throw[0,t,r]}function n(t,r){function n(r){e(Gd.Undefined_recursive_module,t);}function a(t,r,e){if("number"==typeof t)switch(t){case 0:r[e]={fun:n};break;case 1:r[e]=[ls,n];break;default:r[e]=[];}else switch(t[0]){case 0:r[e]=[0];for(var u=1;u<t[1].length;u++)a(t[1][u],r[e],u);break;default:r[e]=t[1];}}var u=[];return a(r,u,0),u[0]}function a(t,r){if(typeof r===Pk)return t.fun=r,0;if(r.fun)return t.fun=r.fun,0;for(var e=r.length;e--;)t[e]=r[e];return 0}function u(t,r,e){if("number"==typeof t)switch(t){case 0:r.fun=e;break;case 1:default:a(r,e);}else switch(t[0]){case 0:for(var n=1;n<t[1].length;n++)u(t[1][n],r[n],e[n]);}return 0}function i(t,r){var e=t.length,n=e+r.length-1,a=new Array(n);a[0]=0;for(var u=1,i=1;u<e;u++)a[u]=t[u];for(;u<n;u++,i++)a[u]=r[i];return a}function f(t,r,e,n,a){if(n<=r)for(u=1;u<=a;u++)e[n+u]=t[r+u];else for(var u=a;u>=1;u--)e[n+u]=t[r+u];return 0}function c(t,r,e){var n=new Array(e+1);n[0]=0;for(var a=1,u=r+1;a<=e;a++,u++)n[a]=t[u];return n}function s(t,r,e){for(var n=new Array(e),a=0;a<e;a++)n[a]=t[r+a];return n}function o(t,r,e){var n=String.fromCharCode;if(0==r&&e<=4096&&e==t.length)return n.apply(null,t);for(var a=mb;0<e;r+=Nu,e-=Nu)a+=n.apply(null,s(t,r,Math.min(e,Nu)));return a}function v(r){if(t.Uint8Array)e=new t.Uint8Array(r.l);else var e=new Array(r.l);for(var n=r.c,a=n.length,u=0;u<a;u++)e[u]=n.charCodeAt(u);for(a=r.l;u<a;u++)e[u]=0;return r.c=e,r.t=4,e}function l(t,r,e,n,a){if(0==a)return 0;if(0==n&&(a>=e.l||2==e.t&&a>=e.c.length))e.c=4==t.t?o(t.c,r,a):0==r&&t.c.length==a?t.c:t.c.substr(r,a),e.t=e.c.length==e.l?0:2;else if(2==e.t&&n==e.c.length)e.c+=4==t.t?o(t.c,r,a):0==r&&t.c.length==a?t.c:t.c.substr(r,a),e.t=e.c.length==e.l?0:2;else{4!=e.t&&v(e);var u=t.c,i=e.c;if(4==t.t)if(n<=r)for(c=0;c<a;c++)i[n+c]=u[r+c];else for(c=a-1;c>=0;c--)i[n+c]=u[r+c];else{for(var f=Math.min(a,u.length-r),c=0;c<f;c++)i[n+c]=u.charCodeAt(r+c);for(;c<a;c++)i[n+c]=0;}}return 0}function b(t,r){if(r.repeat)return r.repeat(t);var e=mb,n=0;if(0==t)return e;for(;;){if(1&t&&(e+=r),0==(t>>=1))return e;r+=r,9==++n&&r.slice(0,1);}}function k(t){2==t.t?t.c+=b(t.l-t.c.length,"\0"):t.c=o(t.c,0,t.c.length),t.t=0;}function p(t){if(t.length<24){for(var r=0;r<t.length;r++)if(t.charCodeAt(r)>Kb)return!1;return!0}return!/[^\x00-\x7f]/.test(t)}function h(t){for(var r,e,n,a,u=mb,i=mb,f=0,c=t.length;f<c;f++){if((e=t.charCodeAt(f))<Zn){for(var s=f+1;s<c&&(e=t.charCodeAt(s))<Zn;s++);if(s-f>Hn?(i.substr(0,1),u+=i,i=mb,u+=t.slice(f,s)):i+=t.slice(f,s),s==c)break;f=s;}a=1,++f<c&&(-64&(n=t.charCodeAt(f)))==Zn&&(r=n+(e<<6),e<Jl?(a=r-12416)<Zn&&(a=1):(a=2,++f<c&&(-64&(n=t.charCodeAt(f)))==Zn&&(r=n+(r<<6),e<$p?((a=r-925824)<Mc||a>=55295&&a<ml)&&(a=2):(a=3,++f<c&&(-64&(n=t.charCodeAt(f)))==Zn&&e<Mo&&((a=n-63447168+(r<<6))<rs||a>nl)&&(a=3))))),a<4?(f-=a,i+="�"):i+=a>ki?String.fromCharCode(55232+(a>>10),Ji+(a&va)):String.fromCharCode(a),i.length>Nu&&(i.substr(0,1),u+=i,i=mb);}return u+i}function d(t){switch(t.t){case 9:return t.c;default:k(t);case 0:if(p(t.c))return t.t=9,t.c;t.t=8;case 8:return h(t.c)}}function m(t,r,e){this.t=t,this.c=r,this.l=e;}function y(t){return new m(0,t,t.length)}function w(t,r){e(t,y(r));}function g(t){w(Gd.Invalid_argument,t);}function T(){g(pu);}function _(t,r,e){if(e&=lh,4!=t.t){if(r==t.c.length)return t.c+=String.fromCharCode(e),r+1==t.l&&(t.t=0),0;v(t);}return t.c[r]=e,0}function S(t,r,e){return r>>>0>=t.l&&T(),_(t,r,e)}function A(t,r){for(var e=t.length,n=new Array(e+1),a=0;a<e;a++)n[a]=t[a];return n[a]=r,n}function E(t,r){if(t.fun)return E(t.fun,r);var e=t.length,n=r.length,a=e-n;return 0==a?t.apply(null,r):a<0?E(t.apply(null,s(r,0,e)),s(r,e,n-e)):function(e){return E(t,A(r,e))}}function x(){g(pu);}function I(t,r){return r>>>0>=t.length-1&&x(),t}function C(t){return isFinite(t)?Math.abs(t)>=2.2250738585072014e-308?0:0!=t?1:2:isNaN(t)?4:3}function N(t,r){var e=t[3]<<16,n=r[3]<<16;return e>n?1:e<n?-1:t[2]>r[2]?1:t[2]<r[2]?-1:t[1]>r[1]?1:t[1]<r[1]?-1:0}function R(t,r){return t<r?-1:t==r?0:1}function L(t,r){return 6&t.t&&k(t),6&r.t&&k(r),t.c<r.c?-1:t.c>r.c?1:0}function P(t,r,e){for(var n=[];;){if(!e||t!==r)if(t instanceof m){if(!(r instanceof m))return 1;if(t!==r&&0!=(i=L(t,r)))return i}else if(t instanceof Array&&t[0]===(0|t[0])){var a=t[0];if(a===Cn&&(a=0),a===Ql){t=t[1];continue}if(!(r instanceof Array&&r[0]===(0|r[0])))return 1;var u=r[0];if(u===Cn&&(u=0),u===Ql){r=r[1];continue}if(a!=u)return a<u?-1:1;switcLine truncated
function createError$1(t,r,e){const n=new SyntaxError(t+" ("+r+":"+e+")");return n.loc={line:r,column:e},n}function createCommonjsModule(t,r){return r={exports:{}},t(r,r.exports),r.exports}function parse(t){const r=flow_parser.parse(t,{esproposal_class_instance_fields:!0,esproposal_class_static_fields:!0,esproposal_export_star_as:!0});if(r.errors.length>0)throw createError(r.errors[0].message,r.errors[0].loc.start.line,r.errors[0].loc.start.column+1);return r}var parserCreateError=createError$1; var flow_parser=createCommonjsModule(function(t,r){!function(t){"use strict";function e(t,r){throw[0,t,r]}function n(t,r){function n(r){e(Gd.Undefined_recursive_module,t);}function a(t,r,e){if("number"==typeof t)switch(t){case 0:r[e]={fun:n};break;case 1:r[e]=[ls,n];break;default:r[e]=[];}else switch(t[0]){case 0:r[e]=[0];for(var u=1;u<t[1].length;u++)a(t[1][u],r[e],u);break;default:r[e]=t[1];}}var u=[];return a(r,u,0),u[0]}function a(t,r){if(typeof r===Pk)return t.fun=r,0;if(r.fun)return t.fun=r.fun,0;for(var e=r.length;e--;)t[e]=r[e];return 0}function u(t,r,e){if("number"==typeof t)switch(t){case 0:r.fun=e;break;case 1:default:a(r,e);}else switch(t[0]){case 0:for(var n=1;n<t[1].length;n++)u(t[1][n],r[n],e[n]);}return 0}function i(t,r){var e=t.length,n=e+r.length-1,a=new Array(n);a[0]=0;for(var u=1,i=1;u<e;u++)a[u]=t[u];for(;u<n;u++,i++)a[u]=r[i];return a}function f(t,r,e,n,a){if(n<=r)for(u=1;u<=a;u++)e[n+u]=t[r+u];else for(var u=a;u>=1;u--)e[n+u]=t[r+u];return 0}function c(t,r,e){var n=new Array(e+1);n[0]=0;for(var a=1,u=r+1;a<=e;a++,u++)n[a]=t[u];return n}function s(t,r,e){for(var n=new Array(e),a=0;a<e;a++)n[a]=t[r+a];return n}function o(t,r,e){var n=String.fromCharCode;if(0==r&&e<=4096&&e==t.length)return n.apply(null,t);for(var a=mb;0<e;r+=Nu,e-=Nu)a+=n.apply(null,s(t,r,Math.min(e,Nu)));return a}function v(r){if(t.Uint8Array)e=new t.Uint8Array(r.l);else var e=new Array(r.l);for(var n=r.c,a=n.length,u=0;u<a;u++)e[u]=n.charCodeAt(u);for(a=r.l;u<a;u++)e[u]=0;return r.c=e,r.t=4,e}function l(t,r,e,n,a){if(0==a)return 0;if(0==n&&(a>=e.l||2==e.t&&a>=e.c.length))e.c=4==t.t?o(t.c,r,a):0==r&&t.c.length==a?t.c:t.c.substr(r,a),e.t=e.c.length==e.l?0:2;else if(2==e.t&&n==e.c.length)e.c+=4==t.t?o(t.c,r,a):0==r&&t.c.length==a?t.c:t.c.substr(r,a),e.t=e.c.length==e.l?0:2;else{4!=e.t&&v(e);var u=t.c,i=e.c;if(4==t.t)if(n<=r)for(c=0;c<a;c++)i[n+c]=u[r+c];else for(c=a-1;c>=0;c--)i[n+c]=u[r+c];else{for(var f=Math.min(a,u.length-r),c=0;c<f;c++)i[n+c]=u.charCodeAt(r+c);for(;c<a;c++)i[n+c]=0;}}return 0}function b(t,r){if(r.repeat)return r.repeat(t);var e=mb,n=0;if(0==t)return e;for(;;){if(1&t&&(e+=r),0==(t>>=1))return e;r+=r,9==++n&&r.slice(0,1);}}function k(t){2==t.t?t.c+=b(t.l-t.c.length,"\0"):t.c=o(t.c,0,t.c.length),t.t=0;}function p(t){if(t.length<24){for(var r=0;r<t.length;r++)if(t.charCodeAt(r)>Kb)return!1;return!0}return!/[^\x00-\x7f]/.test(t)}function h(t){for(var r,e,n,a,u=mb,i=mb,f=0,c=t.length;f<c;f++){if((e=t.charCodeAt(f))<Zn){for(var s=f+1;s<c&&(e=t.charCodeAt(s))<Zn;s++);if(s-f>Hn?(i.substr(0,1),u+=i,i=mb,u+=t.slice(f,s)):i+=t.slice(f,s),s==c)break;f=s;}a=1,++f<c&&(-64&(n=t.charCodeAt(f)))==Zn&&(r=n+(e<<6),e<Jl?(a=r-12416)<Zn&&(a=1):(a=2,++f<c&&(-64&(n=t.charCodeAt(f)))==Zn&&(r=n+(r<<6),e<$p?((a=r-925824)<Mc||a>=55295&&a<ml)&&(a=2):(a=3,++f<c&&(-64&(n=t.charCodeAt(f)))==Zn&&e<Mo&&((a=n-63447168+(r<<6))<rs||a>nl)&&(a=3))))),a<4?(f-=a,i+="�"):i+=a>ki?String.fromCharCode(55232+(a>>10),Ji+(a&va)):String.fromCharCode(a),i.length>Nu&&(i.substr(0,1),u+=i,i=mb);}return u+i}function d(t){switch(t.t){case 9:return t.c;default:k(t);case 0:if(p(t.c))return t.t=9,t.c;t.t=8;case 8:return h(t.c)}}function m(t,r,e){this.t=t,this.c=r,this.l=e;}function y(t){return new m(0,t,t.length)}function w(t,r){e(t,y(r));}function g(t){w(Gd.Invalid_argument,t);}function T(){g(pu);}function _(t,r,e){if(e&=lh,4!=t.t){if(r==t.c.length)return t.c+=String.fromCharCode(e),r+1==t.l&&(t.t=0),0;v(t);}return t.c[r]=e,0}function S(t,r,e){return r>>>0>=t.l&&T(),_(t,r,e)}function A(t,r){for(var e=t.length,n=new Array(e+1),a=0;a<e;a++)n[a]=t[a];return n[a]=r,n}function E(t,r){if(t.fun)return E(t.fun,r);var e=t.length,n=r.length,a=e-n;return 0==a?t.apply(null,r):a<0?E(t.apply(null,s(r,0,e)),s(r,e,n-e)):function(e){return E(t,A(r,e))}}function x(){g(pu);}function I(t,r){return r>>>0>=t.length-1&&x(),t}function C(t){return isFinite(t)?Math.abs(t)>=2.2250738585072014e-308?0:0!=t?1:2:isNaN(t)?4:3}function N(t,r){var e=t[3]<<16,n=r[3]<<16;return e>n?1:e<n?-1:t[2]>r[2]?1:t[2]<r[2]?-1:t[1]>r[1]?1:t[1]<r[1]?-1:0}function R(t,r){return t<r?-1:t==r?0:1}function L(t,r){return 6&t.t&&k(t),6&r.t&&k(r),t.c<r.c?-1:t.c>r.c?1:0}function P(t,r,e){for(var n=[];;){if(!e||t!==r)if(t instanceof m){if(!(r instanceof m))return 1;if(t!==r&&0!=(i=L(t,r)))return i}else if(t instanceof Array&&t[0]===(0|t[0])){var a=t[0];if(a===Cn&&(a=0),a===Ql){t=t[1];continue}if(!(r instanceof Array&&r[0]===(0|r[0])))return 1;var u=r[0];if(u===Cn&&(u=0),u===Ql){r=r[1];continue}if(a!=u)return a<u?-1:1;swiLine truncated
return parserFlow_1;
+1 -1
View File
@@ -2231,7 +2231,7 @@ function createCommonjsModule(fn, module) {
}
var parserTypescript_1 = createCommonjsModule(function (module) {
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}function createError$1(e,t,n){const r=new SyntaxError(e+" ("+t+":"+n+")");return r.loc={line:t,column:n},r}function commonjsRequire$$1(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function createCommonjsModule$$1(e,t){return t={exports:{}},e(t,t.exports),t.exports}function toVLQSigned(e){return e<0?1+(-e<<1):0+(e<<1)}function fromVLQSigned(e){var t=e>>1;return 1==(1&e)?-t:t}function ArraySet$1(){this._array=[],this._set=Object.create(null);}function generatedPositionAfter(e,t){var n=e.generatedLine,r=t.generatedLine,a=e.generatedColumn,i=t.generatedColumn;return r>n||r==n&&i>=a||util$4.compareByGeneratedPositionsInflated(e,t)<=0}function MappingList$1(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0};}function SourceMapGenerator$1(e){e||(e={}),this._file=util.getArg(e,"file",null),this._sourceRoot=util.getArg(e,"sourceRoot",null),this._skipValidation=util.getArg(e,"skipValidation",!1),this._sources=new ArraySet,this._names=new ArraySet,this._mappings=new MappingList,this._sourcesContents=null;}function swap(e,t,n){var r=e[t];e[t]=e[n],e[n]=r;}function randomIntInRange(e,t){return Math.round(e+Math.random()*(t-e))}function doQuickSort(e,t,n,r){if(n<r){var a=n-1;swap(e,randomIntInRange(n,r),r);for(var i=e[r],o=n;o<r;o++)t(e[o],i)<=0&&swap(e,a+=1,o);swap(e,a+1,o);var s=a+1;doQuickSort(e,t,n,s-1),doQuickSort(e,t,s+1,r);}}function SourceMapConsumer$2(e){var t=e;return"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=t.sections?new IndexedSourceMapConsumer(t):new BasicSourceMapConsumer(t)}function BasicSourceMapConsumer(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var n=util$5.getArg(t,"version"),r=util$5.getArg(t,"sources"),a=util$5.getArg(t,"names",[]),i=util$5.getArg(t,"sourceRoot",null),o=util$5.getArg(t,"sourcesContent",null),s=util$5.getArg(t,"mappings"),c=util$5.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);r=r.map(String).map(util$5.normalize).map(function(e){return i&&util$5.isAbsolute(i)&&util$5.isAbsolute(e)?util$5.relative(i,e):e}),this._names=ArraySet$2.fromArray(a.map(String),!0),this._sources=ArraySet$2.fromArray(r,!0),this.sourceRoot=i,this.sourcesContent=o,this._mappings=s,this.file=c;}function Mapping(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null;}function IndexedSourceMapConsumer(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var n=util$5.getArg(t,"version"),r=util$5.getArg(t,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new ArraySet$2,this._names=new ArraySet$2;var a={line:-1,column:0};this._sections=r.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=util$5.getArg(e,"offset"),n=util$5.getArg(t,"line"),r=util$5.getArg(t,"column");if(n<a.line||n===a.line&&r<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=t,{generatedOffset:{generatedLine:n+1,generatedColumn:r+1},consumer:new SourceMapConsumer$2(util$5.getArg(e,"map"))}});}function SourceNode$1(e,t,n,r,a){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==a?null:a,this[isSourceNode]=!0,null!=r&&this.add(r);}function isInBrowser(){return"browser"===environment||"node"!==environment&&("undefined"!=typeof window&&"function"==typeof XMLHttpRequest&&!(window.require&&window.module&&window.process&&"renderer"===window.process.type))}function hasGlobalProcessEventEmitter(){return"object"==typeof process&&null!==process&&"function"==typeof process.on}function handlerExec(e){return function(t){for(var n=0;n<e.length;n++){var r=e[n](t);if(r)return r}return null}}function supportRelativeURL(e,t){if(!e)return t;var n=path$1.dirname(e),r=/^\w+:\/\/[^\/]*/.exec(n),a=r?r[0]:"";return a+path$1.resolve(n.slice(a.length),t)}function retrieveSourceMapURL(e){var t;if(isInBrowser())try{var n=new XMLHttpRequest;n.open("GET",e,!1),n.send(null),t=4===n.readyState?n.responseText:null;var r=n.getResponseHeader("SourceMap")||n.getResponseHeader("X-SourceMap");if(r)return r}catch(e){}t=retrieveFile(e);for(var a,i,o=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/)[ \t]*$)/gm;i=o.exec(t);)a=i;return a?a[1]:null}function mapSourcePosition(e){var t=sourceMapCache[e.source];if(!t){var n=retrieveSourceMap(e.source);n?(t=sourceMapCache[e.source]={url:n.url,map:new SourceMapConsumer(n.map)}).map.sourcesContent&&t.map.sources.forEach(function(e,n){var r=t.map.sourcesContent[n];if(r){var a=supportRelativeURL(t.url,e);fileContentsCache[a]=r;}}):t=sourceMapCache[e.source]={url:null,map:null};}if(t&&t.map){var r=t.map.originalPositionFor(e);if(null!=Line truncated
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}function createError$1(e,t,n){const r=new SyntaxError(e+" ("+t+":"+n+")");return r.loc={line:t,column:n},r}function commonjsRequire$$1(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function createCommonjsModule$$1(e,t){return t={exports:{}},e(t,t.exports),t.exports}function toVLQSigned(e){return e<0?1+(-e<<1):0+(e<<1)}function fromVLQSigned(e){var t=e>>1;return 1==(1&e)?-t:t}function ArraySet$1(){this._array=[],this._set=Object.create(null);}function generatedPositionAfter(e,t){var n=e.generatedLine,r=t.generatedLine,a=e.generatedColumn,i=t.generatedColumn;return r>n||r==n&&i>=a||util$4.compareByGeneratedPositionsInflated(e,t)<=0}function MappingList$1(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0};}function SourceMapGenerator$1(e){e||(e={}),this._file=util.getArg(e,"file",null),this._sourceRoot=util.getArg(e,"sourceRoot",null),this._skipValidation=util.getArg(e,"skipValidation",!1),this._sources=new ArraySet,this._names=new ArraySet,this._mappings=new MappingList,this._sourcesContents=null;}function swap(e,t,n){var r=e[t];e[t]=e[n],e[n]=r;}function randomIntInRange(e,t){return Math.round(e+Math.random()*(t-e))}function doQuickSort(e,t,n,r){if(n<r){var a=n-1;swap(e,randomIntInRange(n,r),r);for(var i=e[r],o=n;o<r;o++)t(e[o],i)<=0&&swap(e,a+=1,o);swap(e,a+1,o);var s=a+1;doQuickSort(e,t,n,s-1),doQuickSort(e,t,s+1,r);}}function SourceMapConsumer$2(e){var t=e;return"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,""))),null!=t.sections?new IndexedSourceMapConsumer(t):new BasicSourceMapConsumer(t)}function BasicSourceMapConsumer(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var n=util$5.getArg(t,"version"),r=util$5.getArg(t,"sources"),a=util$5.getArg(t,"names",[]),i=util$5.getArg(t,"sourceRoot",null),o=util$5.getArg(t,"sourcesContent",null),s=util$5.getArg(t,"mappings"),c=util$5.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);r=r.map(String).map(util$5.normalize).map(function(e){return i&&util$5.isAbsolute(i)&&util$5.isAbsolute(e)?util$5.relative(i,e):e}),this._names=ArraySet$2.fromArray(a.map(String),!0),this._sources=ArraySet$2.fromArray(r,!0),this.sourceRoot=i,this.sourcesContent=o,this._mappings=s,this.file=c;}function Mapping(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null;}function IndexedSourceMapConsumer(e){var t=e;"string"==typeof e&&(t=JSON.parse(e.replace(/^\)\]\}'/,"")));var n=util$5.getArg(t,"version"),r=util$5.getArg(t,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new ArraySet$2,this._names=new ArraySet$2;var a={line:-1,column:0};this._sections=r.map(function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var t=util$5.getArg(e,"offset"),n=util$5.getArg(t,"line"),r=util$5.getArg(t,"column");if(n<a.line||n===a.line&&r<a.column)throw new Error("Section offsets must be ordered and non-overlapping.");return a=t,{generatedOffset:{generatedLine:n+1,generatedColumn:r+1},consumer:new SourceMapConsumer$2(util$5.getArg(e,"map"))}});}function SourceNode$1(e,t,n,r,a){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==a?null:a,this[isSourceNode]=!0,null!=r&&this.add(r);}function isInBrowser(){return"browser"===environment||"node"!==environment&&("undefined"!=typeof window&&"function"==typeof XMLHttpRequest&&!(window.require&&window.module&&window.process&&"renderer"===window.process.type))}function hasGlobalProcessEventEmitter(){return"object"==typeof process&&null!==process&&"function"==typeof process.on}function handlerExec(e){return function(t){for(var n=0;n<e.length;n++){var r=e[n](t);if(r)return r}return null}}function supportRelativeURL(e,t){if(!e)return t;var n=path$1.dirname(e),r=/^\w+:\/\/[^\/]*/.exec(n),a=r?r[0]:"";return a+path$1.resolve(n.slice(a.length),t)}function retrieveSourceMapURL(e){var t;if(isInBrowser())try{var n=new XMLHttpRequest;n.open("GET",e,!1),n.send(null),t=4===n.readyState?n.responseText:null;var r=n.getResponseHeader("SourceMap")||n.getResponseHeader("X-SourceMap");if(r)return r}catch(e){}t=retrieveFile(e);for(var a,i,o=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^\*]+?)[ \t]*(?:\*\/)[ \t]*$)/gm;i=o.exec(t);)a=i;return a?a[1]:null}function mapSourcePosition(e){var t=sourceMapCache[e.source];if(!t){var n=retrieveSourceMap(e.source);n?(t=sourceMapCache[e.source]={url:n.url,map:new SourceMapConsumer(n.map)}).map.sourcesContent&&t.map.sources.forEach(function(e,n){var r=t.map.sourcesContent[n];if(r){var a=supportRelativeURL(t.url,e);fileContentsCache[a]=r;}}):t=sourceMapCache[e.source]={url:null,map:null};}if(t&&t.map){var r=t.map.originalPositionFor(e);if(null!=Line truncated
});
var parserTypescript = unwrapExports(parserTypescript_1);
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "prettier",
"version": "1.4.0-beta",
"version": "1.4.0",
"description": "Prettier is an opinionated JavaScript formatter",
"bin": {
"prettier": "./bin/prettier.js"