prettier 1.6.1 → 2.0.0.pre.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +316 -293
- data/CONTRIBUTING.md +6 -9
- data/LICENSE +1 -1
- data/README.md +11 -12
- data/dist/haml/embed.js +53 -0
- data/dist/haml/parser.js +31 -0
- data/{src → dist}/haml/parser.rb +0 -0
- data/dist/haml/printer.js +336 -0
- data/dist/parser/getInfo.js +17 -0
- data/{src → dist}/parser/netcat.js +1 -0
- data/dist/parser/parseSync.js +128 -0
- data/dist/parser/server.rb +140 -0
- data/dist/plugin.js +143 -0
- data/dist/prettier.js +15 -0
- data/dist/rbs/parser.js +34 -0
- data/{src → dist}/rbs/parser.rb +0 -0
- data/dist/rbs/printer.js +517 -0
- data/dist/ruby/embed.js +110 -0
- data/dist/ruby/nodes/alias.js +59 -0
- data/{src → dist}/ruby/nodes/aref.js +26 -35
- data/dist/ruby/nodes/args.js +165 -0
- data/dist/ruby/nodes/arrays.js +126 -0
- data/dist/ruby/nodes/assign.js +41 -0
- data/dist/ruby/nodes/blocks.js +68 -0
- data/dist/ruby/nodes/calls.js +220 -0
- data/dist/ruby/nodes/case.js +50 -0
- data/dist/ruby/nodes/class.js +54 -0
- data/dist/ruby/nodes/commands.js +124 -0
- data/dist/ruby/nodes/conditionals.js +242 -0
- data/dist/ruby/nodes/constants.js +38 -0
- data/dist/ruby/nodes/flow.js +66 -0
- data/dist/ruby/nodes/hashes.js +130 -0
- data/dist/ruby/nodes/heredocs.js +30 -0
- data/dist/ruby/nodes/hooks.js +35 -0
- data/dist/ruby/nodes/ints.js +27 -0
- data/dist/ruby/nodes/lambdas.js +69 -0
- data/dist/ruby/nodes/loops.js +73 -0
- data/dist/ruby/nodes/massign.js +73 -0
- data/dist/ruby/nodes/methods.js +70 -0
- data/dist/ruby/nodes/operators.js +70 -0
- data/dist/ruby/nodes/params.js +89 -0
- data/dist/ruby/nodes/patterns.js +109 -0
- data/dist/ruby/nodes/regexp.js +45 -0
- data/dist/ruby/nodes/rescue.js +82 -0
- data/dist/ruby/nodes/return.js +75 -0
- data/dist/ruby/nodes/statements.js +111 -0
- data/dist/ruby/nodes/strings.js +218 -0
- data/dist/ruby/nodes/super.js +30 -0
- data/dist/ruby/nodes/undef.js +26 -0
- data/dist/ruby/nodes.js +151 -0
- data/dist/ruby/parser.js +34 -0
- data/{src → dist}/ruby/parser.rb +1215 -252
- data/dist/ruby/printer.js +125 -0
- data/dist/ruby/toProc.js +93 -0
- data/dist/types/haml.js +4 -0
- data/dist/types/plugin.js +3 -0
- data/dist/types/rbs.js +4 -0
- data/dist/types/ruby.js +4 -0
- data/dist/types/utils.js +2 -0
- data/dist/types.js +30 -0
- data/dist/utils/containsAssignment.js +15 -0
- data/dist/utils/getTrailingComma.js +6 -0
- data/dist/utils/hasAncestor.js +15 -0
- data/{src → dist}/utils/inlineEnsureParens.js +16 -17
- data/dist/utils/isEmptyBodyStmt.js +10 -0
- data/dist/utils/isEmptyStmts.js +10 -0
- data/dist/utils/literal.js +8 -0
- data/dist/utils/literallineWithoutBreakParent.js +8 -0
- data/dist/utils/makeCall.js +13 -0
- data/dist/utils/noIndent.js +11 -0
- data/dist/utils/printEmptyCollection.js +44 -0
- data/dist/utils/skipAssignIndent.js +15 -0
- data/dist/utils.js +30 -0
- data/node_modules/prettier/bin-prettier.js +313 -190
- data/node_modules/prettier/doc.js +191 -323
- data/node_modules/prettier/index.js +2753 -3677
- data/node_modules/prettier/package.json +1 -1
- data/node_modules/prettier/parser-angular.js +13 -14
- data/node_modules/prettier/parser-babel.js +7 -7
- data/node_modules/prettier/parser-espree.js +7 -7
- data/node_modules/prettier/parser-flow.js +7 -7
- data/node_modules/prettier/parser-glimmer.js +1 -1
- data/node_modules/prettier/parser-graphql.js +1 -1
- data/node_modules/prettier/parser-html.js +17 -17
- data/node_modules/prettier/parser-markdown.js +9 -9
- data/node_modules/prettier/parser-meriyah.js +7 -7
- data/node_modules/prettier/parser-postcss.js +2 -2
- data/node_modules/prettier/parser-typescript.js +7 -7
- data/node_modules/prettier/parser-yaml.js +2 -2
- data/node_modules/prettier/third-party.js +143 -78
- data/package.json +26 -18
- metadata +74 -67
- data/src/haml/embed.js +0 -87
- data/src/haml/parser.js +0 -23
- data/src/haml/printer.js +0 -438
- data/src/parser/parseSync.js +0 -172
- data/src/parser/server.rb +0 -66
- data/src/plugin.js +0 -148
- data/src/prettier.js +0 -16
- data/src/rbs/parser.js +0 -37
- data/src/rbs/printer.js +0 -643
- data/src/ruby/embed.js +0 -142
- data/src/ruby/nodes/alias.js +0 -73
- data/src/ruby/nodes/args.js +0 -222
- data/src/ruby/nodes/arrays.js +0 -162
- data/src/ruby/nodes/assign.js +0 -47
- data/src/ruby/nodes/blocks.js +0 -90
- data/src/ruby/nodes/calls.js +0 -246
- data/src/ruby/nodes/case.js +0 -65
- data/src/ruby/nodes/class.js +0 -64
- data/src/ruby/nodes/commands.js +0 -131
- data/src/ruby/nodes/conditionals.js +0 -282
- data/src/ruby/nodes/constants.js +0 -43
- data/src/ruby/nodes/flow.js +0 -74
- data/src/ruby/nodes/hashes.js +0 -155
- data/src/ruby/nodes/heredocs.js +0 -36
- data/src/ruby/nodes/hooks.js +0 -34
- data/src/ruby/nodes/ints.js +0 -31
- data/src/ruby/nodes/lambdas.js +0 -76
- data/src/ruby/nodes/loops.js +0 -98
- data/src/ruby/nodes/massign.js +0 -98
- data/src/ruby/nodes/methods.js +0 -74
- data/src/ruby/nodes/operators.js +0 -83
- data/src/ruby/nodes/params.js +0 -106
- data/src/ruby/nodes/patterns.js +0 -157
- data/src/ruby/nodes/regexp.js +0 -56
- data/src/ruby/nodes/rescue.js +0 -101
- data/src/ruby/nodes/return.js +0 -94
- data/src/ruby/nodes/statements.js +0 -142
- data/src/ruby/nodes/strings.js +0 -272
- data/src/ruby/nodes/super.js +0 -35
- data/src/ruby/nodes/undef.js +0 -42
- data/src/ruby/nodes.js +0 -34
- data/src/ruby/parser.js +0 -37
- data/src/ruby/printer.js +0 -147
- data/src/ruby/toProc.js +0 -105
- data/src/utils/containsAssignment.js +0 -11
- data/src/utils/getTrailingComma.js +0 -5
- data/src/utils/hasAncestor.js +0 -17
- data/src/utils/isEmptyBodyStmt.js +0 -7
- data/src/utils/isEmptyStmts.js +0 -11
- data/src/utils/literal.js +0 -7
- data/src/utils/literallineWithoutBreakParent.js +0 -7
- data/src/utils/makeCall.js +0 -14
- data/src/utils/noIndent.js +0 -10
- data/src/utils/printEmptyCollection.js +0 -49
- data/src/utils/skipAssignIndent.js +0 -17
- data/src/utils.js +0 -13
@@ -84,7 +84,7 @@
|
|
84
84
|
|
85
85
|
|
86
86
|
function markAsRoot(contents) {
|
87
|
-
// @ts-
|
87
|
+
// @ts-expect-error - TBD ???:
|
88
88
|
return align({
|
89
89
|
type: "root"
|
90
90
|
}, contents);
|
@@ -305,20 +305,7 @@
|
|
305
305
|
|
306
306
|
if (codePoint >= 0x1100 && (codePoint <= 0x115F || // Hangul Jamo
|
307
307
|
codePoint === 0x2329 || // LEFT-POINTING ANGLE BRACKET
|
308
|
-
codePoint === 0x232A ||
|
309
|
-
// CJK Radicals Supplement .. Enclosed CJK Letters and Months
|
310
|
-
0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F || // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
|
311
|
-
0x3250 <= codePoint && codePoint <= 0x4DBF || // CJK Unified Ideographs .. Yi Radicals
|
312
|
-
0x4E00 <= codePoint && codePoint <= 0xA4C6 || // Hangul Jamo Extended-A
|
313
|
-
0xA960 <= codePoint && codePoint <= 0xA97C || // Hangul Syllables
|
314
|
-
0xAC00 <= codePoint && codePoint <= 0xD7A3 || // CJK Compatibility Ideographs
|
315
|
-
0xF900 <= codePoint && codePoint <= 0xFAFF || // Vertical Forms
|
316
|
-
0xFE10 <= codePoint && codePoint <= 0xFE19 || // CJK Compatibility Forms .. Small Form Variants
|
317
|
-
0xFE30 <= codePoint && codePoint <= 0xFE6B || // Halfwidth and Fullwidth Forms
|
318
|
-
0xFF01 <= codePoint && codePoint <= 0xFF60 || 0xFFE0 <= codePoint && codePoint <= 0xFFE6 || // Kana Supplement
|
319
|
-
0x1B000 <= codePoint && codePoint <= 0x1B001 || // Enclosed Ideographic Supplement
|
320
|
-
0x1F200 <= codePoint && codePoint <= 0x1F251 || // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
|
321
|
-
0x20000 <= codePoint && codePoint <= 0x3FFFD)) {
|
308
|
+
codePoint === 0x232A || 0x2E80 <= codePoint && codePoint <= 0x3247 && codePoint !== 0x303F || 0x3250 <= codePoint && codePoint <= 0x4DBF || 0x4E00 <= codePoint && codePoint <= 0xA4C6 || 0xA960 <= codePoint && codePoint <= 0xA97C || 0xAC00 <= codePoint && codePoint <= 0xD7A3 || 0xF900 <= codePoint && codePoint <= 0xFAFF || 0xFE10 <= codePoint && codePoint <= 0xFE19 || 0xFE30 <= codePoint && codePoint <= 0xFE6B || 0xFF01 <= codePoint && codePoint <= 0xFF60 || 0xFFE0 <= codePoint && codePoint <= 0xFFE6 || 0x1B000 <= codePoint && codePoint <= 0x1B001 || 0x1F200 <= codePoint && codePoint <= 0x1F251 || 0x20000 <= codePoint && codePoint <= 0x3FFFD)) {
|
322
309
|
return true;
|
323
310
|
}
|
324
311
|
|
@@ -489,10 +476,10 @@
|
|
489
476
|
};
|
490
477
|
};
|
491
478
|
|
492
|
-
var toString = {}.toString;
|
479
|
+
var toString$1 = {}.toString;
|
493
480
|
|
494
481
|
var classofRaw = function (it) {
|
495
|
-
return toString.call(it).slice(8, -1);
|
482
|
+
return toString$1.call(it).slice(8, -1);
|
496
483
|
};
|
497
484
|
|
498
485
|
var split = ''.split;
|
@@ -525,19 +512,94 @@
|
|
525
512
|
return typeof it === 'object' ? it !== null : typeof it === 'function';
|
526
513
|
};
|
527
514
|
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
var
|
533
|
-
|
515
|
+
var aFunction$1 = function (variable) {
|
516
|
+
return typeof variable == 'function' ? variable : undefined;
|
517
|
+
};
|
518
|
+
|
519
|
+
var getBuiltIn = function (namespace, method) {
|
520
|
+
return arguments.length < 2 ? aFunction$1(global$2[namespace]) : global$2[namespace] && global$2[namespace][method];
|
521
|
+
};
|
522
|
+
|
523
|
+
var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
|
524
|
+
|
525
|
+
var process = global$2.process;
|
526
|
+
var Deno = global$2.Deno;
|
527
|
+
var versions$1 = process && process.versions || Deno && Deno.version;
|
528
|
+
var v8 = versions$1 && versions$1.v8;
|
529
|
+
var match, version$1;
|
530
|
+
|
531
|
+
if (v8) {
|
532
|
+
match = v8.split('.');
|
533
|
+
version$1 = match[0] < 4 ? 1 : match[0] + match[1];
|
534
|
+
} else if (engineUserAgent) {
|
535
|
+
match = engineUserAgent.match(/Edge\/(\d+)/);
|
536
|
+
if (!match || match[1] >= 74) {
|
537
|
+
match = engineUserAgent.match(/Chrome\/(\d+)/);
|
538
|
+
if (match) version$1 = match[1];
|
539
|
+
}
|
540
|
+
}
|
541
|
+
|
542
|
+
var engineV8Version = version$1 && +version$1;
|
543
|
+
|
544
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
545
|
+
|
546
|
+
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
547
|
+
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
548
|
+
var symbol = Symbol();
|
549
|
+
// Chrome 38 Symbol has incorrect toString conversion
|
550
|
+
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
551
|
+
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
552
|
+
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
553
|
+
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
554
|
+
});
|
555
|
+
|
556
|
+
/* eslint-disable es/no-symbol -- required for testing */
|
557
|
+
|
558
|
+
var useSymbolAsUid = nativeSymbol
|
559
|
+
&& !Symbol.sham
|
560
|
+
&& typeof Symbol.iterator == 'symbol';
|
561
|
+
|
562
|
+
var isSymbol = useSymbolAsUid ? function (it) {
|
563
|
+
return typeof it == 'symbol';
|
564
|
+
} : function (it) {
|
565
|
+
var $Symbol = getBuiltIn('Symbol');
|
566
|
+
return typeof $Symbol == 'function' && Object(it) instanceof $Symbol;
|
567
|
+
};
|
568
|
+
|
569
|
+
// `OrdinaryToPrimitive` abstract operation
|
570
|
+
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
|
571
|
+
var ordinaryToPrimitive = function (input, pref) {
|
534
572
|
var fn, val;
|
535
|
-
if (
|
573
|
+
if (pref === 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
536
574
|
if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val;
|
537
|
-
if (
|
575
|
+
if (pref !== 'string' && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val;
|
538
576
|
throw TypeError("Can't convert object to primitive value");
|
539
577
|
};
|
540
578
|
|
579
|
+
var setGlobal = function (key, value) {
|
580
|
+
try {
|
581
|
+
// eslint-disable-next-line es/no-object-defineproperty -- safe
|
582
|
+
Object.defineProperty(global$2, key, { value: value, configurable: true, writable: true });
|
583
|
+
} catch (error) {
|
584
|
+
global$2[key] = value;
|
585
|
+
} return value;
|
586
|
+
};
|
587
|
+
|
588
|
+
var SHARED = '__core-js_shared__';
|
589
|
+
var store$1 = global$2[SHARED] || setGlobal(SHARED, {});
|
590
|
+
|
591
|
+
var sharedStore = store$1;
|
592
|
+
|
593
|
+
var shared = createCommonjsModule(function (module) {
|
594
|
+
(module.exports = function (key, value) {
|
595
|
+
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
596
|
+
})('versions', []).push({
|
597
|
+
version: '3.17.3',
|
598
|
+
mode: 'global',
|
599
|
+
copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
|
600
|
+
});
|
601
|
+
});
|
602
|
+
|
541
603
|
// `ToObject` abstract operation
|
542
604
|
// https://tc39.es/ecma262/#sec-toobject
|
543
605
|
var toObject = function (argument) {
|
@@ -550,6 +612,52 @@
|
|
550
612
|
return hasOwnProperty.call(toObject(it), key);
|
551
613
|
};
|
552
614
|
|
615
|
+
var id = 0;
|
616
|
+
var postfix = Math.random();
|
617
|
+
|
618
|
+
var uid = function (key) {
|
619
|
+
return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
|
620
|
+
};
|
621
|
+
|
622
|
+
var WellKnownSymbolsStore = shared('wks');
|
623
|
+
var Symbol$1 = global$2.Symbol;
|
624
|
+
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
625
|
+
|
626
|
+
var wellKnownSymbol = function (name) {
|
627
|
+
if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
|
628
|
+
if (nativeSymbol && has$1(Symbol$1, name)) {
|
629
|
+
WellKnownSymbolsStore[name] = Symbol$1[name];
|
630
|
+
} else {
|
631
|
+
WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
|
632
|
+
}
|
633
|
+
} return WellKnownSymbolsStore[name];
|
634
|
+
};
|
635
|
+
|
636
|
+
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
637
|
+
|
638
|
+
// `ToPrimitive` abstract operation
|
639
|
+
// https://tc39.es/ecma262/#sec-toprimitive
|
640
|
+
var toPrimitive = function (input, pref) {
|
641
|
+
if (!isObject(input) || isSymbol(input)) return input;
|
642
|
+
var exoticToPrim = input[TO_PRIMITIVE];
|
643
|
+
var result;
|
644
|
+
if (exoticToPrim !== undefined) {
|
645
|
+
if (pref === undefined) pref = 'default';
|
646
|
+
result = exoticToPrim.call(input, pref);
|
647
|
+
if (!isObject(result) || isSymbol(result)) return result;
|
648
|
+
throw TypeError("Can't convert object to primitive value");
|
649
|
+
}
|
650
|
+
if (pref === undefined) pref = 'number';
|
651
|
+
return ordinaryToPrimitive(input, pref);
|
652
|
+
};
|
653
|
+
|
654
|
+
// `ToPropertyKey` abstract operation
|
655
|
+
// https://tc39.es/ecma262/#sec-topropertykey
|
656
|
+
var toPropertyKey = function (argument) {
|
657
|
+
var key = toPrimitive(argument, 'string');
|
658
|
+
return isSymbol(key) ? key : String(key);
|
659
|
+
};
|
660
|
+
|
553
661
|
var document$1 = global$2.document;
|
554
662
|
// typeof document.createElement is 'object' in old IE
|
555
663
|
var EXISTS = isObject(document$1) && isObject(document$1.createElement);
|
@@ -573,7 +681,7 @@
|
|
573
681
|
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
|
574
682
|
var f$3 = descriptors ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
575
683
|
O = toIndexedObject(O);
|
576
|
-
P =
|
684
|
+
P = toPropertyKey(P);
|
577
685
|
if (ie8DomDefine) try {
|
578
686
|
return $getOwnPropertyDescriptor(O, P);
|
579
687
|
} catch (error) { /* empty */ }
|
@@ -597,7 +705,7 @@
|
|
597
705
|
// https://tc39.es/ecma262/#sec-object.defineproperty
|
598
706
|
var f$2 = descriptors ? $defineProperty : function defineProperty(O, P, Attributes) {
|
599
707
|
anObject(O);
|
600
|
-
P =
|
708
|
+
P = toPropertyKey(P);
|
601
709
|
anObject(Attributes);
|
602
710
|
if (ie8DomDefine) try {
|
603
711
|
return $defineProperty(O, P, Attributes);
|
@@ -618,19 +726,6 @@
|
|
618
726
|
return object;
|
619
727
|
};
|
620
728
|
|
621
|
-
var setGlobal = function (key, value) {
|
622
|
-
try {
|
623
|
-
createNonEnumerableProperty(global$2, key, value);
|
624
|
-
} catch (error) {
|
625
|
-
global$2[key] = value;
|
626
|
-
} return value;
|
627
|
-
};
|
628
|
-
|
629
|
-
var SHARED = '__core-js_shared__';
|
630
|
-
var store$1 = global$2[SHARED] || setGlobal(SHARED, {});
|
631
|
-
|
632
|
-
var sharedStore = store$1;
|
633
|
-
|
634
729
|
var functionToString = Function.toString;
|
635
730
|
|
636
731
|
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
|
@@ -646,23 +741,6 @@
|
|
646
741
|
|
647
742
|
var nativeWeakMap = typeof WeakMap$2 === 'function' && /native code/.test(inspectSource(WeakMap$2));
|
648
743
|
|
649
|
-
var shared = createCommonjsModule(function (module) {
|
650
|
-
(module.exports = function (key, value) {
|
651
|
-
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
652
|
-
})('versions', []).push({
|
653
|
-
version: '3.14.0',
|
654
|
-
mode: 'global',
|
655
|
-
copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
|
656
|
-
});
|
657
|
-
});
|
658
|
-
|
659
|
-
var id = 0;
|
660
|
-
var postfix = Math.random();
|
661
|
-
|
662
|
-
var uid = function (key) {
|
663
|
-
return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36);
|
664
|
-
};
|
665
|
-
|
666
744
|
var keys = shared('keys');
|
667
745
|
|
668
746
|
var sharedKey = function (key) {
|
@@ -766,17 +844,6 @@
|
|
766
844
|
});
|
767
845
|
});
|
768
846
|
|
769
|
-
var path = global$2;
|
770
|
-
|
771
|
-
var aFunction$1 = function (variable) {
|
772
|
-
return typeof variable == 'function' ? variable : undefined;
|
773
|
-
};
|
774
|
-
|
775
|
-
var getBuiltIn = function (namespace, method) {
|
776
|
-
return arguments.length < 2 ? aFunction$1(path[namespace]) || aFunction$1(global$2[namespace])
|
777
|
-
: path[namespace] && path[namespace][method] || global$2[namespace] && global$2[namespace][method];
|
778
|
-
};
|
779
|
-
|
780
847
|
var ceil = Math.ceil;
|
781
848
|
var floor$1 = Math.floor;
|
782
849
|
|
@@ -1036,63 +1103,11 @@
|
|
1036
1103
|
|
1037
1104
|
var flattenIntoArray_1 = flattenIntoArray;
|
1038
1105
|
|
1039
|
-
var engineUserAgent = getBuiltIn('navigator', 'userAgent') || '';
|
1040
|
-
|
1041
|
-
var process = global$2.process;
|
1042
|
-
var versions$1 = process && process.versions;
|
1043
|
-
var v8 = versions$1 && versions$1.v8;
|
1044
|
-
var match, version$2;
|
1045
|
-
|
1046
|
-
if (v8) {
|
1047
|
-
match = v8.split('.');
|
1048
|
-
version$2 = match[0] < 4 ? 1 : match[0] + match[1];
|
1049
|
-
} else if (engineUserAgent) {
|
1050
|
-
match = engineUserAgent.match(/Edge\/(\d+)/);
|
1051
|
-
if (!match || match[1] >= 74) {
|
1052
|
-
match = engineUserAgent.match(/Chrome\/(\d+)/);
|
1053
|
-
if (match) version$2 = match[1];
|
1054
|
-
}
|
1055
|
-
}
|
1056
|
-
|
1057
|
-
var engineV8Version = version$2 && +version$2;
|
1058
|
-
|
1059
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
1060
|
-
|
1061
|
-
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
|
1062
|
-
var nativeSymbol = !!Object.getOwnPropertySymbols && !fails(function () {
|
1063
|
-
var symbol = Symbol();
|
1064
|
-
// Chrome 38 Symbol has incorrect toString conversion
|
1065
|
-
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
|
1066
|
-
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
1067
|
-
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
|
1068
|
-
!Symbol.sham && engineV8Version && engineV8Version < 41;
|
1069
|
-
});
|
1070
|
-
|
1071
|
-
/* eslint-disable es/no-symbol -- required for testing */
|
1072
|
-
|
1073
|
-
var useSymbolAsUid = nativeSymbol
|
1074
|
-
&& !Symbol.sham
|
1075
|
-
&& typeof Symbol.iterator == 'symbol';
|
1076
|
-
|
1077
|
-
var WellKnownSymbolsStore = shared('wks');
|
1078
|
-
var Symbol$1 = global$2.Symbol;
|
1079
|
-
var createWellKnownSymbol = useSymbolAsUid ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid;
|
1080
|
-
|
1081
|
-
var wellKnownSymbol = function (name) {
|
1082
|
-
if (!has$1(WellKnownSymbolsStore, name) || !(nativeSymbol || typeof WellKnownSymbolsStore[name] == 'string')) {
|
1083
|
-
if (nativeSymbol && has$1(Symbol$1, name)) {
|
1084
|
-
WellKnownSymbolsStore[name] = Symbol$1[name];
|
1085
|
-
} else {
|
1086
|
-
WellKnownSymbolsStore[name] = createWellKnownSymbol('Symbol.' + name);
|
1087
|
-
}
|
1088
|
-
} return WellKnownSymbolsStore[name];
|
1089
|
-
};
|
1090
|
-
|
1091
1106
|
var SPECIES = wellKnownSymbol('species');
|
1092
1107
|
|
1093
|
-
// `ArraySpeciesCreate` abstract operation
|
1108
|
+
// a part of `ArraySpeciesCreate` abstract operation
|
1094
1109
|
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
1095
|
-
var
|
1110
|
+
var arraySpeciesConstructor = function (originalArray) {
|
1096
1111
|
var C;
|
1097
1112
|
if (isArray(originalArray)) {
|
1098
1113
|
C = originalArray.constructor;
|
@@ -1102,7 +1117,13 @@
|
|
1102
1117
|
C = C[SPECIES];
|
1103
1118
|
if (C === null) C = undefined;
|
1104
1119
|
}
|
1105
|
-
} return
|
1120
|
+
} return C === undefined ? Array : C;
|
1121
|
+
};
|
1122
|
+
|
1123
|
+
// `ArraySpeciesCreate` abstract operation
|
1124
|
+
// https://tc39.es/ecma262/#sec-arrayspeciescreate
|
1125
|
+
var arraySpeciesCreate = function (originalArray, length) {
|
1126
|
+
return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
1106
1127
|
};
|
1107
1128
|
|
1108
1129
|
// `Array.prototype.flatMap` method
|
@@ -1119,6 +1140,11 @@
|
|
1119
1140
|
}
|
1120
1141
|
});
|
1121
1142
|
|
1143
|
+
var toString = function (argument) {
|
1144
|
+
if (isSymbol(argument)) throw TypeError('Cannot convert a Symbol value to a string');
|
1145
|
+
return String(argument);
|
1146
|
+
};
|
1147
|
+
|
1122
1148
|
// TODO: use something more complex like timsort?
|
1123
1149
|
var floor = Math.floor;
|
1124
1150
|
|
@@ -1239,7 +1265,7 @@
|
|
1239
1265
|
if (y === undefined) return -1;
|
1240
1266
|
if (x === undefined) return 1;
|
1241
1267
|
if (comparefn !== undefined) return +comparefn(x, y) || 0;
|
1242
|
-
return
|
1268
|
+
return toString(x) > toString(y) ? 1 : -1;
|
1243
1269
|
};
|
1244
1270
|
};
|
1245
1271
|
|
@@ -1320,11 +1346,31 @@
|
|
1320
1346
|
|| iterators[classof(it)];
|
1321
1347
|
};
|
1322
1348
|
|
1323
|
-
var
|
1324
|
-
var
|
1325
|
-
if (
|
1326
|
-
|
1349
|
+
var getIterator = function (it, usingIterator) {
|
1350
|
+
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(it) : usingIterator;
|
1351
|
+
if (typeof iteratorMethod != 'function') {
|
1352
|
+
throw TypeError(String(it) + ' is not iterable');
|
1353
|
+
} return anObject(iteratorMethod.call(it));
|
1354
|
+
};
|
1355
|
+
|
1356
|
+
var iteratorClose = function (iterator, kind, value) {
|
1357
|
+
var innerResult, innerError;
|
1358
|
+
anObject(iterator);
|
1359
|
+
try {
|
1360
|
+
innerResult = iterator['return'];
|
1361
|
+
if (innerResult === undefined) {
|
1362
|
+
if (kind === 'throw') throw value;
|
1363
|
+
return value;
|
1364
|
+
}
|
1365
|
+
innerResult = innerResult.call(iterator);
|
1366
|
+
} catch (error) {
|
1367
|
+
innerError = true;
|
1368
|
+
innerResult = error;
|
1327
1369
|
}
|
1370
|
+
if (kind === 'throw') throw value;
|
1371
|
+
if (innerError) throw innerResult;
|
1372
|
+
anObject(innerResult);
|
1373
|
+
return value;
|
1328
1374
|
};
|
1329
1375
|
|
1330
1376
|
var Result = function (stopped, result) {
|
@@ -1341,7 +1387,7 @@
|
|
1341
1387
|
var iterator, iterFn, index, length, result, next, step;
|
1342
1388
|
|
1343
1389
|
var stop = function (condition) {
|
1344
|
-
if (iterator) iteratorClose(iterator);
|
1390
|
+
if (iterator) iteratorClose(iterator, 'normal', condition);
|
1345
1391
|
return new Result(true, condition);
|
1346
1392
|
};
|
1347
1393
|
|
@@ -1364,7 +1410,7 @@
|
|
1364
1410
|
if (result && result instanceof Result) return result;
|
1365
1411
|
} return new Result(false);
|
1366
1412
|
}
|
1367
|
-
iterator =
|
1413
|
+
iterator = getIterator(iterable, iterFn);
|
1368
1414
|
}
|
1369
1415
|
|
1370
1416
|
next = iterator.next;
|
@@ -1372,15 +1418,14 @@
|
|
1372
1418
|
try {
|
1373
1419
|
result = callFn(step.value);
|
1374
1420
|
} catch (error) {
|
1375
|
-
iteratorClose(iterator);
|
1376
|
-
throw error;
|
1421
|
+
iteratorClose(iterator, 'throw', error);
|
1377
1422
|
}
|
1378
1423
|
if (typeof result == 'object' && result && result instanceof Result) return result;
|
1379
1424
|
} return new Result(false);
|
1380
1425
|
};
|
1381
1426
|
|
1382
1427
|
var createProperty = function (object, key, value) {
|
1383
|
-
var propertyKey =
|
1428
|
+
var propertyKey = toPropertyKey(key);
|
1384
1429
|
if (propertyKey in object) objectDefineProperty.f(object, propertyKey, createPropertyDescriptor(0, value));
|
1385
1430
|
else object[propertyKey] = value;
|
1386
1431
|
};
|
@@ -1536,10 +1581,10 @@
|
|
1536
1581
|
};
|
1537
1582
|
var title = 'browser';
|
1538
1583
|
var platform = 'browser';
|
1539
|
-
var browser
|
1584
|
+
var browser = true;
|
1540
1585
|
var env = {};
|
1541
1586
|
var argv = [];
|
1542
|
-
var version
|
1587
|
+
var version = ''; // empty string to avoid regexp issues
|
1543
1588
|
var versions = {};
|
1544
1589
|
var release = {};
|
1545
1590
|
var config = {};
|
@@ -1597,13 +1642,13 @@
|
|
1597
1642
|
return dif / 1000;
|
1598
1643
|
}
|
1599
1644
|
|
1600
|
-
var browser$1
|
1645
|
+
var browser$1 = {
|
1601
1646
|
nextTick: nextTick,
|
1602
1647
|
title: title,
|
1603
|
-
browser: browser
|
1648
|
+
browser: browser,
|
1604
1649
|
env: env,
|
1605
1650
|
argv: argv,
|
1606
|
-
version: version
|
1651
|
+
version: version,
|
1607
1652
|
versions: versions,
|
1608
1653
|
on: on,
|
1609
1654
|
addListener: addListener,
|
@@ -1623,7 +1668,7 @@
|
|
1623
1668
|
uptime: uptime
|
1624
1669
|
};
|
1625
1670
|
|
1626
|
-
const debug = typeof browser$1
|
1671
|
+
const debug = typeof browser$1 === 'object' && browser$1.env && browser$1.env.NODE_DEBUG && /\bsemver\b/i.test(browser$1.env.NODE_DEBUG) ? (...args) => console.error('SEMVER', ...args) : () => {};
|
1627
1672
|
var debug_1 = debug;
|
1628
1673
|
|
1629
1674
|
// Note: this is the semver.org version of the spec that it implements
|
@@ -2110,184 +2155,7 @@
|
|
2110
2155
|
[keyName]: key
|
2111
2156
|
}, value));
|
2112
2157
|
|
2113
|
-
var
|
2114
|
-
var version = "2.3.2";
|
2115
|
-
var description = "Prettier is an opinionated code formatter";
|
2116
|
-
var bin = "./bin/prettier.js";
|
2117
|
-
var repository = "prettier/prettier";
|
2118
|
-
var homepage = "https://prettier.io";
|
2119
|
-
var author = "James Long";
|
2120
|
-
var license = "MIT";
|
2121
|
-
var main = "./index.js";
|
2122
|
-
var browser = "./standalone.js";
|
2123
|
-
var unpkg = "./standalone.js";
|
2124
|
-
var engines = {
|
2125
|
-
node: ">=12.17.0"
|
2126
|
-
};
|
2127
|
-
var files = [
|
2128
|
-
"index.js",
|
2129
|
-
"standalone.js",
|
2130
|
-
"src",
|
2131
|
-
"bin"
|
2132
|
-
];
|
2133
|
-
var dependencies = {
|
2134
|
-
"@angular/compiler": "12.0.5",
|
2135
|
-
"@babel/code-frame": "7.14.5",
|
2136
|
-
"@babel/parser": "7.14.6",
|
2137
|
-
"@glimmer/syntax": "0.79.3",
|
2138
|
-
"@iarna/toml": "2.2.5",
|
2139
|
-
"@typescript-eslint/typescript-estree": "4.27.0",
|
2140
|
-
"angular-estree-parser": "2.4.0",
|
2141
|
-
"angular-html-parser": "1.8.0",
|
2142
|
-
camelcase: "6.2.0",
|
2143
|
-
chalk: "4.1.1",
|
2144
|
-
"ci-info": "3.2.0",
|
2145
|
-
"cjk-regex": "2.0.1",
|
2146
|
-
cosmiconfig: "7.0.0",
|
2147
|
-
dashify: "2.0.0",
|
2148
|
-
diff: "5.0.0",
|
2149
|
-
editorconfig: "0.15.3",
|
2150
|
-
"editorconfig-to-prettier": "0.2.0",
|
2151
|
-
"escape-string-regexp": "4.0.0",
|
2152
|
-
espree: "7.3.1",
|
2153
|
-
esutils: "2.0.3",
|
2154
|
-
"fast-glob": "3.2.5",
|
2155
|
-
"fast-json-stable-stringify": "2.1.0",
|
2156
|
-
"find-parent-dir": "0.3.1",
|
2157
|
-
"flow-parser": "0.153.0",
|
2158
|
-
"get-stdin": "8.0.0",
|
2159
|
-
globby: "11.0.4",
|
2160
|
-
graphql: "15.5.0",
|
2161
|
-
"html-element-attributes": "2.3.0",
|
2162
|
-
"html-styles": "1.0.0",
|
2163
|
-
"html-tag-names": "1.1.5",
|
2164
|
-
"html-void-elements": "1.0.5",
|
2165
|
-
ignore: "4.0.6",
|
2166
|
-
"jest-docblock": "27.0.1",
|
2167
|
-
json5: "2.2.0",
|
2168
|
-
leven: "3.1.0",
|
2169
|
-
"lines-and-columns": "1.1.6",
|
2170
|
-
"linguist-languages": "7.15.0",
|
2171
|
-
lodash: "4.17.21",
|
2172
|
-
mem: "8.1.1",
|
2173
|
-
meriyah: "4.1.5",
|
2174
|
-
minimatch: "3.0.4",
|
2175
|
-
minimist: "1.2.5",
|
2176
|
-
"n-readlines": "1.0.1",
|
2177
|
-
outdent: "0.8.0",
|
2178
|
-
"parse-srcset": "ikatyang/parse-srcset#54eb9c1cb21db5c62b4d0e275d7249516df6f0ee",
|
2179
|
-
"please-upgrade-node": "3.2.0",
|
2180
|
-
"postcss-less": "3.1.4",
|
2181
|
-
"postcss-media-query-parser": "0.2.3",
|
2182
|
-
"postcss-scss": "2.1.1",
|
2183
|
-
"postcss-selector-parser": "2.2.3",
|
2184
|
-
"postcss-values-parser": "2.0.1",
|
2185
|
-
"regexp-util": "1.2.2",
|
2186
|
-
"remark-footnotes": "2.0.0",
|
2187
|
-
"remark-math": "3.0.1",
|
2188
|
-
"remark-parse": "8.0.3",
|
2189
|
-
resolve: "1.20.0",
|
2190
|
-
semver: "7.3.5",
|
2191
|
-
"string-width": "4.2.2",
|
2192
|
-
"strip-ansi": "6.0.0",
|
2193
|
-
typescript: "4.3.4",
|
2194
|
-
"unicode-regex": "3.0.0",
|
2195
|
-
unified: "9.2.1",
|
2196
|
-
vnopts: "1.0.2",
|
2197
|
-
wcwidth: "1.0.1",
|
2198
|
-
"yaml-unist-parser": "1.3.1"
|
2199
|
-
};
|
2200
|
-
var devDependencies = {
|
2201
|
-
"@babel/core": "7.14.6",
|
2202
|
-
"@babel/preset-env": "7.14.5",
|
2203
|
-
"@babel/types": "7.14.5",
|
2204
|
-
"@glimmer/reference": "0.79.3",
|
2205
|
-
"@rollup/plugin-alias": "3.1.2",
|
2206
|
-
"@rollup/plugin-babel": "5.3.0",
|
2207
|
-
"@rollup/plugin-commonjs": "18.1.0",
|
2208
|
-
"@rollup/plugin-json": "4.1.0",
|
2209
|
-
"@rollup/plugin-node-resolve": "13.0.0",
|
2210
|
-
"@rollup/plugin-replace": "2.4.2",
|
2211
|
-
"@types/estree": "0.0.48",
|
2212
|
-
"babel-jest": "27.0.2",
|
2213
|
-
"babel-loader": "8.2.2",
|
2214
|
-
benchmark: "2.1.4",
|
2215
|
-
"builtin-modules": "3.2.0",
|
2216
|
-
"core-js": "3.14.0",
|
2217
|
-
"cross-env": "7.0.3",
|
2218
|
-
cspell: "4.2.8",
|
2219
|
-
eslint: "7.29.0",
|
2220
|
-
"eslint-config-prettier": "8.3.0",
|
2221
|
-
"eslint-formatter-friendly": "7.0.0",
|
2222
|
-
"eslint-plugin-import": "2.23.4",
|
2223
|
-
"eslint-plugin-jest": "24.3.6",
|
2224
|
-
"eslint-plugin-prettier-internal-rules": "link:scripts/tools/eslint-plugin-prettier-internal-rules",
|
2225
|
-
"eslint-plugin-react": "7.24.0",
|
2226
|
-
"eslint-plugin-regexp": "0.12.1",
|
2227
|
-
"eslint-plugin-unicorn": "33.0.1",
|
2228
|
-
"esm-utils": "1.1.0",
|
2229
|
-
execa: "5.1.1",
|
2230
|
-
jest: "27.0.4",
|
2231
|
-
"jest-snapshot-serializer-ansi": "1.0.0",
|
2232
|
-
"jest-snapshot-serializer-raw": "1.2.0",
|
2233
|
-
"jest-watch-typeahead": "0.6.4",
|
2234
|
-
"npm-run-all": "4.1.5",
|
2235
|
-
"path-browserify": "1.0.1",
|
2236
|
-
prettier: "2.3.1",
|
2237
|
-
"pretty-bytes": "5.6.0",
|
2238
|
-
rimraf: "3.0.2",
|
2239
|
-
rollup: "2.52.1",
|
2240
|
-
"rollup-plugin-polyfill-node": "0.6.2",
|
2241
|
-
"rollup-plugin-terser": "7.0.2",
|
2242
|
-
shelljs: "0.8.4",
|
2243
|
-
"snapshot-diff": "0.9.0",
|
2244
|
-
tempy: "1.0.1",
|
2245
|
-
"terser-webpack-plugin": "5.1.3",
|
2246
|
-
webpack: "5.39.1"
|
2247
|
-
};
|
2248
|
-
var scripts = {
|
2249
|
-
prepublishOnly: "echo \"Error: must publish from dist/\" && exit 1",
|
2250
|
-
"prepare-release": "yarn && yarn build && yarn test:dist",
|
2251
|
-
test: "jest",
|
2252
|
-
"test:dev-package": "cross-env INSTALL_PACKAGE=1 jest",
|
2253
|
-
"test:dist": "cross-env NODE_ENV=production jest",
|
2254
|
-
"test:dist-standalone": "cross-env NODE_ENV=production TEST_STANDALONE=1 jest",
|
2255
|
-
"test:integration": "jest tests/integration",
|
2256
|
-
"perf:repeat": "yarn && yarn build && cross-env NODE_ENV=production node ./dist/bin-prettier.js --debug-repeat ${PERF_REPEAT:-1000} --loglevel debug ${PERF_FILE:-./index.js} > /dev/null",
|
2257
|
-
"perf:repeat-inspect": "yarn && yarn build && cross-env NODE_ENV=production node --inspect-brk ./dist/bin-prettier.js --debug-repeat ${PERF_REPEAT:-1000} --loglevel debug ${PERF_FILE:-./index.js} > /dev/null",
|
2258
|
-
"perf:benchmark": "yarn && yarn build && cross-env NODE_ENV=production node ./dist/bin-prettier.js --debug-benchmark --loglevel debug ${PERF_FILE:-./index.js} > /dev/null",
|
2259
|
-
lint: "run-p lint:*",
|
2260
|
-
"lint:typecheck": "tsc",
|
2261
|
-
"lint:eslint": "cross-env EFF_NO_LINK_RULES=true eslint . --format friendly",
|
2262
|
-
"lint:changelog": "node ./scripts/lint-changelog.mjs",
|
2263
|
-
"lint:prettier": "prettier . \"!test*\" --check",
|
2264
|
-
"lint:dist": "eslint --no-eslintrc --no-ignore --no-inline-config --env=es6,browser --parser-options=ecmaVersion:2019 \"dist/!(bin-prettier|index|third-party).js\"",
|
2265
|
-
"lint:spellcheck": "cspell \"**/*\" \".github/**/*\"",
|
2266
|
-
"lint:deps": "node ./scripts/check-deps.mjs",
|
2267
|
-
fix: "run-s fix:eslint fix:prettier",
|
2268
|
-
"fix:eslint": "yarn lint:eslint --fix",
|
2269
|
-
"fix:prettier": "yarn lint:prettier --write",
|
2270
|
-
build: "node --max-old-space-size=3072 ./scripts/build/build.mjs",
|
2271
|
-
"build-docs": "node ./scripts/build-docs.mjs"
|
2272
|
-
};
|
2273
|
-
var require$$3 = {
|
2274
|
-
name: name,
|
2275
|
-
version: version,
|
2276
|
-
description: description,
|
2277
|
-
bin: bin,
|
2278
|
-
repository: repository,
|
2279
|
-
homepage: homepage,
|
2280
|
-
author: author,
|
2281
|
-
license: license,
|
2282
|
-
main: main,
|
2283
|
-
browser: browser,
|
2284
|
-
unpkg: unpkg,
|
2285
|
-
engines: engines,
|
2286
|
-
files: files,
|
2287
|
-
dependencies: dependencies,
|
2288
|
-
devDependencies: devDependencies,
|
2289
|
-
scripts: scripts
|
2290
|
-
};
|
2158
|
+
var require$$3 = {"version":"2.4.1"};
|
2291
2159
|
|
2292
2160
|
var lib = createCommonjsModule(function (module, exports) {
|
2293
2161
|
|
@@ -3261,7 +3129,7 @@
|
|
3261
3129
|
|
3262
3130
|
|
3263
3131
|
function getNextNonSpaceNonCommentCharacter(text, node, locEnd) {
|
3264
|
-
return text.charAt( // @ts-
|
3132
|
+
return text.charAt( // @ts-expect-error => TBD: can return false, should we define a fallback?
|
3265
3133
|
getNextNonSpaceNonCommentCharacterIndex(text, node, locEnd));
|
3266
3134
|
} // Not using, but it's public utils
|
3267
3135
|
|
@@ -4104,13 +3972,13 @@
|
|
4104
3972
|
});
|
4105
3973
|
}
|
4106
3974
|
|
4107
|
-
function
|
4108
|
-
return mapDoc(doc, currentDoc => typeof currentDoc === "string" && currentDoc.includes("\n") ?
|
3975
|
+
function replaceEndOfLine(doc) {
|
3976
|
+
return mapDoc(doc, currentDoc => typeof currentDoc === "string" && currentDoc.includes("\n") ? replaceTextEndOfLine(currentDoc) : currentDoc);
|
4109
3977
|
} // This function need return array
|
4110
3978
|
// TODO: remove `.parts` when we remove `docBuilders.concat()`
|
4111
3979
|
|
4112
3980
|
|
4113
|
-
function
|
3981
|
+
function replaceTextEndOfLine(text, replacement = literalline) {
|
4114
3982
|
return join(replacement, text.split("\n")).parts;
|
4115
3983
|
}
|
4116
3984
|
|
@@ -4127,8 +3995,8 @@
|
|
4127
3995
|
normalizeParts,
|
4128
3996
|
normalizeDoc,
|
4129
3997
|
cleanDoc,
|
4130
|
-
|
4131
|
-
|
3998
|
+
replaceTextEndOfLine,
|
3999
|
+
replaceEndOfLine
|
4132
4000
|
};
|
4133
4001
|
|
4134
4002
|
const {
|