prettier 1.10.1 → 1.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{bin/prettier.js → bin-prettier.js} +86 -91
- package/index.js +7 -11
- package/package.json +3 -5
- package/parser-vue.js +1 -1
|
@@ -9,14 +9,14 @@ var path = _interopDefault(require('path'));
|
|
|
9
9
|
var util = _interopDefault(require('util'));
|
|
10
10
|
var url = _interopDefault(require('url'));
|
|
11
11
|
var assert = _interopDefault(require('assert'));
|
|
12
|
-
var thirdParty = require('
|
|
12
|
+
var thirdParty = require('./third-party');
|
|
13
13
|
var thirdParty__default = thirdParty['default'];
|
|
14
14
|
var events = _interopDefault(require('events'));
|
|
15
15
|
var readline = _interopDefault(require('readline'));
|
|
16
16
|
|
|
17
17
|
var minimist = function (args, opts) {
|
|
18
18
|
if (!opts) opts = {};
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
var flags = { bools : {}, strings : {}, unknownFn: null };
|
|
21
21
|
|
|
22
22
|
if (typeof opts['unknown'] === 'function') {
|
|
@@ -30,7 +30,7 @@ var minimist = function (args, opts) {
|
|
|
30
30
|
flags.bools[key] = true;
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
|
|
34
34
|
var aliases = {};
|
|
35
35
|
Object.keys(opts.alias || {}).forEach(function (key) {
|
|
36
36
|
aliases[key] = [].concat(opts.alias[key]);
|
|
@@ -49,12 +49,12 @@ var minimist = function (args, opts) {
|
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
var defaults = opts['default'] || {};
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
var argv = { _ : [] };
|
|
54
54
|
Object.keys(flags.bools).forEach(function (key) {
|
|
55
55
|
setArg(key, defaults[key] === undefined ? false : defaults[key]);
|
|
56
56
|
});
|
|
57
|
-
|
|
57
|
+
|
|
58
58
|
var notFlags = [];
|
|
59
59
|
|
|
60
60
|
if (args.indexOf('--') !== -1) {
|
|
@@ -75,7 +75,7 @@ var minimist = function (args, opts) {
|
|
|
75
75
|
var value = !flags.strings[key] && isNumber(val)
|
|
76
76
|
? Number(val) : val;
|
|
77
77
|
setKey(argv, key.split('.'), value);
|
|
78
|
-
|
|
78
|
+
|
|
79
79
|
(aliases[key] || []).forEach(function (x) {
|
|
80
80
|
setKey(argv, x.split('.'), value);
|
|
81
81
|
});
|
|
@@ -99,7 +99,7 @@ var minimist = function (args, opts) {
|
|
|
99
99
|
o[key] = [ o[key], value ];
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
|
|
102
|
+
|
|
103
103
|
function aliasIsBoolean(key) {
|
|
104
104
|
return aliases[key].some(function (x) {
|
|
105
105
|
return flags.bools[x];
|
|
@@ -108,7 +108,7 @@ var minimist = function (args, opts) {
|
|
|
108
108
|
|
|
109
109
|
for (var i = 0; i < args.length; i++) {
|
|
110
110
|
var arg = args[i];
|
|
111
|
-
|
|
111
|
+
|
|
112
112
|
if (/^--.+=/.test(arg)) {
|
|
113
113
|
// Using [\s\S] instead of . because js doesn't support the
|
|
114
114
|
// 'dotall' regex modifier. See:
|
|
@@ -145,29 +145,29 @@ var minimist = function (args, opts) {
|
|
|
145
145
|
}
|
|
146
146
|
else if (/^-[^-]+/.test(arg)) {
|
|
147
147
|
var letters = arg.slice(1,-1).split('');
|
|
148
|
-
|
|
148
|
+
|
|
149
149
|
var broken = false;
|
|
150
150
|
for (var j = 0; j < letters.length; j++) {
|
|
151
151
|
var next = arg.slice(j+2);
|
|
152
|
-
|
|
152
|
+
|
|
153
153
|
if (next === '-') {
|
|
154
154
|
setArg(letters[j], next, arg);
|
|
155
155
|
continue;
|
|
156
156
|
}
|
|
157
|
-
|
|
157
|
+
|
|
158
158
|
if (/[A-Za-z]/.test(letters[j]) && /=/.test(next)) {
|
|
159
159
|
setArg(letters[j], next.split('=')[1], arg);
|
|
160
160
|
broken = true;
|
|
161
161
|
break;
|
|
162
162
|
}
|
|
163
|
-
|
|
163
|
+
|
|
164
164
|
if (/[A-Za-z]/.test(letters[j])
|
|
165
165
|
&& /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
|
|
166
166
|
setArg(letters[j], next, arg);
|
|
167
167
|
broken = true;
|
|
168
168
|
break;
|
|
169
169
|
}
|
|
170
|
-
|
|
170
|
+
|
|
171
171
|
if (letters[j+1] && letters[j+1].match(/\W/)) {
|
|
172
172
|
setArg(letters[j], arg.slice(j+2), arg);
|
|
173
173
|
broken = true;
|
|
@@ -177,7 +177,7 @@ var minimist = function (args, opts) {
|
|
|
177
177
|
setArg(letters[j], flags.strings[letters[j]] ? '' : true, arg);
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
|
|
180
|
+
|
|
181
181
|
var key = arg.slice(-1)[0];
|
|
182
182
|
if (!broken && key !== '-') {
|
|
183
183
|
if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1])
|
|
@@ -207,17 +207,17 @@ var minimist = function (args, opts) {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
|
|
210
|
+
|
|
211
211
|
Object.keys(defaults).forEach(function (key) {
|
|
212
212
|
if (!hasKey(argv, key.split('.'))) {
|
|
213
213
|
setKey(argv, key.split('.'), defaults[key]);
|
|
214
|
-
|
|
214
|
+
|
|
215
215
|
(aliases[key] || []).forEach(function (x) {
|
|
216
216
|
setKey(argv, x.split('.'), defaults[key]);
|
|
217
217
|
});
|
|
218
218
|
}
|
|
219
219
|
});
|
|
220
|
-
|
|
220
|
+
|
|
221
221
|
if (opts['--']) {
|
|
222
222
|
argv['--'] = new Array();
|
|
223
223
|
notFlags.forEach(function(key) {
|
|
@@ -368,7 +368,7 @@ print = print;var _detectNewline;function _load_detectNewline() {return _detectN
|
|
|
368
368
|
* This source code is licensed under the MIT license found in the
|
|
369
369
|
* LICENSE file in the root directory of this source tree.
|
|
370
370
|
*
|
|
371
|
-
*
|
|
371
|
+
*
|
|
372
372
|
*/const commentEndRe = /\*\/$/;const commentStartRe = /^\/\*\*/;const docblockRe = /^\s*(\/\*\*?(.|\r?\n)*?\*\/)/;const lineCommentRe = /(^|\s+)\/\/([^\r\n]*)/g;const ltrimRe = /^\s*/;const rtrimRe = /\s*$/;const ltrimNewlineRe = /^(\r?\n)+/;const multilineRe = /(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *(?![^@\r\n]*\/\/[^]*)([^@\r\n\s][^@\r\n]+?) *\r?\n/g;const propertyRe = /(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g;const stringStartRe = /(\r?\n|^) *\* ?/g;function extract(contents) {const match = contents.match(docblockRe);return match ? match[0].replace(ltrimRe, '') || '' : '';}function strip(contents) {const match = contents.match(docblockRe);return match && match[0] ? contents.substring(match[0].length) : contents;}function parse(docblock) {return parseWithComments(docblock).pragmas;}function parseWithComments(docblock) {const line = (0, (_detectNewline || _load_detectNewline()).default)(docblock) || (_os || _load_os()).EOL;docblock = docblock.replace(commentStartRe, '').replace(commentEndRe, '').replace(stringStartRe, '$1'); // Normalize multi-line directives
|
|
373
373
|
let prev = '';while (prev !== docblock) {prev = docblock;docblock = docblock.replace(multilineRe, `${line}$1 $2${line}`);}docblock = docblock.replace(ltrimNewlineRe, '').replace(rtrimRe, '');const result = Object.create(null);const comments = docblock.replace(propertyRe, '').replace(ltrimNewlineRe, '').replace(rtrimRe, '');let match;while (match = propertyRe.exec(docblock)) {// strip linecomments from pragmas
|
|
374
374
|
result[match[1]] = match[2].replace(lineCommentRe, '');}return { comments, pragmas: result };}function print(_ref) {var _ref$comments = _ref.comments;let comments = _ref$comments === undefined ? '' : _ref$comments;var _ref$pragmas = _ref.pragmas;let pragmas = _ref$pragmas === undefined ? {} : _ref$pragmas;const line = (0, (_detectNewline || _load_detectNewline()).default)(comments) || (_os || _load_os()).EOL;const head = '/**';
|
|
@@ -414,7 +414,7 @@ function printKeyValue(key, value) {
|
|
|
414
414
|
unwrapExports(build);
|
|
415
415
|
|
|
416
416
|
var name = "prettier";
|
|
417
|
-
var version$1 = "1.10.
|
|
417
|
+
var version$1 = "1.10.2";
|
|
418
418
|
var description = "Prettier is an opinionated code formatter";
|
|
419
419
|
var bin = {"prettier":"./bin/prettier.js"};
|
|
420
420
|
var repository = "prettier/prettier";
|
|
@@ -424,7 +424,7 @@ var license = "MIT";
|
|
|
424
424
|
var main = "./index.js";
|
|
425
425
|
var engines = {"node":">=4"};
|
|
426
426
|
var dependencies = {"@babel/code-frame":"7.0.0-beta.35","@glimmer/syntax":"0.30.3","babylon":"7.0.0-beta.34","camelcase":"4.1.0","chalk":"2.1.0","cjk-regex":"1.0.2","cosmiconfig":"3.1.0","dashify":"0.2.2","dedent":"0.7.0","diff":"3.2.0","editorconfig":"0.14.2","editorconfig-to-prettier":"0.0.6","emoji-regex":"6.5.1","escape-string-regexp":"1.0.5","esutils":"2.0.2","find-project-root":"1.1.1","flow-parser":"0.59.0","get-stream":"3.0.0","globby":"6.1.0","graphql":"0.12.3","ignore":"3.3.7","jest-docblock":"21.3.0-beta.11","jest-validate":"21.1.0","leven":"2.1.0","mem":"1.1.0","minimatch":"3.0.4","minimist":"1.2.0","parse5":"3.0.3","postcss-less":"1.1.3","postcss-media-query-parser":"0.2.3","postcss-scss":"1.0.2","postcss-selector-parser":"2.2.3","postcss-values-parser":"1.3.1","read-pkg-up":"3.0.0","remark-frontmatter":"1.1.0","remark-parse":"4.0.0","resolve":"1.5.0","semver":"5.4.1","string-width":"2.1.1","typescript":"2.7.0-insiders.20171214","typescript-eslint-parser":"11.0.0","unicode-regex":"1.0.1","unified":"6.1.6"};
|
|
427
|
-
var devDependencies = {"babel-cli":"6.24.1","babel-preset-es2015":"6.24.1","codecov":"2.2.0","cross-env":"5.0.5","eslint":"4.1.1","eslint-config-prettier":"2.9.0","eslint-friendly-formatter":"3.0.0","eslint-plugin-import":"2.6.1","eslint-plugin-prettier":"2.4.0","eslint-plugin-react":"7.1.0","jest":"21.1.0","mkdirp":"0.5.1","prettier":"1.
|
|
427
|
+
var devDependencies = {"babel-cli":"6.24.1","babel-preset-es2015":"6.24.1","codecov":"2.2.0","cross-env":"5.0.5","eslint":"4.1.1","eslint-config-prettier":"2.9.0","eslint-friendly-formatter":"3.0.0","eslint-plugin-import":"2.6.1","eslint-plugin-prettier":"2.4.0","eslint-plugin-react":"7.1.0","jest":"21.1.0","mkdirp":"0.5.1","prettier":"1.10.1","prettylint":"1.0.0","rimraf":"2.6.2","rollup":"0.47.6","rollup-plugin-commonjs":"8.2.6","rollup-plugin-json":"2.1.1","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.2.1","shelljs":"0.7.8","snapshot-diff":"0.2.2","strip-ansi":"4.0.0","sw-toolbox":"3.6.0","uglify-es":"3.0.28","webpack":"2.6.1"};
|
|
428
428
|
var scripts = {"prepublishOnly":"echo \"Error: must publish from dist/\" && exit 1","prepare-release":"yarn && yarn build && yarn test:dist","test":"jest","test:dist":"cross-env NODE_ENV=production yarn test","test-integration":"jest tests_integration","lint":"cross-env EFF_NO_LINK_RULES=true eslint . --format node_modules/eslint-friendly-formatter","lint-docs":"prettylint {.,docs,website,website/blog}/*.md","build":"node ./scripts/build/build.js","build-docs":"node ./scripts/build/build-docs.js","check-deps":"node ./scripts/check-deps.js"};
|
|
429
429
|
var _package = {
|
|
430
430
|
name: name,
|
|
@@ -18473,22 +18473,18 @@ function genericPrint$5(path$$1, options, print) {
|
|
|
18473
18473
|
const n = path$$1.getValue();
|
|
18474
18474
|
const res = [];
|
|
18475
18475
|
let index = n.start;
|
|
18476
|
-
let printParent = typeof n.end === "number";
|
|
18477
18476
|
|
|
18478
18477
|
path$$1.each(childPath => {
|
|
18479
18478
|
const child = childPath.getValue();
|
|
18480
18479
|
res.push(options.originalText.slice(index, child.start));
|
|
18481
18480
|
res.push(childPath.call(print));
|
|
18482
|
-
|
|
18483
|
-
index = child.end;
|
|
18484
|
-
} else {
|
|
18485
|
-
printParent = false;
|
|
18486
|
-
}
|
|
18481
|
+
index = child.end;
|
|
18487
18482
|
}, "children");
|
|
18488
18483
|
|
|
18489
|
-
|
|
18490
|
-
|
|
18491
|
-
|
|
18484
|
+
// If there are no children, we just print the node from start to end.
|
|
18485
|
+
// Otherwise, index should point to the end of the last child, and we
|
|
18486
|
+
// need to print the closing tag.
|
|
18487
|
+
res.push(options.originalText.slice(index, n.end));
|
|
18492
18488
|
|
|
18493
18489
|
// Only force a trailing newline if there were any contents.
|
|
18494
18490
|
if (n.tag === "root" && n.children.length) {
|
|
@@ -21680,7 +21676,7 @@ printObjectProperties = printObjectProperties;const getSymbols = Object.getOwnPr
|
|
|
21680
21676
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
21681
21677
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
21682
21678
|
*
|
|
21683
|
-
*
|
|
21679
|
+
*
|
|
21684
21680
|
*/const isSymbol = key => // $FlowFixMe string literal `symbol`. This value is not a valid `typeof` return value
|
|
21685
21681
|
typeof key === 'symbol' || toString.call(key) === '[object Symbol]'; // Return entries (for example, of a map)
|
|
21686
21682
|
// with spacing, indentation, and comma
|
|
@@ -21737,7 +21733,7 @@ var asymmetric_matcher = createCommonjsModule(function (module, exports) {
|
|
|
21737
21733
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
21738
21734
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
21739
21735
|
*
|
|
21740
|
-
*
|
|
21736
|
+
*
|
|
21741
21737
|
*/const asymmetricMatcher = Symbol.for('jest.asymmetricMatcher');const SPACE = ' ';const serialize = exports.serialize = (val, config, indentation,
|
|
21742
21738
|
depth,
|
|
21743
21739
|
refs,
|
|
@@ -21859,7 +21855,7 @@ const toHumanReadableAnsi = text => {
|
|
|
21859
21855
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
21860
21856
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
21861
21857
|
*
|
|
21862
|
-
*
|
|
21858
|
+
*
|
|
21863
21859
|
*/const test = exports.test = val => typeof val === 'string' && val.match((0, _ansiRegex2.default)());const serialize = exports.serialize = (val, config, indentation,
|
|
21864
21860
|
depth,
|
|
21865
21861
|
refs,
|
|
@@ -21889,7 +21885,7 @@ escapeHTML; /**
|
|
|
21889
21885
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
21890
21886
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
21891
21887
|
*
|
|
21892
|
-
*
|
|
21888
|
+
*
|
|
21893
21889
|
*/function escapeHTML(str) {return str.replace(/</g, '<').replace(/>/g, '>');}
|
|
21894
21890
|
});
|
|
21895
21891
|
|
|
@@ -21918,7 +21914,7 @@ var _escape_html2 = _interopRequireDefault(escape_html);function _interopRequire
|
|
|
21918
21914
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
21919
21915
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
21920
21916
|
*
|
|
21921
|
-
*
|
|
21917
|
+
*
|
|
21922
21918
|
*/const printProps = exports.printProps = (keys, props, config, indentation, depth, refs, printer) => {
|
|
21923
21919
|
const indentationNext = indentation + config.indent;
|
|
21924
21920
|
const colors = config.colors;
|
|
@@ -22065,7 +22061,7 @@ var dom_element = createCommonjsModule(function (module, exports) {
|
|
|
22065
22061
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
22066
22062
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
22067
22063
|
*
|
|
22068
|
-
*
|
|
22064
|
+
*
|
|
22069
22065
|
*/
|
|
22070
22066
|
|
|
22071
22067
|
|
|
@@ -22183,7 +22179,7 @@ var immutable = createCommonjsModule(function (module, exports) {
|
|
|
22183
22179
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
22184
22180
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
22185
22181
|
*
|
|
22186
|
-
*
|
|
22182
|
+
*
|
|
22187
22183
|
*/const IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';const IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';const IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';const IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';const IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';const IS_RECORD_SENTINEL = '@@__IMMUTABLE_RECORD__@@'; // immutable v4
|
|
22188
22184
|
const IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';const IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';const IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';
|
|
22189
22185
|
const getImmutableName = name => 'Immutable.' + name;
|
|
@@ -22421,7 +22417,7 @@ var react_element = createCommonjsModule(function (module, exports) {
|
|
|
22421
22417
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
22422
22418
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
22423
22419
|
*
|
|
22424
|
-
*
|
|
22420
|
+
*
|
|
22425
22421
|
*/const elementSymbol = Symbol.for('react.element');
|
|
22426
22422
|
// Given element.props.children, or subtree during recursive traversal,
|
|
22427
22423
|
// return flattened array of children.
|
|
@@ -22514,7 +22510,7 @@ var react_test_component = createCommonjsModule(function (module, exports) {
|
|
|
22514
22510
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
22515
22511
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
22516
22512
|
*
|
|
22517
|
-
*
|
|
22513
|
+
*
|
|
22518
22514
|
*/const testSymbol = Symbol.for('react.test.json');
|
|
22519
22515
|
const serialize = exports.serialize = (
|
|
22520
22516
|
object,
|
|
@@ -22609,7 +22605,7 @@ const toString = Object.prototype.toString; /**
|
|
|
22609
22605
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
22610
22606
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
22611
22607
|
*
|
|
22612
|
-
*
|
|
22608
|
+
*
|
|
22613
22609
|
*/const toISOString = Date.prototype.toISOString;const errorToString = Error.prototype.toString;const regExpToString = RegExp.prototype.toString;const symbolToString = Symbol.prototype.toString;const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;const NEWLINE_REGEXP = /\n/gi;
|
|
22614
22610
|
function isToStringedArrayType(toStringed) {
|
|
22615
22611
|
return (
|
|
@@ -23133,7 +23129,7 @@ const BULLET = (_chalk || _load_chalk()).default.bold('\u25cf'); /**
|
|
|
23133
23129
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
23134
23130
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
23135
23131
|
*
|
|
23136
|
-
*
|
|
23132
|
+
*
|
|
23137
23133
|
*/const DEPRECATION = exports.DEPRECATION = `${BULLET} Deprecation Warning`;const ERROR = exports.ERROR = `${BULLET} Validation Error`;const WARNING = exports.WARNING = `${BULLET} Validation Warning`;const format = exports.format = value => typeof value === 'function' ? value.toString() : (0, (_prettyFormat || _load_prettyFormat()).default)(value, { min: true });
|
|
23138
23134
|
|
|
23139
23135
|
class ValidationError extends Error {
|
|
@@ -23193,7 +23189,7 @@ function _load_utils() {return _utils = utils$4;} /**
|
|
|
23193
23189
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
23194
23190
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
23195
23191
|
*
|
|
23196
|
-
*
|
|
23192
|
+
*
|
|
23197
23193
|
*/const deprecationMessage = (message, options) => {const comment = options.comment;const name = options.title && options.title.deprecation || (_utils || _load_utils()).DEPRECATION;(0, (_utils || _load_utils()).logValidationWarning)(name, message, comment);};
|
|
23198
23194
|
const deprecationWarning = exports.deprecationWarning = (
|
|
23199
23195
|
config,
|
|
@@ -23262,7 +23258,7 @@ options) =>
|
|
|
23262
23258
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
23263
23259
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
23264
23260
|
*
|
|
23265
|
-
*
|
|
23261
|
+
*
|
|
23266
23262
|
*/
|
|
23267
23263
|
});
|
|
23268
23264
|
|
|
@@ -23276,7 +23272,7 @@ var build$4 = createCommonjsModule(function (module) {
|
|
|
23276
23272
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
23277
23273
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
23278
23274
|
*
|
|
23279
|
-
*
|
|
23275
|
+
*
|
|
23280
23276
|
*/
|
|
23281
23277
|
|
|
23282
23278
|
'use strict';
|
|
@@ -23354,7 +23350,7 @@ function _load_utils() {return _utils = utils$4;}function _interopRequireDefault
|
|
|
23354
23350
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
23355
23351
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
23356
23352
|
*
|
|
23357
|
-
*
|
|
23353
|
+
*
|
|
23358
23354
|
*/const errorMessage = exports.errorMessage = (option, received, defaultValue, options) => {const message = ` Option ${(_chalk || _load_chalk()).default.bold(`"${option}"`)} must be of type:
|
|
23359
23355
|
${(_chalk || _load_chalk()).default.bold.green((0, (_jestGetType || _load_jestGetType()).default)(defaultValue))}
|
|
23360
23356
|
but instead received:
|
|
@@ -23408,7 +23404,7 @@ const config = {
|
|
|
23408
23404
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
23409
23405
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
23410
23406
|
*
|
|
23411
|
-
*
|
|
23407
|
+
*
|
|
23412
23408
|
*/exports.default = config;
|
|
23413
23409
|
});
|
|
23414
23410
|
|
|
@@ -23434,7 +23430,7 @@ validationCondition; /**
|
|
|
23434
23430
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
23435
23431
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
23436
23432
|
*
|
|
23437
|
-
*
|
|
23433
|
+
*
|
|
23438
23434
|
*/const toString = Object.prototype.toString;function validationCondition(option, validOption) {return option === null || option === undefined || toString.call(option) === toString.call(validOption);
|
|
23439
23435
|
}
|
|
23440
23436
|
});
|
|
@@ -23480,7 +23476,7 @@ function _load_utils() {return _utils = utils$4;}function _interopRequireDefault
|
|
|
23480
23476
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
23481
23477
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
23482
23478
|
*
|
|
23483
|
-
*
|
|
23479
|
+
*
|
|
23484
23480
|
*/
|
|
23485
23481
|
});
|
|
23486
23482
|
|
|
@@ -23506,7 +23502,7 @@ function _load_default_config() {return _default_config = _interopRequireDefault
|
|
|
23506
23502
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
23507
23503
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
23508
23504
|
*
|
|
23509
|
-
*
|
|
23505
|
+
*
|
|
23510
23506
|
*/const _validate = (config, options) => {let hasDeprecationWarnings = false;for (const key in config) {if (options.deprecatedConfig && key in options.deprecatedConfig &&
|
|
23511
23507
|
typeof options.deprecate === 'function')
|
|
23512
23508
|
{
|
|
@@ -23582,7 +23578,7 @@ function _load_validate() {return _validate = _interopRequireDefault(validate_1)
|
|
|
23582
23578
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
23583
23579
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
23584
23580
|
*
|
|
23585
|
-
*
|
|
23581
|
+
*
|
|
23586
23582
|
*/module.exports = { ValidationError: (_utils || _load_utils()).ValidationError, createDidYouMeanMessage: (_utils || _load_utils()).createDidYouMeanMessage, format: (_utils || _load_utils()).format, logValidationWarning: (_utils || _load_utils()).logValidationWarning, validate: (_validate || _load_validate()).default };
|
|
23587
23583
|
});
|
|
23588
23584
|
|
|
@@ -27126,7 +27122,7 @@ PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) {
|
|
|
27126
27122
|
if (values instanceof Promise) {
|
|
27127
27123
|
values = values._target();
|
|
27128
27124
|
var bitField = values._bitField;
|
|
27129
|
-
|
|
27125
|
+
|
|
27130
27126
|
this._values = values;
|
|
27131
27127
|
|
|
27132
27128
|
if (((bitField & 50397184) === 0)) {
|
|
@@ -27647,14 +27643,14 @@ Promise.prototype._execute = function(executor, resolve, reject) {
|
|
|
27647
27643
|
Promise.prototype._onCancel = function () {};
|
|
27648
27644
|
Promise.prototype._setOnCancel = function (handler) { };
|
|
27649
27645
|
Promise.prototype._attachCancellationCallback = function(onCancel) {
|
|
27650
|
-
|
|
27646
|
+
|
|
27651
27647
|
};
|
|
27652
27648
|
Promise.prototype._captureStackTrace = function () {};
|
|
27653
27649
|
Promise.prototype._attachExtraTrace = function () {};
|
|
27654
27650
|
Promise.prototype._clearCancellationData = function() {};
|
|
27655
27651
|
Promise.prototype._propagateFrom = function (parent, flags) {
|
|
27656
|
-
|
|
27657
|
-
|
|
27652
|
+
|
|
27653
|
+
|
|
27658
27654
|
};
|
|
27659
27655
|
|
|
27660
27656
|
function cancellationExecute(executor, resolve, reject) {
|
|
@@ -29022,7 +29018,7 @@ Promise.join = function () {
|
|
|
29022
29018
|
if (maybePromise instanceof Promise) {
|
|
29023
29019
|
maybePromise = maybePromise._target();
|
|
29024
29020
|
var bitField = maybePromise._bitField;
|
|
29025
|
-
|
|
29021
|
+
|
|
29026
29022
|
if (((bitField & 50397184) === 0)) {
|
|
29027
29023
|
maybePromise._then(callbacks[i], reject,
|
|
29028
29024
|
undefined, ret, holder);
|
|
@@ -29139,7 +29135,7 @@ MappingPromiseArray.prototype._promiseFulfilled = function (value, index) {
|
|
|
29139
29135
|
if (maybePromise instanceof Promise) {
|
|
29140
29136
|
maybePromise = maybePromise._target();
|
|
29141
29137
|
var bitField = maybePromise._bitField;
|
|
29142
|
-
|
|
29138
|
+
|
|
29143
29139
|
if (((bitField & 50397184) === 0)) {
|
|
29144
29140
|
if (limit >= 1) this._inFlight++;
|
|
29145
29141
|
values[index] = maybePromise;
|
|
@@ -29841,7 +29837,7 @@ PromiseSpawn.prototype._continue = function (result) {
|
|
|
29841
29837
|
}
|
|
29842
29838
|
maybePromise = maybePromise._target();
|
|
29843
29839
|
var bitField = maybePromise._bitField;
|
|
29844
|
-
|
|
29840
|
+
|
|
29845
29841
|
if (((bitField & 50397184) === 0)) {
|
|
29846
29842
|
this._yieldedPromise = maybePromise;
|
|
29847
29843
|
maybePromise._proxy(this, null);
|
|
@@ -30467,8 +30463,8 @@ function ReductionPromiseArray(promises, fn, initialValue, _each) {
|
|
|
30467
30463
|
util$$1.inherits(ReductionPromiseArray, PromiseArray);
|
|
30468
30464
|
|
|
30469
30465
|
ReductionPromiseArray.prototype._gotAccum = function(accum) {
|
|
30470
|
-
if (this._eachValues !== undefined &&
|
|
30471
|
-
this._eachValues !== null &&
|
|
30466
|
+
if (this._eachValues !== undefined &&
|
|
30467
|
+
this._eachValues !== null &&
|
|
30472
30468
|
accum !== INTERNAL) {
|
|
30473
30469
|
this._eachValues.push(accum);
|
|
30474
30470
|
}
|
|
@@ -31611,28 +31607,28 @@ some(Promise, PromiseArray, apiRejection);
|
|
|
31611
31607
|
filter$1(Promise, INTERNAL);
|
|
31612
31608
|
each(Promise, INTERNAL);
|
|
31613
31609
|
any(Promise);
|
|
31614
|
-
|
|
31615
|
-
util$$1.toFastProperties(Promise);
|
|
31616
|
-
util$$1.toFastProperties(Promise.prototype);
|
|
31617
|
-
function fillTypes(value) {
|
|
31618
|
-
var p = new Promise(INTERNAL);
|
|
31619
|
-
p._fulfillmentHandler0 = value;
|
|
31620
|
-
p._rejectionHandler0 = value;
|
|
31621
|
-
p._promise0 = value;
|
|
31622
|
-
p._receiver0 = value;
|
|
31623
|
-
}
|
|
31624
|
-
// Complete slack tracking, opt out of field-type tracking and
|
|
31625
|
-
// stabilize map
|
|
31626
|
-
fillTypes({a: 1});
|
|
31627
|
-
fillTypes({b: 2});
|
|
31628
|
-
fillTypes({c: 3});
|
|
31629
|
-
fillTypes(1);
|
|
31630
|
-
fillTypes(function(){});
|
|
31631
|
-
fillTypes(undefined);
|
|
31632
|
-
fillTypes(false);
|
|
31633
|
-
fillTypes(new Promise(INTERNAL));
|
|
31634
|
-
debug.setBounds(Async.firstLineError, util$$1.lastLineError);
|
|
31635
|
-
return Promise;
|
|
31610
|
+
|
|
31611
|
+
util$$1.toFastProperties(Promise);
|
|
31612
|
+
util$$1.toFastProperties(Promise.prototype);
|
|
31613
|
+
function fillTypes(value) {
|
|
31614
|
+
var p = new Promise(INTERNAL);
|
|
31615
|
+
p._fulfillmentHandler0 = value;
|
|
31616
|
+
p._rejectionHandler0 = value;
|
|
31617
|
+
p._promise0 = value;
|
|
31618
|
+
p._receiver0 = value;
|
|
31619
|
+
}
|
|
31620
|
+
// Complete slack tracking, opt out of field-type tracking and
|
|
31621
|
+
// stabilize map
|
|
31622
|
+
fillTypes({a: 1});
|
|
31623
|
+
fillTypes({b: 2});
|
|
31624
|
+
fillTypes({c: 3});
|
|
31625
|
+
fillTypes(1);
|
|
31626
|
+
fillTypes(function(){});
|
|
31627
|
+
fillTypes(undefined);
|
|
31628
|
+
fillTypes(false);
|
|
31629
|
+
fillTypes(new Promise(INTERNAL));
|
|
31630
|
+
debug.setBounds(Async.firstLineError, util$$1.lastLineError);
|
|
31631
|
+
return Promise;
|
|
31636
31632
|
|
|
31637
31633
|
};
|
|
31638
31634
|
});
|
|
@@ -33643,12 +33639,12 @@ function traverseFolder (directory, levels, markers) {
|
|
|
33643
33639
|
}
|
|
33644
33640
|
}
|
|
33645
33641
|
|
|
33646
|
-
var findProjectRoot = function findRoot(dir, opts) {
|
|
33642
|
+
var findProjectRoot = function findRoot(dir, opts) {
|
|
33647
33643
|
if (!dir) throw new Error("Directory not defined");
|
|
33648
33644
|
opts = opts || {};
|
|
33649
33645
|
var levels = opts.maxDepth || findRoot.MAX_DEPTH;
|
|
33650
33646
|
var markers = opts.markers || findRoot.MARKERS;
|
|
33651
|
-
return traverseFolder(dir, levels, markers);
|
|
33647
|
+
return traverseFolder(dir, levels, markers);
|
|
33652
33648
|
};
|
|
33653
33649
|
|
|
33654
33650
|
var MAX_DEPTH = 9;
|
|
@@ -39406,7 +39402,6 @@ exports. /*istanbul ignore end*/Diff = _base2['default'];
|
|
|
39406
39402
|
|
|
39407
39403
|
unwrapExports(lib$5);
|
|
39408
39404
|
|
|
39409
|
-
const prettier$4 = require("../index");
|
|
39410
39405
|
const cleanAST = cleanAst.cleanAST;
|
|
39411
39406
|
|
|
39412
39407
|
|
|
@@ -39501,7 +39496,7 @@ function listDifferent(argv, input, options, filename) {
|
|
|
39501
39496
|
|
|
39502
39497
|
options = Object.assign({}, options, { filepath: filename });
|
|
39503
39498
|
|
|
39504
|
-
if (!prettier$
|
|
39499
|
+
if (!prettier$2.check(input, options)) {
|
|
39505
39500
|
if (!argv["write"]) {
|
|
39506
39501
|
logger.log(filename);
|
|
39507
39502
|
}
|
|
@@ -39513,13 +39508,13 @@ function listDifferent(argv, input, options, filename) {
|
|
|
39513
39508
|
|
|
39514
39509
|
function format$1(argv, input, opt) {
|
|
39515
39510
|
if (argv["debug-print-doc"]) {
|
|
39516
|
-
const doc = prettier$
|
|
39517
|
-
return { formatted: prettier$
|
|
39511
|
+
const doc = prettier$2.__debug.printToDoc(input, opt);
|
|
39512
|
+
return { formatted: prettier$2.__debug.formatDoc(doc) };
|
|
39518
39513
|
}
|
|
39519
39514
|
|
|
39520
39515
|
if (argv["debug-check"]) {
|
|
39521
|
-
const pp = prettier$
|
|
39522
|
-
const pppp = prettier$
|
|
39516
|
+
const pp = prettier$2.format(input, opt);
|
|
39517
|
+
const pppp = prettier$2.format(pp, opt);
|
|
39523
39518
|
if (pp !== pppp) {
|
|
39524
39519
|
throw new errors$2.DebugError(
|
|
39525
39520
|
"prettier(input) !== prettier(prettier(input))\n" + diff(pp, pppp)
|
|
@@ -39527,11 +39522,11 @@ function format$1(argv, input, opt) {
|
|
|
39527
39522
|
} else {
|
|
39528
39523
|
const normalizedOpts = normalizeOptions$1(opt);
|
|
39529
39524
|
const ast = cleanAST(
|
|
39530
|
-
prettier$
|
|
39525
|
+
prettier$2.__debug.parse(input, opt).ast,
|
|
39531
39526
|
normalizedOpts
|
|
39532
39527
|
);
|
|
39533
39528
|
const past = cleanAST(
|
|
39534
|
-
prettier$
|
|
39529
|
+
prettier$2.__debug.parse(pp, opt).ast,
|
|
39535
39530
|
normalizedOpts
|
|
39536
39531
|
);
|
|
39537
39532
|
|
|
@@ -39552,7 +39547,7 @@ function format$1(argv, input, opt) {
|
|
|
39552
39547
|
return { formatted: opt.filepath || "(stdin)\n" };
|
|
39553
39548
|
}
|
|
39554
39549
|
|
|
39555
|
-
return prettier$
|
|
39550
|
+
return prettier$2.formatWithCursor(input, opt);
|
|
39556
39551
|
}
|
|
39557
39552
|
|
|
39558
39553
|
function getOptionsOrDie(argv, filePath) {
|
package/index.js
CHANGED
|
@@ -176,7 +176,7 @@ function printKeyValue(key, value) {
|
|
|
176
176
|
unwrapExports(build);
|
|
177
177
|
|
|
178
178
|
var name = "prettier";
|
|
179
|
-
var version$1 = "1.10.
|
|
179
|
+
var version$1 = "1.10.2";
|
|
180
180
|
var description = "Prettier is an opinionated code formatter";
|
|
181
181
|
var bin = {"prettier":"./bin/prettier.js"};
|
|
182
182
|
var repository = "prettier/prettier";
|
|
@@ -186,7 +186,7 @@ var license = "MIT";
|
|
|
186
186
|
var main = "./index.js";
|
|
187
187
|
var engines = {"node":">=4"};
|
|
188
188
|
var dependencies = {"@babel/code-frame":"7.0.0-beta.35","@glimmer/syntax":"0.30.3","babylon":"7.0.0-beta.34","camelcase":"4.1.0","chalk":"2.1.0","cjk-regex":"1.0.2","cosmiconfig":"3.1.0","dashify":"0.2.2","dedent":"0.7.0","diff":"3.2.0","editorconfig":"0.14.2","editorconfig-to-prettier":"0.0.6","emoji-regex":"6.5.1","escape-string-regexp":"1.0.5","esutils":"2.0.2","find-project-root":"1.1.1","flow-parser":"0.59.0","get-stream":"3.0.0","globby":"6.1.0","graphql":"0.12.3","ignore":"3.3.7","jest-docblock":"21.3.0-beta.11","jest-validate":"21.1.0","leven":"2.1.0","mem":"1.1.0","minimatch":"3.0.4","minimist":"1.2.0","parse5":"3.0.3","postcss-less":"1.1.3","postcss-media-query-parser":"0.2.3","postcss-scss":"1.0.2","postcss-selector-parser":"2.2.3","postcss-values-parser":"1.3.1","read-pkg-up":"3.0.0","remark-frontmatter":"1.1.0","remark-parse":"4.0.0","resolve":"1.5.0","semver":"5.4.1","string-width":"2.1.1","typescript":"2.7.0-insiders.20171214","typescript-eslint-parser":"11.0.0","unicode-regex":"1.0.1","unified":"6.1.6"};
|
|
189
|
-
var devDependencies = {"babel-cli":"6.24.1","babel-preset-es2015":"6.24.1","codecov":"2.2.0","cross-env":"5.0.5","eslint":"4.1.1","eslint-config-prettier":"2.9.0","eslint-friendly-formatter":"3.0.0","eslint-plugin-import":"2.6.1","eslint-plugin-prettier":"2.4.0","eslint-plugin-react":"7.1.0","jest":"21.1.0","mkdirp":"0.5.1","prettier":"1.
|
|
189
|
+
var devDependencies = {"babel-cli":"6.24.1","babel-preset-es2015":"6.24.1","codecov":"2.2.0","cross-env":"5.0.5","eslint":"4.1.1","eslint-config-prettier":"2.9.0","eslint-friendly-formatter":"3.0.0","eslint-plugin-import":"2.6.1","eslint-plugin-prettier":"2.4.0","eslint-plugin-react":"7.1.0","jest":"21.1.0","mkdirp":"0.5.1","prettier":"1.10.1","prettylint":"1.0.0","rimraf":"2.6.2","rollup":"0.47.6","rollup-plugin-commonjs":"8.2.6","rollup-plugin-json":"2.1.1","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.2.1","shelljs":"0.7.8","snapshot-diff":"0.2.2","strip-ansi":"4.0.0","sw-toolbox":"3.6.0","uglify-es":"3.0.28","webpack":"2.6.1"};
|
|
190
190
|
var scripts = {"prepublishOnly":"echo \"Error: must publish from dist/\" && exit 1","prepare-release":"yarn && yarn build && yarn test:dist","test":"jest","test:dist":"cross-env NODE_ENV=production yarn test","test-integration":"jest tests_integration","lint":"cross-env EFF_NO_LINK_RULES=true eslint . --format node_modules/eslint-friendly-formatter","lint-docs":"prettylint {.,docs,website,website/blog}/*.md","build":"node ./scripts/build/build.js","build-docs":"node ./scripts/build/build-docs.js","check-deps":"node ./scripts/check-deps.js"};
|
|
191
191
|
var _package = {
|
|
192
192
|
name: name,
|
|
@@ -18186,22 +18186,18 @@ function genericPrint$5(path$$1, options, print) {
|
|
|
18186
18186
|
const n = path$$1.getValue();
|
|
18187
18187
|
const res = [];
|
|
18188
18188
|
let index = n.start;
|
|
18189
|
-
let printParent = typeof n.end === "number";
|
|
18190
18189
|
|
|
18191
18190
|
path$$1.each(childPath => {
|
|
18192
18191
|
const child = childPath.getValue();
|
|
18193
18192
|
res.push(options.originalText.slice(index, child.start));
|
|
18194
18193
|
res.push(childPath.call(print));
|
|
18195
|
-
|
|
18196
|
-
index = child.end;
|
|
18197
|
-
} else {
|
|
18198
|
-
printParent = false;
|
|
18199
|
-
}
|
|
18194
|
+
index = child.end;
|
|
18200
18195
|
}, "children");
|
|
18201
18196
|
|
|
18202
|
-
|
|
18203
|
-
|
|
18204
|
-
|
|
18197
|
+
// If there are no children, we just print the node from start to end.
|
|
18198
|
+
// Otherwise, index should point to the end of the last child, and we
|
|
18199
|
+
// need to print the closing tag.
|
|
18200
|
+
res.push(options.originalText.slice(index, n.end));
|
|
18205
18201
|
|
|
18206
18202
|
// Only force a trailing newline if there were any contents.
|
|
18207
18203
|
if (n.tag === "root" && n.children.length) {
|
package/package.json
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prettier",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.2",
|
|
4
4
|
"description": "Prettier is an opinionated code formatter",
|
|
5
|
-
"bin":
|
|
6
|
-
"prettier": "./bin/prettier.js"
|
|
7
|
-
},
|
|
5
|
+
"bin": "./bin-prettier.js",
|
|
8
6
|
"repository": "prettier/prettier",
|
|
9
7
|
"homepage": "https://prettier.io",
|
|
10
8
|
"author": "James Long",
|
|
@@ -26,7 +24,7 @@
|
|
|
26
24
|
"eslint-plugin-react": "7.1.0",
|
|
27
25
|
"jest": "21.1.0",
|
|
28
26
|
"mkdirp": "0.5.1",
|
|
29
|
-
"prettier": "1.
|
|
27
|
+
"prettier": "1.10.1",
|
|
30
28
|
"prettylint": "1.0.0",
|
|
31
29
|
"rimraf": "2.6.2",
|
|
32
30
|
"rollup": "0.47.6",
|
package/parser-vue.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function makeMap(t
|
|
1
|
+
"use strict";function makeMap(e,t){const n=Object.create(null),a=e.split(",");for(let e=0;e<a.length;e++)n[a[e]]=!0;return t?e=>n[e.toLowerCase()]:e=>n[e]}function decodeAttr(e,t){const n=t?encodedAttrWithNewLines:encodedAttr;return e.replace(n,e=>decodingMap[e])}function parseHTML(e,t){function n(t){d+=t,e=e.substring(t)}function a(e,n,a){let o,s;if(null==n&&(n=d),null==a&&(a=d),e&&(s=e.toLowerCase()),e)for(o=r.length-1;o>=0&&r[o].lowerCasedTag!==s;o--);else o=0;if(o>=0){for(let s=r.length-1;s>=o;s--)"production"!==process.env.NODE_ENV&&(s>o||!e)&&t.warn&&t.warn(`tag <${r[s].tag}> has no matching end tag.`),t.end&&t.end(r[s].tag,n,a);r.length=o,l=o&&r[o-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,a):"p"===s&&(t.start&&t.start(e,[],!1,n,a),t.end&&t.end(e,n,a))}const r=[],o=t.expectHTML,s=t.isUnaryTag||no,c=t.canBeLeftOpenTag||no;let i,l,d=0;for(;e;){if(i=e,l&&isPlainTextElement(l)){let n=0;const r=l.toLowerCase(),o=reCache[r]||(reCache[r]=new RegExp("([\\s\\S]*?)(</"+r+"[^>]*>)","i")),s=e.replace(o,(e,a,o)=>(n=o.length,isPlainTextElement(r)||"noscript"===r||(a=a.replace(/<!--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),shouldIgnoreFirstNewline(r,a)&&(a=a.slice(1)),t.chars&&t.chars(a),""));d+=e.length-s.length,e=s,a(r,d-n,d)}else{let i=e.indexOf("<");if(0===i){if(comment.test(e)){const a=e.indexOf("--\x3e");if(a>=0){t.shouldKeepComment&&t.comment(e.substring(4,a)),n(a+3);continue}}if(conditionalComment.test(e)){const t=e.indexOf("]>");if(t>=0){n(t+2);continue}}const i=e.match(doctype);if(i){n(i[0].length);continue}const g=e.match(endTag);if(g){const e=d;n(g[0].length),a(g[1],e,d);continue}const h=function(){const t=e.match(startTagOpen);if(t){const a={tagName:t[1],attrs:[],start:d};n(t[0].length);let r,o;for(;!(r=e.match(startTagClose))&&(o=e.match(attribute));)n(o[0].length),a.attrs.push(o);if(r)return a.unarySlash=r[1],n(r[0].length),a.end=d,a}}();if(h){!function(e){const n=e.tagName,i=e.unarySlash;o&&("p"===l&&isNonPhrasingTag(n)&&a(l),c(n)&&l===n&&a(n));const d=s(n)||!!i,g=e.attrs.length,h=new Array(g);for(let a=0;a<g;a++){const r=e.attrs[a];IS_REGEX_CAPTURING_BROKEN&&-1===r[0].indexOf('""')&&(""===r[3]&&delete r[3],""===r[4]&&delete r[4],""===r[5]&&delete r[5]);const o=r[3]||r[4]||r[5]||"",s="a"===n&&"href"===r[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;h[a]={name:r[1],value:decodeAttr(o,s)}}d||(r.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:h}),l=n),t.start&&t.start(n,h,d,e.start,e.end)}(h),shouldIgnoreFirstNewline(l,e)&&n(1);continue}}let g,h,u;if(i>=0){for(h=e.slice(i);!(endTag.test(h)||startTagOpen.test(h)||comment.test(h)||conditionalComment.test(h)||(u=h.indexOf("<",1))<0);)i+=u,h=e.slice(i);g=e.substring(0,i),n(i)}i<0&&(g=e,e=""),t.chars&&g&&t.chars(g)}if(e===i){t.chars&&t.chars(e),"production"!==process.env.NODE_ENV&&!r.length&&t.warn&&t.warn(`Mal-formatted tag at end of template: "${e}"`);break}}a()}function parse(e){const t={tag:"root",attrs:[],unary:!1,start:0,contentStart:0,contentEnd:e.length,end:e.length,children:[],comments:[]},n=[t];let a=t;return parseHTML(e,{start:function(e,t,r,o,s){const c={tag:e,attrs:t,unary:r,start:o,children:[]};a.children.push(c),r?c.end=s:(c.contentStart=s,n.push(c),a=c)},end:function(e,t,r){n.pop(),a.contentEnd=t,a.end=r,a=n[n.length-1]}}),t}const no=()=>!1,isNonPhrasingTag=makeMap("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),attribute=/^\s*([^\s"'<>/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,ncname="[a-zA-Z_][\\w\\-\\.]*",qnameCapture=`((?:${ncname}\\:)?${ncname})`,startTagOpen=new RegExp(`^<${qnameCapture}`),startTagClose=/^\s*(\/?)>/,endTag=new RegExp(`^<\\/${qnameCapture}[^>]*>`),doctype=/^<!DOCTYPE [^>]+>/i,comment=/^<!--/,conditionalComment=/^<!\[/;let IS_REGEX_CAPTURING_BROKEN=!1;"x".replace(/x(.)?/g,(e,t)=>{IS_REGEX_CAPTURING_BROKEN=""===t});const isPlainTextElement=makeMap("script,style,textarea",!0),reCache={},decodingMap={"<":"<",">":">",""":'"',"&":"&"," ":"\n","	":"\t"},encodedAttr=/&(?:lt|gt|quot|amp);/g,encodedAttrWithNewLines=/&(?:lt|gt|quot|amp|#10|#9);/g,isIgnoreNewlineTag=makeMap("pre,textarea",!0),shouldIgnoreFirstNewline=(e,t)=>e&&isIgnoreNewlineTag(e)&&"\n"===t[0];var parserVue=parse;module.exports=parserVue;
|