diff --git a/data/prefixes.js b/data/prefixes.js index d9872fb23..674d95775 100644 --- a/data/prefixes.js +++ b/data/prefixes.js @@ -68,9 +68,9 @@ f(prefixBorderRadius, browsers => 'border-bottom-left-radius' ], { - mistakes: ['-khtml-', '-ms-', '-o-'], + browsers, feature: 'border-radius', - browsers + mistakes: ['-khtml-', '-ms-', '-o-'] } ) ) @@ -80,9 +80,9 @@ let prefixBoxshadow = require('caniuse-lite/data/features/css-boxshadow') f(prefixBoxshadow, browsers => prefix(['box-shadow'], { - mistakes: ['-khtml-'], + browsers, feature: 'css-boxshadow', - browsers + mistakes: ['-khtml-'] }) ) @@ -104,9 +104,9 @@ f(prefixAnimation, browsers => '@keyframes' ], { - mistakes: ['-khtml-', '-ms-'], + browsers, feature: 'css-animation', - browsers + mistakes: ['-khtml-', '-ms-'] } ) ) @@ -124,9 +124,9 @@ f(prefixTransition, browsers => 'transition-timing-function' ], { - mistakes: ['-khtml-', '-ms-'], browsers, - feature: 'css-transitions' + feature: 'css-transitions', + mistakes: ['-khtml-', '-ms-'] } ) ) @@ -136,8 +136,8 @@ let prefixTransform2d = require('caniuse-lite/data/features/transforms2d') f(prefixTransform2d, browsers => prefix(['transform', 'transform-origin'], { - feature: 'transforms2d', - browsers + browsers, + feature: 'transforms2d' }) ) @@ -146,21 +146,21 @@ let prefixTransforms3d = require('caniuse-lite/data/features/transforms3d') f(prefixTransforms3d, browsers => { prefix(['perspective', 'perspective-origin'], { - feature: 'transforms3d', - browsers + browsers, + feature: 'transforms3d' }) return prefix(['transform-style'], { - mistakes: ['-ms-', '-o-'], browsers, - feature: 'transforms3d' + feature: 'transforms3d', + mistakes: ['-ms-', '-o-'] }) }) f(prefixTransforms3d, { match: /y\sx|y\s#2/ }, browsers => prefix(['backface-visibility'], { - mistakes: ['-ms-', '-o-'], + browsers, feature: 'transforms3d', - browsers + mistakes: ['-ms-', '-o-'] }) ) @@ -176,6 +176,9 @@ f(prefixGradients, { match: /y\sx/ }, browsers => 'repeating-radial-gradient' ], { + browsers, + feature: 'css-gradients', + mistakes: ['-ms-'], props: [ 'background', 'background-image', @@ -185,10 +188,7 @@ f(prefixGradients, { match: /y\sx/ }, browsers => 'list-style-image', 'content', 'mask-image' - ], - mistakes: ['-ms-'], - feature: 'css-gradients', - browsers + ] } ) ) @@ -209,8 +209,8 @@ f(prefixGradients, { match: /a\sx/ }, browsers => { 'repeating-radial-gradient' ], { - feature: 'css-gradients', - browsers + browsers, + feature: 'css-gradients' } ) }) @@ -220,8 +220,8 @@ let prefixBoxsizing = require('caniuse-lite/data/features/css3-boxsizing') f(prefixBoxsizing, browsers => prefix(['box-sizing'], { - feature: 'css3-boxsizing', - browsers + browsers, + feature: 'css3-boxsizing' }) ) @@ -230,8 +230,8 @@ let prefixFilters = require('caniuse-lite/data/features/css-filters') f(prefixFilters, browsers => prefix(['filter'], { - feature: 'css-filters', - browsers + browsers, + feature: 'css-filters' }) ) @@ -240,6 +240,8 @@ let prefixFilterFunction = require('caniuse-lite/data/features/css-filter-functi f(prefixFilterFunction, browsers => prefix(['filter-function'], { + browsers, + feature: 'css-filter-function', props: [ 'background', 'background-image', @@ -249,9 +251,7 @@ f(prefixFilterFunction, browsers => 'list-style-image', 'content', 'mask-image' - ], - feature: 'css-filter-function', - browsers + ] }) ) @@ -260,8 +260,8 @@ let prefixBackdrop = require('caniuse-lite/data/features/css-backdrop-filter') f(prefixBackdrop, { match: /y\sx|y\s#2/ }, browsers => prefix(['backdrop-filter'], { - feature: 'css-backdrop-filter', - browsers + browsers, + feature: 'css-backdrop-filter' }) ) @@ -270,6 +270,8 @@ let prefixElementFunction = require('caniuse-lite/data/features/css-element-func f(prefixElementFunction, browsers => prefix(['element'], { + browsers, + feature: 'css-element-function', props: [ 'background', 'background-image', @@ -279,9 +281,7 @@ f(prefixElementFunction, browsers => 'list-style-image', 'content', 'mask-image' - ], - feature: 'css-element-function', - browsers + ] }) ) @@ -303,15 +303,15 @@ f(prefixMulticolumns, browsers => { 'column-fill' ], { - feature: 'multicolumn', - browsers + browsers, + feature: 'multicolumn' } ) let noff = browsers.filter(i => !/firefox/.test(i)) prefix(['break-before', 'break-after', 'break-inside'], { - feature: 'multicolumn', - browsers: noff + browsers: noff, + feature: 'multicolumn' }) }) @@ -320,9 +320,9 @@ let prefixUserSelect = require('caniuse-lite/data/features/user-select-none') f(prefixUserSelect, browsers => prefix(['user-select'], { - mistakes: ['-khtml-'], + browsers, feature: 'user-select-none', - browsers + mistakes: ['-khtml-'] }) ) @@ -338,13 +338,13 @@ f(prefixFlexbox, { match: /a\sx/ }, browsers => { } }) prefix(['display-flex', 'inline-flex'], { - props: ['display'], + browsers, feature: 'flexbox', - browsers + props: ['display'] }) prefix(['flex', 'flex-grow', 'flex-shrink', 'flex-basis'], { - feature: 'flexbox', - browsers + browsers, + feature: 'flexbox' }) prefix( [ @@ -358,20 +358,20 @@ f(prefixFlexbox, { match: /a\sx/ }, browsers => { 'align-content' ], { - feature: 'flexbox', - browsers + browsers, + feature: 'flexbox' } ) }) f(prefixFlexbox, { match: /y\sx/ }, browsers => { add(['display-flex', 'inline-flex'], { - feature: 'flexbox', - browsers + browsers, + feature: 'flexbox' }) add(['flex', 'flex-grow', 'flex-shrink', 'flex-basis'], { - feature: 'flexbox', - browsers + browsers, + feature: 'flexbox' }) add( [ @@ -385,8 +385,8 @@ f(prefixFlexbox, { match: /y\sx/ }, browsers => { 'align-content' ], { - feature: 'flexbox', - browsers + browsers, + feature: 'flexbox' } ) }) @@ -396,9 +396,9 @@ let prefixCalc = require('caniuse-lite/data/features/calc') f(prefixCalc, browsers => prefix(['calc'], { - props: ['*'], + browsers, feature: 'calc', - browsers + props: ['*'] }) ) @@ -407,8 +407,8 @@ let prefixBackgroundOptions = require('caniuse-lite/data/features/background-img f(prefixBackgroundOptions, browsers => prefix(['background-origin', 'background-size'], { - feature: 'background-img-opts', - browsers + browsers, + feature: 'background-img-opts' }) ) @@ -417,8 +417,8 @@ let prefixBackgroundClipText = require('caniuse-lite/data/features/background-cl f(prefixBackgroundClipText, browsers => prefix(['background-clip'], { - feature: 'background-clip-text', - browsers + browsers, + feature: 'background-clip-text' }) ) @@ -433,8 +433,8 @@ f(prefixFontFeature, browsers => 'font-language-override' ], { - feature: 'font-feature', - browsers + browsers, + feature: 'font-feature' } ) ) @@ -444,8 +444,8 @@ let prefixFontKerning = require('caniuse-lite/data/features/font-kerning') f(prefixFontKerning, browsers => prefix(['font-kerning'], { - feature: 'font-kerning', - browsers + browsers, + feature: 'font-kerning' }) ) @@ -454,8 +454,8 @@ let prefixBorderImage = require('caniuse-lite/data/features/border-image') f(prefixBorderImage, browsers => prefix(['border-image'], { - feature: 'border-image', - browsers + browsers, + feature: 'border-image' }) ) @@ -464,9 +464,9 @@ let prefixSelection = require('caniuse-lite/data/features/css-selection') f(prefixSelection, browsers => prefix(['::selection'], { - selector: true, + browsers, feature: 'css-selection', - browsers + selector: true }) ) @@ -475,9 +475,9 @@ let prefixPlaceholder = require('caniuse-lite/data/features/css-placeholder') f(prefixPlaceholder, browsers => { prefix(['::placeholder'], { - selector: true, + browsers: browsers.concat(['ie 10 old', 'ie 11 old', 'firefox 18 old']), feature: 'css-placeholder', - browsers: browsers.concat(['ie 10 old', 'ie 11 old', 'firefox 18 old']) + selector: true }) }) @@ -486,9 +486,9 @@ let prefixPlaceholderShown = require('caniuse-lite/data/features/css-placeholder f(prefixPlaceholderShown, browsers => { prefix([':placeholder-shown'], { - selector: true, + browsers, feature: 'css-placeholder-shown', - browsers + selector: true }) }) @@ -497,8 +497,8 @@ let prefixHyphens = require('caniuse-lite/data/features/css-hyphens') f(prefixHyphens, browsers => prefix(['hyphens'], { - feature: 'css-hyphens', - browsers + browsers, + feature: 'css-hyphens' }) ) @@ -507,17 +507,17 @@ let prefixFullscreen = require('caniuse-lite/data/features/fullscreen') f(prefixFullscreen, browsers => prefix([':fullscreen'], { - selector: true, + browsers, feature: 'fullscreen', - browsers + selector: true }) ) f(prefixFullscreen, { match: /x(\s#2|$)/ }, browsers => prefix(['::backdrop'], { - selector: true, + browsers, feature: 'fullscreen', - browsers + selector: true }) ) @@ -526,9 +526,9 @@ let prefixFileSelectorButton = require('caniuse-lite/data/features/css-file-sele f(prefixFileSelectorButton, browsers => prefix(['::file-selector-button'], { - selector: true, + browsers, feature: 'file-selector-button', - browsers + selector: true }) ) @@ -537,9 +537,9 @@ let prefixAutofill = require('caniuse-lite/data/features/css-autofill') f(prefixAutofill, browsers => prefix([':autofill'], { - selector: true, + browsers, feature: 'css-autofill', - browsers + selector: true }) ) @@ -548,8 +548,8 @@ let prefixTabsize = require('caniuse-lite/data/features/css3-tabsize') f(prefixTabsize, browsers => prefix(['tab-size'], { - feature: 'css3-tabsize', - browsers + browsers, + feature: 'css3-tabsize' }) ) @@ -579,25 +579,25 @@ let sizeProps = [ f(prefixIntrinsic, browsers => prefix(['max-content', 'min-content'], { - props: sizeProps, + browsers, feature: 'intrinsic-width', - browsers + props: sizeProps }) ) f(prefixIntrinsic, { match: /x|\s#4/ }, browsers => prefix(['fill', 'fill-available'], { - props: sizeProps, + browsers, feature: 'intrinsic-width', - browsers + props: sizeProps }) ) f(prefixIntrinsic, { match: /x|\s#5/ }, browsers => prefix(['fit-content'], { - props: sizeProps, + browsers, feature: 'intrinsic-width', - browsers + props: sizeProps }) ) @@ -607,9 +607,9 @@ let prefixStretch = require('caniuse-lite/data/features/css-width-stretch') f(prefixStretch, browsers => prefix(['stretch'], { - props: sizeProps, + browsers, feature: 'css-width-stretch', - browsers + props: sizeProps }) ) @@ -618,9 +618,9 @@ let prefixCursorsNewer = require('caniuse-lite/data/features/css3-cursors-newer' f(prefixCursorsNewer, browsers => prefix(['zoom-in', 'zoom-out'], { - props: ['cursor'], + browsers, feature: 'css3-cursors-newer', - browsers + props: ['cursor'] }) ) @@ -629,9 +629,9 @@ let prefixCursorsGrab = require('caniuse-lite/data/features/css3-cursors-grab') f(prefixCursorsGrab, browsers => prefix(['grab', 'grabbing'], { - props: ['cursor'], + browsers, feature: 'css3-cursors-grab', - browsers + props: ['cursor'] }) ) @@ -640,9 +640,9 @@ let prefixSticky = require('caniuse-lite/data/features/css-sticky') f(prefixSticky, browsers => prefix(['sticky'], { - props: ['position'], + browsers, feature: 'css-sticky', - browsers + props: ['position'] }) ) @@ -651,8 +651,8 @@ let prefixPointer = require('caniuse-lite/data/features/pointer') f(prefixPointer, browsers => prefix(['touch-action'], { - feature: 'pointer', - browsers + browsers, + feature: 'pointer' }) ) @@ -661,8 +661,8 @@ let prefixDecoration = require('caniuse-lite/data/features/text-decoration') f(prefixDecoration, { match: /x.*#[235]/ }, browsers => prefix(['text-decoration-skip', 'text-decoration-skip-ink'], { - feature: 'text-decoration', - browsers + browsers, + feature: 'text-decoration' }) ) @@ -670,8 +670,8 @@ let prefixDecorationShorthand = require('caniuse-lite/data/features/mdn-text-dec f(prefixDecorationShorthand, browsers => prefix(['text-decoration'], { - feature: 'text-decoration', - browsers + browsers, + feature: 'text-decoration' }) ) @@ -679,8 +679,8 @@ let prefixDecorationColor = require('caniuse-lite/data/features/mdn-text-decorat f(prefixDecorationColor, browsers => prefix(['text-decoration-color'], { - feature: 'text-decoration', - browsers + browsers, + feature: 'text-decoration' }) ) @@ -688,8 +688,8 @@ let prefixDecorationLine = require('caniuse-lite/data/features/mdn-text-decorati f(prefixDecorationLine, browsers => prefix(['text-decoration-line'], { - feature: 'text-decoration', - browsers + browsers, + feature: 'text-decoration' }) ) @@ -697,8 +697,8 @@ let prefixDecorationStyle = require('caniuse-lite/data/features/mdn-text-decorat f(prefixDecorationStyle, browsers => prefix(['text-decoration-style'], { - feature: 'text-decoration', - browsers + browsers, + feature: 'text-decoration' }) ) @@ -707,8 +707,8 @@ let prefixTextSizeAdjust = require('caniuse-lite/data/features/text-size-adjust' f(prefixTextSizeAdjust, browsers => prefix(['text-size-adjust'], { - feature: 'text-size-adjust', - browsers + browsers, + feature: 'text-size-adjust' }) ) @@ -727,8 +727,8 @@ f(prefixCssMasks, browsers => { 'mask-border-source' ], { - feature: 'css-masks', - browsers + browsers, + feature: 'css-masks' } ) prefix( @@ -742,8 +742,8 @@ f(prefixCssMasks, browsers => { 'mask-border-slice' ], { - feature: 'css-masks', - browsers + browsers, + feature: 'css-masks' } ) }) @@ -753,8 +753,8 @@ let prefixClipPath = require('caniuse-lite/data/features/css-clip-path') f(prefixClipPath, browsers => prefix(['clip-path'], { - feature: 'css-clip-path', - browsers + browsers, + feature: 'css-clip-path' }) ) @@ -763,8 +763,8 @@ let prefixBoxdecoration = require('caniuse-lite/data/features/css-boxdecorationb f(prefixBoxdecoration, browsers => prefix(['box-decoration-break'], { - feature: 'css-boxdecorationbreak', - browsers + browsers, + feature: 'css-boxdecorationbreak' }) ) @@ -773,8 +773,8 @@ let prefixObjectFit = require('caniuse-lite/data/features/object-fit') f(prefixObjectFit, browsers => prefix(['object-fit', 'object-position'], { - feature: 'object-fit', - browsers + browsers, + feature: 'object-fit' }) ) @@ -783,8 +783,8 @@ let prefixShapes = require('caniuse-lite/data/features/css-shapes') f(prefixShapes, browsers => prefix(['shape-margin', 'shape-outside', 'shape-image-threshold'], { - feature: 'css-shapes', - browsers + browsers, + feature: 'css-shapes' }) ) @@ -793,8 +793,8 @@ let prefixTextOverflow = require('caniuse-lite/data/features/text-overflow') f(prefixTextOverflow, browsers => prefix(['text-overflow'], { - feature: 'text-overflow', - browsers + browsers, + feature: 'text-overflow' }) ) @@ -803,8 +803,8 @@ let prefixDeviceadaptation = require('caniuse-lite/data/features/css-deviceadapt f(prefixDeviceadaptation, browsers => prefix(['@viewport'], { - feature: 'css-deviceadaptation', - browsers + browsers, + feature: 'css-deviceadaptation' }) ) @@ -813,8 +813,8 @@ let prefixResolut = require('caniuse-lite/data/features/css-media-resolution') f(prefixResolut, { match: /( x($| )|a #2)/ }, browsers => prefix(['@resolution'], { - feature: 'css-media-resolution', - browsers + browsers, + feature: 'css-media-resolution' }) ) @@ -823,8 +823,8 @@ let prefixTextAlignLast = require('caniuse-lite/data/features/css-text-align-las f(prefixTextAlignLast, browsers => prefix(['text-align-last'], { - feature: 'css-text-align-last', - browsers + browsers, + feature: 'css-text-align-last' }) ) @@ -833,16 +833,16 @@ let prefixCrispedges = require('caniuse-lite/data/features/css-crisp-edges') f(prefixCrispedges, { match: /y x|a x #1/ }, browsers => prefix(['pixelated'], { - props: ['image-rendering'], + browsers, feature: 'css-crisp-edges', - browsers + props: ['image-rendering'] }) ) f(prefixCrispedges, { match: /a x #2/ }, browsers => prefix(['image-rendering'], { - feature: 'css-crisp-edges', - browsers + browsers, + feature: 'css-crisp-edges' }) ) @@ -860,8 +860,8 @@ f(prefixLogicalProps, browsers => 'padding-inline-end' ], { - feature: 'css-logical-props', - browsers + browsers, + feature: 'css-logical-props' } ) ) @@ -877,8 +877,8 @@ f(prefixLogicalProps, { match: /x\s#2/ }, browsers => 'padding-block-end' ], { - feature: 'css-logical-props', - browsers + browsers, + feature: 'css-logical-props' } ) ) @@ -888,8 +888,8 @@ let prefixAppearance = require('caniuse-lite/data/features/css-appearance') f(prefixAppearance, { match: /#2|x/ }, browsers => prefix(['appearance'], { - feature: 'css-appearance', - browsers + browsers, + feature: 'css-appearance' }) ) @@ -906,8 +906,8 @@ f(prefixSnappoints, browsers => 'scroll-snap-points-y' ], { - feature: 'css-snappoints', - browsers + browsers, + feature: 'css-snappoints' } ) ) @@ -917,8 +917,8 @@ let prefixRegions = require('caniuse-lite/data/features/css-regions') f(prefixRegions, browsers => prefix(['flow-into', 'flow-from', 'region-fragment'], { - feature: 'css-regions', - browsers + browsers, + feature: 'css-regions' }) ) @@ -927,6 +927,8 @@ let prefixImageSet = require('caniuse-lite/data/features/css-image-set') f(prefixImageSet, browsers => prefix(['image-set'], { + browsers, + feature: 'css-image-set', props: [ 'background', 'background-image', @@ -937,9 +939,7 @@ f(prefixImageSet, browsers => 'list-style', 'list-style-image', 'content' - ], - feature: 'css-image-set', - browsers + ] }) ) @@ -948,8 +948,8 @@ let prefixWritingMode = require('caniuse-lite/data/features/css-writing-mode') f(prefixWritingMode, { match: /a|x/ }, browsers => prefix(['writing-mode'], { - feature: 'css-writing-mode', - browsers + browsers, + feature: 'css-writing-mode' }) ) @@ -958,6 +958,8 @@ let prefixCrossFade = require('caniuse-lite/data/features/css-cross-fade') f(prefixCrossFade, browsers => prefix(['cross-fade'], { + browsers, + feature: 'css-cross-fade', props: [ 'background', 'background-image', @@ -967,9 +969,7 @@ f(prefixCrossFade, browsers => 'list-style-image', 'content', 'mask-image' - ], - feature: 'css-cross-fade', - browsers + ] }) ) @@ -978,9 +978,9 @@ let prefixReadOnly = require('caniuse-lite/data/features/css-read-only-write') f(prefixReadOnly, browsers => prefix([':read-only', ':read-write'], { - selector: true, + browsers, feature: 'css-read-only-write', - browsers + selector: true }) ) @@ -996,8 +996,8 @@ f(prefixTextEmphasis, browsers => 'text-emphasis-color' ], { - feature: 'text-emphasis', - browsers + browsers, + feature: 'text-emphasis' } ) ) @@ -1007,9 +1007,9 @@ let prefixGrid = require('caniuse-lite/data/features/css-grid') f(prefixGrid, browsers => { prefix(['display-grid', 'inline-grid'], { - props: ['display'], + browsers, feature: 'css-grid', - browsers + props: ['display'] }) prefix( [ @@ -1027,16 +1027,16 @@ f(prefixGrid, browsers => { 'place-self' ], { - feature: 'css-grid', - browsers + browsers, + feature: 'css-grid' } ) }) f(prefixGrid, { match: /a x/ }, browsers => prefix(['grid-column-align', 'grid-row-align'], { - feature: 'css-grid', - browsers + browsers, + feature: 'css-grid' }) ) @@ -1045,8 +1045,8 @@ let prefixTextSpacing = require('caniuse-lite/data/features/css-text-spacing') f(prefixTextSpacing, browsers => prefix(['text-spacing'], { - feature: 'css-text-spacing', - browsers + browsers, + feature: 'css-text-spacing' }) ) @@ -1055,9 +1055,9 @@ let prefixAnyLink = require('caniuse-lite/data/features/css-any-link') f(prefixAnyLink, browsers => prefix([':any-link'], { - selector: true, + browsers, feature: 'css-any-link', - browsers + selector: true }) ) @@ -1067,9 +1067,9 @@ let bidiIsolate = require('caniuse-lite/data/features/mdn-css-unicode-bidi-isola f(bidiIsolate, browsers => prefix(['isolate'], { - props: ['unicode-bidi'], + browsers, feature: 'css-unicode-bidi', - browsers + props: ['unicode-bidi'] }) ) @@ -1077,9 +1077,9 @@ let bidiPlaintext = require('caniuse-lite/data/features/mdn-css-unicode-bidi-pla f(bidiPlaintext, browsers => prefix(['plaintext'], { - props: ['unicode-bidi'], + browsers, feature: 'css-unicode-bidi', - browsers + props: ['unicode-bidi'] }) ) @@ -1087,9 +1087,9 @@ let bidiOverride = require('caniuse-lite/data/features/mdn-css-unicode-bidi-isol f(bidiOverride, { match: /y x/ }, browsers => prefix(['isolate-override'], { - props: ['unicode-bidi'], + browsers, feature: 'css-unicode-bidi', - browsers + props: ['unicode-bidi'] }) ) @@ -1098,8 +1098,8 @@ let prefixOverscroll = require('caniuse-lite/data/features/css-overscroll-behavi f(prefixOverscroll, { match: /a #1/ }, browsers => prefix(['overscroll-behavior'], { - feature: 'css-overscroll-behavior', - browsers + browsers, + feature: 'css-overscroll-behavior' }) ) @@ -1108,8 +1108,8 @@ let prefixTextOrientation = require('caniuse-lite/data/features/css-text-orienta f(prefixTextOrientation, browsers => prefix(['text-orientation'], { - feature: 'css-text-orientation', - browsers + browsers, + feature: 'css-text-orientation' }) ) @@ -1118,7 +1118,7 @@ let prefixPrintAdjust = require('caniuse-lite/data/features/css-print-color-adju f(prefixPrintAdjust, browsers => prefix(['print-color-adjust', 'color-adjust'], { - feature: 'css-print-color-adjust', - browsers + browsers, + feature: 'css-print-color-adjust' }) ) diff --git a/lib/autoprefixer.js b/lib/autoprefixer.js index 8a9f5cd60..a44329024 100644 --- a/lib/autoprefixer.js +++ b/lib/autoprefixer.js @@ -96,9 +96,9 @@ function plugin(...reqs) { } let brwlstOpts = { + env: options.env, ignoreUnknownVersions: options.ignoreUnknownVersions, - stats: options.stats, - env: options.env + stats: options.stats } function loadPrefixes(opts) { @@ -114,12 +114,21 @@ function plugin(...reqs) { } return { - postcssPlugin: 'autoprefixer', + browsers: reqs, + + info(opts) { + opts = opts || {} + opts.from = opts.from || process.cwd() + return getInfo(loadPrefixes(opts)) + }, + options, + + postcssPlugin: 'autoprefixer', prepare(result) { let prefixes = loadPrefixes({ - from: result.opts.from, - env: options.env + env: options.env, + from: result.opts.from }) return { @@ -133,16 +142,7 @@ function plugin(...reqs) { } } } - }, - - info(opts) { - opts = opts || {} - opts.from = opts.from || process.cwd() - return getInfo(loadPrefixes(opts)) - }, - - options, - browsers: reqs + } } } diff --git a/lib/browsers.js b/lib/browsers.js index 9d8fd97fc..b268c84cd 100644 --- a/lib/browsers.js +++ b/lib/browsers.js @@ -4,6 +4,13 @@ let { agents } = require('caniuse-lite/dist/unpacker/agents') let utils = require('./utils') class Browsers { + constructor(data, requirements, options, browserslistOpts) { + this.data = data + this.options = options || {} + this.browserslistOpts = browserslistOpts || {} + this.selected = this.parse(requirements) + } + /** * Return all prefixes for default browser data */ @@ -35,11 +42,11 @@ class Browsers { return this.prefixesRegexp.test(value) } - constructor(data, requirements, options, browserslistOpts) { - this.data = data - this.options = options || {} - this.browserslistOpts = browserslistOpts || {} - this.selected = this.parse(requirements) + /** + * Is browser is selected by requirements + */ + isSelected(browser) { + return this.selected.includes(browser) } /** @@ -67,13 +74,6 @@ class Browsers { } return `-${prefix}-` } - - /** - * Is browser is selected by requirements - */ - isSelected(browser) { - return this.selected.includes(browser) - } } module.exports = Browsers diff --git a/lib/declaration.js b/lib/declaration.js index 0f86c30d2..73ea0c4e3 100644 --- a/lib/declaration.js +++ b/lib/declaration.js @@ -4,58 +4,70 @@ let utils = require('./utils') class Declaration extends Prefixer { /** - * Always true, because we already get prefixer by property name + * Clone and add prefixes for declaration */ - check(/* decl */) { - return true + add(decl, prefix, prefixes, result) { + let prefixed = this.prefixed(decl.prop, prefix) + if ( + this.isAlready(decl, prefixed) || + this.otherPrefixes(decl.value, prefix) + ) { + return undefined + } + return this.insert(decl, prefix, prefixes, result) } /** - * Return prefixed version of property + * Calculate indentation to create visual cascade */ - prefixed(prop, prefix) { - return prefix + prop + calcBefore(prefixes, decl, prefix = '') { + let max = this.maxPrefixed(prefixes, decl) + let diff = max - utils.removeNote(prefix).length + + let before = decl.raw('before') + if (diff > 0) { + before += Array(diff).fill(' ').join('') + } + + return before } /** - * Return unprefixed version of property + * Always true, because we already get prefixer by property name */ - normalize(prop) { - return prop + check(/* decl */) { + return true } /** - * Check `value`, that it contain other prefixes, rather than `prefix` + * Clone and insert new declaration */ - otherPrefixes(value, prefix) { - for (let other of Browsers.prefixes()) { - if (other === prefix) { - continue - } - if (value.includes(other)) { - return value.replace(/var\([^)]+\)/, '').includes(other) - } + insert(decl, prefix, prefixes) { + let cloned = this.set(this.clone(decl), prefix) + if (!cloned) return undefined + + let already = decl.parent.some( + i => i.prop === cloned.prop && i.value === cloned.value + ) + if (already) { + return undefined } - return false - } - /** - * Set prefix to declaration - */ - set(decl, prefix) { - decl.prop = this.prefixed(decl.prop, prefix) - return decl + if (this.needCascade(decl)) { + cloned.raws.before = this.calcBefore(prefixes, decl, prefix) + } + return decl.parent.insertBefore(decl, cloned) } /** - * Should we use visual cascade for prefixes + * Did this declaration has this prefix above */ - needCascade(decl) { - if (!decl._autoprefixerCascade) { - decl._autoprefixerCascade = - this.all.options.cascade !== false && decl.raw('before').includes('\n') + isAlready(decl, prefixed) { + let already = this.all.group(decl).up(i => i.prop === prefixed) + if (!already) { + already = this.all.group(decl).down(i => i.prop === prefixed) } - return decl._autoprefixerCascade + return already } /** @@ -79,82 +91,50 @@ class Declaration extends Prefixer { } /** - * Calculate indentation to create visual cascade + * Should we use visual cascade for prefixes */ - calcBefore(prefixes, decl, prefix = '') { - let max = this.maxPrefixed(prefixes, decl) - let diff = max - utils.removeNote(prefix).length - - let before = decl.raw('before') - if (diff > 0) { - before += Array(diff).fill(' ').join('') + needCascade(decl) { + if (!decl._autoprefixerCascade) { + decl._autoprefixerCascade = + this.all.options.cascade !== false && decl.raw('before').includes('\n') } - - return before + return decl._autoprefixerCascade } /** - * Remove visual cascade + * Return unprefixed version of property */ - restoreBefore(decl) { - let lines = decl.raw('before').split('\n') - let min = lines[lines.length - 1] - - this.all.group(decl).up(prefixed => { - let array = prefixed.raw('before').split('\n') - let last = array[array.length - 1] - if (last.length < min.length) { - min = last - } - }) - - lines[lines.length - 1] = min - decl.raws.before = lines.join('\n') + normalize(prop) { + return prop } /** - * Clone and insert new declaration + * Return list of prefixed properties to clean old prefixes */ - insert(decl, prefix, prefixes) { - let cloned = this.set(this.clone(decl), prefix) - if (!cloned) return undefined - - let already = decl.parent.some( - i => i.prop === cloned.prop && i.value === cloned.value - ) - if (already) { - return undefined - } - - if (this.needCascade(decl)) { - cloned.raws.before = this.calcBefore(prefixes, decl, prefix) - } - return decl.parent.insertBefore(decl, cloned) + old(prop, prefix) { + return [this.prefixed(prop, prefix)] } /** - * Did this declaration has this prefix above + * Check `value`, that it contain other prefixes, rather than `prefix` */ - isAlready(decl, prefixed) { - let already = this.all.group(decl).up(i => i.prop === prefixed) - if (!already) { - already = this.all.group(decl).down(i => i.prop === prefixed) + otherPrefixes(value, prefix) { + for (let other of Browsers.prefixes()) { + if (other === prefix) { + continue + } + if (value.includes(other)) { + return value.replace(/var\([^)]+\)/, '').includes(other) + } } - return already + return false } /** - * Clone and add prefixes for declaration + * Return prefixed version of property */ - add(decl, prefix, prefixes, result) { - let prefixed = this.prefixed(decl.prop, prefix) - if ( - this.isAlready(decl, prefixed) || - this.otherPrefixes(decl.value, prefix) - ) { - return undefined - } - return this.insert(decl, prefix, prefixes, result) + prefixed(prop, prefix) { + return prefix + prop } /** @@ -177,10 +157,30 @@ class Declaration extends Prefixer { } /** - * Return list of prefixed properties to clean old prefixes + * Remove visual cascade */ - old(prop, prefix) { - return [this.prefixed(prop, prefix)] + restoreBefore(decl) { + let lines = decl.raw('before').split('\n') + let min = lines[lines.length - 1] + + this.all.group(decl).up(prefixed => { + let array = prefixed.raw('before').split('\n') + let last = array[array.length - 1] + if (last.length < min.length) { + min = last + } + }) + + lines[lines.length - 1] = min + decl.raws.before = lines.join('\n') + } + + /** + * Set prefix to declaration + */ + set(decl, prefix) { + decl.prop = this.prefixed(decl.prop, prefix) + return decl } } diff --git a/lib/hacks/align-content.js b/lib/hacks/align-content.js index 9b1b698d6..a06f381ca 100644 --- a/lib/hacks/align-content.js +++ b/lib/hacks/align-content.js @@ -2,6 +2,13 @@ let flexSpec = require('./flex-spec') let Declaration = require('../declaration') class AlignContent extends Declaration { + /** + * Return property name by final spec + */ + normalize() { + return 'align-content' + } + /** * Change property name for 2012 spec */ @@ -14,13 +21,6 @@ class AlignContent extends Declaration { return super.prefixed(prop, prefix) } - /** - * Return property name by final spec - */ - normalize() { - return 'align-content' - } - /** * Change value for 2012 spec and ignore prefix for 2009 */ @@ -42,8 +42,8 @@ AlignContent.names = ['align-content', 'flex-line-pack'] AlignContent.oldValues = { 'flex-end': 'end', 'flex-start': 'start', - 'space-between': 'justify', - 'space-around': 'distribute' + 'space-around': 'distribute', + 'space-between': 'justify' } module.exports = AlignContent diff --git a/lib/hacks/align-items.js b/lib/hacks/align-items.js index 601a2d481..4dfdd4577 100644 --- a/lib/hacks/align-items.js +++ b/lib/hacks/align-items.js @@ -2,6 +2,13 @@ let flexSpec = require('./flex-spec') let Declaration = require('../declaration') class AlignItems extends Declaration { + /** + * Return property name by final spec + */ + normalize() { + return 'align-items' + } + /** * Change property name for 2009 and 2012 specs */ @@ -17,13 +24,6 @@ class AlignItems extends Declaration { return super.prefixed(prop, prefix) } - /** - * Return property name by final spec - */ - normalize() { - return 'align-items' - } - /** * Change value for 2009 and 2012 specs */ diff --git a/lib/hacks/align-self.js b/lib/hacks/align-self.js index 56cf8b055..a22b1668d 100644 --- a/lib/hacks/align-self.js +++ b/lib/hacks/align-self.js @@ -11,6 +11,13 @@ class AlignSelf extends Declaration { ) } + /** + * Return property name by final spec + */ + normalize() { + return 'align-self' + } + /** * Change property name for 2012 specs */ @@ -23,13 +30,6 @@ class AlignSelf extends Declaration { return super.prefixed(prop, prefix) } - /** - * Return property name by final spec - */ - normalize() { - return 'align-self' - } - /** * Change value for 2012 spec and ignore prefix for 2009 */ diff --git a/lib/hacks/block-logical.js b/lib/hacks/block-logical.js index d223f529d..cb795f7a4 100644 --- a/lib/hacks/block-logical.js +++ b/lib/hacks/block-logical.js @@ -1,16 +1,6 @@ let Declaration = require('../declaration') class BlockLogical extends Declaration { - /** - * Use old syntax for -moz- and -webkit- - */ - prefixed(prop, prefix) { - if (prop.includes('-start')) { - return prefix + prop.replace('-block-start', '-before') - } - return prefix + prop.replace('-block-end', '-after') - } - /** * Return property name by spec */ @@ -20,6 +10,16 @@ class BlockLogical extends Declaration { } return prop.replace('-after', '-block-end') } + + /** + * Use old syntax for -moz- and -webkit- + */ + prefixed(prop, prefix) { + if (prop.includes('-start')) { + return prefix + prop.replace('-block-start', '-before') + } + return prefix + prop.replace('-block-end', '-after') + } } BlockLogical.names = [ diff --git a/lib/hacks/border-radius.js b/lib/hacks/border-radius.js index 0501692d3..47ea835fa 100644 --- a/lib/hacks/border-radius.js +++ b/lib/hacks/border-radius.js @@ -1,6 +1,13 @@ let Declaration = require('../declaration') class BorderRadius extends Declaration { + /** + * Return unprefixed version of property + */ + normalize(prop) { + return BorderRadius.toNormal[prop] || prop + } + /** * Change syntax, when add Mozilla prefix */ @@ -10,13 +17,6 @@ class BorderRadius extends Declaration { } return super.prefixed(prop, prefix) } - - /** - * Return unprefixed version of property - */ - normalize(prop) { - return BorderRadius.toNormal[prop] || prop - } } BorderRadius.names = ['border-radius'] diff --git a/lib/hacks/break-props.js b/lib/hacks/break-props.js index 45252cd1d..b67b12f9c 100644 --- a/lib/hacks/break-props.js +++ b/lib/hacks/break-props.js @@ -2,10 +2,16 @@ let Declaration = require('../declaration') class BreakProps extends Declaration { /** - * Change name for -webkit- and -moz- prefix + * Don’t prefix some values */ - prefixed(prop, prefix) { - return `${prefix}column-${prop}` + insert(decl, prefix, prefixes) { + if (decl.prop !== 'break-inside') { + return super.insert(decl, prefix, prefixes) + } + if (/region/i.test(decl.value) || /page/i.test(decl.value)) { + return undefined + } + return super.insert(decl, prefix, prefixes) } /** @@ -21,6 +27,13 @@ class BreakProps extends Declaration { return 'break-after' } + /** + * Change name for -webkit- and -moz- prefix + */ + prefixed(prop, prefix) { + return `${prefix}column-${prop}` + } + /** * Change prefixed value for avoid-column and avoid-page */ @@ -33,19 +46,6 @@ class BreakProps extends Declaration { } return super.set(decl, prefix) } - - /** - * Don’t prefix some values - */ - insert(decl, prefix, prefixes) { - if (decl.prop !== 'break-inside') { - return super.insert(decl, prefix, prefixes) - } - if (/region/i.test(decl.value) || /page/i.test(decl.value)) { - return undefined - } - return super.insert(decl, prefix, prefixes) - } } BreakProps.names = [ diff --git a/lib/hacks/display-flex.js b/lib/hacks/display-flex.js index cc6cffca2..8a5473e58 100644 --- a/lib/hacks/display-flex.js +++ b/lib/hacks/display-flex.js @@ -17,6 +17,15 @@ class DisplayFlex extends Value { return decl.prop === 'display' && decl.value === this.name } + /** + * Change value for old specs + */ + old(prefix) { + let prefixed = this.prefixed(prefix) + if (!prefixed) return undefined + return new OldValue(this.name, prefixed) + } + /** * Return value by spec */ @@ -49,15 +58,6 @@ class DisplayFlex extends Value { replace(string, prefix) { return this.prefixed(prefix) } - - /** - * Change value for old specs - */ - old(prefix) { - let prefixed = this.prefixed(prefix) - if (!prefixed) return undefined - return new OldValue(this.name, prefixed) - } } DisplayFlex.names = ['display-flex', 'inline-flex'] diff --git a/lib/hacks/flex-direction.js b/lib/hacks/flex-direction.js index b222b08e0..83fe6a9b7 100644 --- a/lib/hacks/flex-direction.js +++ b/lib/hacks/flex-direction.js @@ -2,13 +2,6 @@ let flexSpec = require('./flex-spec') let Declaration = require('../declaration') class FlexDirection extends Declaration { - /** - * Return property name by final spec - */ - normalize() { - return 'flex-direction' - } - /** * Use two properties for 2009 spec */ @@ -53,6 +46,13 @@ class FlexDirection extends Declaration { return decl.parent.insertBefore(decl, cloned) } + /** + * Return property name by final spec + */ + normalize() { + return 'flex-direction' + } + /** * Clean two properties for 2009 spec */ diff --git a/lib/hacks/flex.js b/lib/hacks/flex.js index 6a4fdf769..e3b2fefda 100644 --- a/lib/hacks/flex.js +++ b/lib/hacks/flex.js @@ -4,6 +4,13 @@ let flexSpec = require('./flex-spec') let Declaration = require('../declaration') class Flex extends Declaration { + /** + * Return property name by final spec + */ + normalize() { + return 'flex' + } + /** * Change property name for 2009 spec */ @@ -16,13 +23,6 @@ class Flex extends Declaration { return super.prefixed(prop, prefix) } - /** - * Return property name by final spec - */ - normalize() { - return 'flex' - } - /** * Spec 2009 supports only first argument * Spec 2012 disallows unitless basis diff --git a/lib/hacks/gradient.js b/lib/hacks/gradient.js index 48e13328b..f2345b0c7 100644 --- a/lib/hacks/gradient.js +++ b/lib/hacks/gradient.js @@ -9,145 +9,79 @@ let IS_DIRECTION = /top|left|right|bottom/gi class Gradient extends Value { /** - * Change degrees for webkit prefix + * Do not add non-webkit prefixes for list-style and object */ - replace(string, prefix) { - let ast = parser(string) - for (let node of ast.nodes) { - let gradientName = this.name // gradient name - if (node.type === 'function' && node.value === gradientName) { - node.nodes = this.newDirection(node.nodes) - node.nodes = this.normalize(node.nodes, gradientName) - if (prefix === '-webkit- old') { - let changes = this.oldWebkit(node) - if (!changes) { - return false - } - } else { - node.nodes = this.convertDirection(node.nodes) - node.value = prefix + node.value - } + add(decl, prefix) { + let p = decl.prop + if (p.includes('mask')) { + if (prefix === '-webkit-' || prefix === '-webkit- old') { + return super.add(decl, prefix) } - } - return ast.toString() - } - - /** - * Replace first token - */ - replaceFirst(params, ...words) { - let prefix = words.map(i => { - if (i === ' ') { - return { type: 'space', value: i } + } else if ( + p === 'list-style' || + p === 'list-style-image' || + p === 'content' + ) { + if (prefix === '-webkit-' || prefix === '-webkit- old') { + return super.add(decl, prefix) } - return { type: 'word', value: i } - }) - return prefix.concat(params.slice(1)) - } - - /** - * Convert angle unit to deg - */ - normalizeUnit(str, full) { - let num = parseFloat(str) - let deg = (num / full) * 360 - return `${deg}deg` + } else { + return super.add(decl, prefix) + } + return undefined } /** - * Normalize angle + * Get div token from exists parameters */ - normalize(nodes, gradientName) { - if (!nodes[0]) return nodes - - if (/-?\d+(.\d+)?grad/.test(nodes[0].value)) { - nodes[0].value = this.normalizeUnit(nodes[0].value, 400) - } else if (/-?\d+(.\d+)?rad/.test(nodes[0].value)) { - nodes[0].value = this.normalizeUnit(nodes[0].value, 2 * Math.PI) - } else if (/-?\d+(.\d+)?turn/.test(nodes[0].value)) { - nodes[0].value = this.normalizeUnit(nodes[0].value, 1) - } else if (nodes[0].value.includes('deg')) { - let num = parseFloat(nodes[0].value) - num = range.wrap(0, 360, num) - nodes[0].value = `${num}deg` - } - - if ( - gradientName === 'linear-gradient' || - gradientName === 'repeating-linear-gradient' - ) { - let direction = nodes[0].value - - // Unitless zero for `` values are allowed in CSS gradients and transforms. - // Spec: https://github.com/w3c/csswg-drafts/commit/602789171429b2231223ab1e5acf8f7f11652eb3 - if (direction === '0deg' || direction === '0') { - nodes = this.replaceFirst(nodes, 'to', ' ', 'top') - } else if (direction === '90deg') { - nodes = this.replaceFirst(nodes, 'to', ' ', 'right') - } else if (direction === '180deg') { - nodes = this.replaceFirst(nodes, 'to', ' ', 'bottom') // default value - } else if (direction === '270deg') { - nodes = this.replaceFirst(nodes, 'to', ' ', 'left') + cloneDiv(params) { + for (let i of params) { + if (i.type === 'div' && i.value === ',') { + return i } } - - return nodes + return { after: ' ', type: 'div', value: ',' } } /** - * Replace old direction to new + * Change colors syntax to old webkit */ - newDirection(params) { - if (params[0].value === 'to') { - return params - } - IS_DIRECTION.lastIndex = 0 // reset search index of global regexp - if (!IS_DIRECTION.test(params[0].value)) { - return params - } - - params.unshift( - { - type: 'word', - value: 'to' - }, - { - type: 'space', - value: ' ' + colorStops(params) { + let result = [] + for (let i = 0; i < params.length; i++) { + let pos + let param = params[i] + let item + if (i === 0) { + continue } - ) - for (let i = 2; i < params.length; i++) { - if (params[i].type === 'div') { - break - } - if (params[i].type === 'word') { - params[i].value = this.revertDirection(params[i].value) + let color = parser.stringify(param[0]) + if (param[1] && param[1].type === 'word') { + pos = param[1].value + } else if (param[2] && param[2].type === 'word') { + pos = param[2].value } - } - - return params - } - /** - * Look for at word - */ - isRadial(params) { - let state = 'before' - for (let param of params) { - if (state === 'before' && param.type === 'space') { - state = 'at' - } else if (state === 'at' && param.value === 'at') { - state = 'after' - } else if (state === 'after' && param.type === 'space') { - return true - } else if (param.type === 'div') { - break + let stop + if (i === 1 && (!pos || pos === '0%')) { + stop = `from(${color})` + } else if (i === params.length - 1 && (!pos || pos === '100%')) { + stop = `to(${color})` + } else if (pos) { + stop = `color-stop(${pos}, ${color})` } else { - state = 'before' + stop = `color-stop(${color})` + } + + let div = param[param.length - 1] + params[i] = [{ type: 'word', value: stop }] + if (div.type === 'div' && div.value === ',') { + item = params[i].push(div) } + result.push(item) } - return false + return result } /** @@ -166,6 +100,17 @@ class Gradient extends Value { return params } + /** + * Add 90 degrees + */ + fixAngle(params) { + let first = params[0].value + first = parseFloat(first) + first = Math.abs(450 - first) % 360 + first = this.roundFloat(first, 3) + params[0].value = `${first}deg` + } + /** * Replace `to top left` to `bottom right` */ @@ -182,17 +127,6 @@ class Gradient extends Value { } } - /** - * Add 90 degrees - */ - fixAngle(params) { - let first = params[0].value - first = parseFloat(first) - first = Math.abs(450 - first) % 360 - first = this.roundFloat(first, 3) - params[0].value = `${first}deg` - } - /** * Fix radial direction syntax */ @@ -226,61 +160,136 @@ class Gradient extends Value { params.splice(0, i, ...second, div, ...first) } - revertDirection(word) { - return Gradient.directions[word.toLowerCase()] || word + /** + * Look for at word + */ + isRadial(params) { + let state = 'before' + for (let param of params) { + if (state === 'before' && param.type === 'space') { + state = 'at' + } else if (state === 'at' && param.value === 'at') { + state = 'after' + } else if (state === 'after' && param.type === 'space') { + return true + } else if (param.type === 'div') { + break + } else { + state = 'before' + } + } + return false } /** - * Round float and save digits under dot + * Replace old direction to new */ - roundFloat(float, digits) { - return parseFloat(float.toFixed(digits)) + newDirection(params) { + if (params[0].value === 'to') { + return params + } + IS_DIRECTION.lastIndex = 0 // reset search index of global regexp + if (!IS_DIRECTION.test(params[0].value)) { + return params + } + + params.unshift( + { + type: 'word', + value: 'to' + }, + { + type: 'space', + value: ' ' + } + ) + + for (let i = 2; i < params.length; i++) { + if (params[i].type === 'div') { + break + } + if (params[i].type === 'word') { + params[i].value = this.revertDirection(params[i].value) + } + } + + return params } /** - * Convert to old webkit syntax + * Normalize angle */ - oldWebkit(node) { - let { nodes } = node - let string = parser.stringify(node.nodes) + normalize(nodes, gradientName) { + if (!nodes[0]) return nodes - if (this.name !== 'linear-gradient') { - return false - } - if (nodes[0] && nodes[0].value.includes('deg')) { - return false + if (/-?\d+(.\d+)?grad/.test(nodes[0].value)) { + nodes[0].value = this.normalizeUnit(nodes[0].value, 400) + } else if (/-?\d+(.\d+)?rad/.test(nodes[0].value)) { + nodes[0].value = this.normalizeUnit(nodes[0].value, 2 * Math.PI) + } else if (/-?\d+(.\d+)?turn/.test(nodes[0].value)) { + nodes[0].value = this.normalizeUnit(nodes[0].value, 1) + } else if (nodes[0].value.includes('deg')) { + let num = parseFloat(nodes[0].value) + num = range.wrap(0, 360, num) + nodes[0].value = `${num}deg` } + if ( - string.includes('px') || - string.includes('-corner') || - string.includes('-side') + gradientName === 'linear-gradient' || + gradientName === 'repeating-linear-gradient' ) { - return false - } + let direction = nodes[0].value - let params = [[]] - for (let i of nodes) { - params[params.length - 1].push(i) - if (i.type === 'div' && i.value === ',') { - params.push([]) + // Unitless zero for `` values are allowed in CSS gradients and transforms. + // Spec: https://github.com/w3c/csswg-drafts/commit/602789171429b2231223ab1e5acf8f7f11652eb3 + if (direction === '0deg' || direction === '0') { + nodes = this.replaceFirst(nodes, 'to', ' ', 'top') + } else if (direction === '90deg') { + nodes = this.replaceFirst(nodes, 'to', ' ', 'right') + } else if (direction === '180deg') { + nodes = this.replaceFirst(nodes, 'to', ' ', 'bottom') // default value + } else if (direction === '270deg') { + nodes = this.replaceFirst(nodes, 'to', ' ', 'left') } } - this.oldDirection(params) - this.colorStops(params) + return nodes + } - node.nodes = [] - for (let param of params) { - node.nodes = node.nodes.concat(param) - } + /** + * Convert angle unit to deg + */ + normalizeUnit(str, full) { + let num = parseFloat(str) + let deg = (num / full) * 360 + return `${deg}deg` + } - node.nodes.unshift( - { type: 'word', value: 'linear' }, - this.cloneDiv(node.nodes) - ) - node.value = '-webkit-gradient' + /** + * Remove old WebKit gradient too + */ + old(prefix) { + if (prefix === '-webkit-') { + let type + if (this.name === 'linear-gradient') { + type = 'linear' + } else if (this.name === 'repeating-linear-gradient') { + type = 'repeating-linear' + } else if (this.name === 'repeating-radial-gradient') { + type = 'repeating-radial' + } else { + type = 'radial' + } + let string = '-gradient' + let regexp = utils.regexp( + `-webkit-(${type}-gradient|gradient\\(\\s*${type})`, + false + ) - return true + return new OldValue(this.name, prefix + this.name, string, regexp) + } else { + return super.old(prefix) + } } /** @@ -311,106 +320,97 @@ class Gradient extends Value { } /** - * Get div token from exists parameters + * Convert to old webkit syntax */ - cloneDiv(params) { - for (let i of params) { + oldWebkit(node) { + let { nodes } = node + let string = parser.stringify(node.nodes) + + if (this.name !== 'linear-gradient') { + return false + } + if (nodes[0] && nodes[0].value.includes('deg')) { + return false + } + if ( + string.includes('px') || + string.includes('-corner') || + string.includes('-side') + ) { + return false + } + + let params = [[]] + for (let i of nodes) { + params[params.length - 1].push(i) if (i.type === 'div' && i.value === ',') { - return i + params.push([]) } } - return { type: 'div', value: ',', after: ' ' } - } - /** - * Change colors syntax to old webkit - */ - colorStops(params) { - let result = [] - for (let i = 0; i < params.length; i++) { - let pos - let param = params[i] - let item - if (i === 0) { - continue - } + this.oldDirection(params) + this.colorStops(params) - let color = parser.stringify(param[0]) - if (param[1] && param[1].type === 'word') { - pos = param[1].value - } else if (param[2] && param[2].type === 'word') { - pos = param[2].value - } + node.nodes = [] + for (let param of params) { + node.nodes = node.nodes.concat(param) + } - let stop - if (i === 1 && (!pos || pos === '0%')) { - stop = `from(${color})` - } else if (i === params.length - 1 && (!pos || pos === '100%')) { - stop = `to(${color})` - } else if (pos) { - stop = `color-stop(${pos}, ${color})` - } else { - stop = `color-stop(${color})` - } + node.nodes.unshift( + { type: 'word', value: 'linear' }, + this.cloneDiv(node.nodes) + ) + node.value = '-webkit-gradient' - let div = param[param.length - 1] - params[i] = [{ type: 'word', value: stop }] - if (div.type === 'div' && div.value === ',') { - item = params[i].push(div) + return true + } + + /** + * Change degrees for webkit prefix + */ + replace(string, prefix) { + let ast = parser(string) + for (let node of ast.nodes) { + let gradientName = this.name // gradient name + if (node.type === 'function' && node.value === gradientName) { + node.nodes = this.newDirection(node.nodes) + node.nodes = this.normalize(node.nodes, gradientName) + if (prefix === '-webkit- old') { + let changes = this.oldWebkit(node) + if (!changes) { + return false + } + } else { + node.nodes = this.convertDirection(node.nodes) + node.value = prefix + node.value + } } - result.push(item) } - return result + return ast.toString() } /** - * Remove old WebKit gradient too + * Replace first token */ - old(prefix) { - if (prefix === '-webkit-') { - let type - if (this.name === 'linear-gradient') { - type = 'linear' - } else if (this.name === 'repeating-linear-gradient') { - type = 'repeating-linear' - } else if (this.name === 'repeating-radial-gradient') { - type = 'repeating-radial' - } else { - type = 'radial' + replaceFirst(params, ...words) { + let prefix = words.map(i => { + if (i === ' ') { + return { type: 'space', value: i } } - let string = '-gradient' - let regexp = utils.regexp( - `-webkit-(${type}-gradient|gradient\\(\\s*${type})`, - false - ) + return { type: 'word', value: i } + }) + return prefix.concat(params.slice(1)) + } - return new OldValue(this.name, prefix + this.name, string, regexp) - } else { - return super.old(prefix) - } + revertDirection(word) { + return Gradient.directions[word.toLowerCase()] || word } /** - * Do not add non-webkit prefixes for list-style and object + * Round float and save digits under dot */ - add(decl, prefix) { - let p = decl.prop - if (p.includes('mask')) { - if (prefix === '-webkit-' || prefix === '-webkit- old') { - return super.add(decl, prefix) - } - } else if ( - p === 'list-style' || - p === 'list-style-image' || - p === 'content' - ) { - if (prefix === '-webkit-' || prefix === '-webkit- old') { - return super.add(decl, prefix) - } - } else { - return super.add(decl, prefix) - } - return undefined + roundFloat(float, digits) { + return parseFloat(float.toFixed(digits)) } } @@ -422,27 +422,27 @@ Gradient.names = [ ] Gradient.directions = { - top: 'bottom', // default value - left: 'right', bottom: 'top', - right: 'left' + left: 'right', + right: 'left', + top: 'bottom' // default value } // Direction to replace Gradient.oldDirections = { - 'top': 'left bottom, left top', - 'left': 'right top, left top', 'bottom': 'left top, left bottom', - 'right': 'left top, right top', - - 'top right': 'left bottom, right top', - 'top left': 'right bottom, left top', - 'right top': 'left bottom, right top', - 'right bottom': 'left top, right bottom', - 'bottom right': 'left top, right bottom', 'bottom left': 'right top, left bottom', + 'bottom right': 'left top, right bottom', + 'left': 'right top, left top', + + 'left bottom': 'right top, left bottom', 'left top': 'right bottom, left top', - 'left bottom': 'right top, left bottom' + 'right': 'left top, right top', + 'right bottom': 'left top, right bottom', + 'right top': 'left bottom, right top', + 'top': 'left bottom, left top', + 'top left': 'right bottom, left top', + 'top right': 'left bottom, right top' } module.exports = Gradient diff --git a/lib/hacks/grid-column-align.js b/lib/hacks/grid-column-align.js index 79c51befe..91f10f0f7 100644 --- a/lib/hacks/grid-column-align.js +++ b/lib/hacks/grid-column-align.js @@ -9,17 +9,17 @@ class GridColumnAlign extends Declaration { } /** - * Change property name for IE + * Change IE property back */ - prefixed(prop, prefix) { - return prefix + 'grid-column-align' + normalize() { + return 'justify-self' } /** - * Change IE property back + * Change property name for IE */ - normalize() { - return 'justify-self' + prefixed(prop, prefix) { + return prefix + 'grid-column-align' } } diff --git a/lib/hacks/grid-row-align.js b/lib/hacks/grid-row-align.js index 4b3bf861d..cba8aeed2 100644 --- a/lib/hacks/grid-row-align.js +++ b/lib/hacks/grid-row-align.js @@ -9,17 +9,17 @@ class GridRowAlign extends Declaration { } /** - * Change property name for IE + * Change IE property back */ - prefixed(prop, prefix) { - return prefix + 'grid-row-align' + normalize() { + return 'align-self' } /** - * Change IE property back + * Change property name for IE */ - normalize() { - return 'align-self' + prefixed(prop, prefix) { + return prefix + 'grid-row-align' } } diff --git a/lib/hacks/grid-rows-columns.js b/lib/hacks/grid-rows-columns.js index ca10977fd..dfc266ba7 100644 --- a/lib/hacks/grid-rows-columns.js +++ b/lib/hacks/grid-rows-columns.js @@ -1,31 +1,14 @@ let Declaration = require('../declaration') let { - prefixTrackProp, - prefixTrackValue, autoplaceGridItems, getGridGap, - inheritGridGap + inheritGridGap, + prefixTrackProp, + prefixTrackValue } = require('./grid-utils') let Processor = require('../processor') class GridRowsColumns extends Declaration { - /** - * Change property name for IE - */ - prefixed(prop, prefix) { - if (prefix === '-ms-') { - return prefixTrackProp({ prop, prefix }) - } - return super.prefixed(prop, prefix) - } - - /** - * Change IE property back - */ - normalize(prop) { - return prop.replace(/^grid-(rows|columns)/, 'grid-template-$1') - } - insert(decl, prefix, prefixes, result) { if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes) @@ -56,15 +39,15 @@ class GridRowsColumns extends Declaration { } let prefixValue = prefixTrackValue({ - value, - gap: gapValue + gap: gapValue, + value }) /** * Insert prefixes */ decl.cloneBefore({ - prop: prefixTrackProp({ prop, prefix }), + prop: prefixTrackProp({ prefix, prop }), value: prefixValue }) @@ -113,6 +96,23 @@ class GridRowsColumns extends Declaration { return undefined } + + /** + * Change IE property back + */ + normalize(prop) { + return prop.replace(/^grid-(rows|columns)/, 'grid-template-$1') + } + + /** + * Change property name for IE + */ + prefixed(prop, prefix) { + if (prefix === '-ms-') { + return prefixTrackProp({ prefix, prop }) + } + return super.prefixed(prop, prefix) + } } GridRowsColumns.names = [ diff --git a/lib/hacks/grid-template-areas.js b/lib/hacks/grid-template-areas.js index 9c7f2142b..ffc9673ff 100644 --- a/lib/hacks/grid-template-areas.js +++ b/lib/hacks/grid-template-areas.js @@ -1,12 +1,12 @@ let Declaration = require('../declaration') let { + getGridGap, + inheritGridGap, parseGridAreas, - warnMissedAreas, prefixTrackProp, prefixTrackValue, - getGridGap, warnGridGap, - inheritGridGap + warnMissedAreas } = require('./grid-utils') function getGridRows(tpl) { @@ -39,8 +39,8 @@ class GridTemplateAreas extends Declaration { hasRows = true let { prop, value } = trackDecl trackDecl.cloneBefore({ - prop: prefixTrackProp({ prop, prefix }), - value: prefixTrackValue({ value, gap: gap.row }) + prop: prefixTrackProp({ prefix, prop }), + value: prefixTrackValue({ gap: gap.row, value }) }) } else { hasColumns = true @@ -52,25 +52,25 @@ class GridTemplateAreas extends Declaration { if (hasColumns && !hasRows && gap.row && gridRows.length > 1) { decl.cloneBefore({ prop: '-ms-grid-rows', + raws: {}, value: prefixTrackValue({ - value: `repeat(${gridRows.length}, auto)`, - gap: gap.row - }), - raws: {} + gap: gap.row, + value: `repeat(${gridRows.length}, auto)` + }) }) } // warnings warnGridGap({ + decl, gap, hasColumns, - decl, result }) let areas = parseGridAreas({ - rows: gridRows, - gap + gap, + rows: gridRows }) warnMissedAreas(areas, decl, result) diff --git a/lib/hacks/grid-template.js b/lib/hacks/grid-template.js index d2c5ea269..4e286376c 100644 --- a/lib/hacks/grid-template.js +++ b/lib/hacks/grid-template.js @@ -1,10 +1,10 @@ let Declaration = require('../declaration') let { - parseTemplate, - warnMissedAreas, getGridGap, + inheritGridGap, + parseTemplate, warnGridGap, - inheritGridGap + warnMissedAreas } = require('./grid-utils') class GridTemplate extends Declaration { @@ -26,7 +26,7 @@ class GridTemplate extends Declaration { */ let inheritedGap = inheritGridGap(decl, gap) - let { rows, columns, areas } = parseTemplate({ + let { areas, columns, rows } = parseTemplate({ decl, gap: inheritedGap || gap }) @@ -36,9 +36,9 @@ class GridTemplate extends Declaration { let hasColumns = Boolean(columns) warnGridGap({ + decl, gap, hasColumns, - decl, result }) @@ -47,16 +47,16 @@ class GridTemplate extends Declaration { if ((hasRows && hasColumns) || hasAreas) { decl.cloneBefore({ prop: '-ms-grid-rows', - value: rows, - raws: {} + raws: {}, + value: rows }) } if (hasColumns) { decl.cloneBefore({ prop: '-ms-grid-columns', - value: columns, - raws: {} + raws: {}, + value: columns }) } diff --git a/lib/hacks/grid-utils.js b/lib/hacks/grid-utils.js index 1af3e3d3d..e89423117 100644 --- a/lib/hacks/grid-utils.js +++ b/lib/hacks/grid-utils.js @@ -90,7 +90,7 @@ function insertDecl(decl, prop, value) { exports.prefixTrackProp = prefixTrackProp -function prefixTrackProp({ prop, prefix }) { +function prefixTrackProp({ prefix, prop }) { return prefix + prop.replace('template-', '') } @@ -105,9 +105,9 @@ function transformRepeat({ nodes }, { gap }) { return result }, { + count: [], key: 'count', - size: [], - count: [] + size: [] } ) @@ -132,7 +132,7 @@ function transformRepeat({ nodes }, { gap }) { exports.prefixTrackValue = prefixTrackValue -function prefixTrackValue({ value, gap }) { +function prefixTrackValue({ gap, value }) { let result = parser(value).nodes.reduce((nodes, node) => { if (node.type === 'function' && node.value === 'repeat') { return nodes.concat({ @@ -164,7 +164,7 @@ function prefixTrackValue({ value, gap }) { let DOTS = /^\.+$/ function track(start, end) { - return { start, end, span: end - start } + return { end, span: end - start, start } } function getColumns(line) { @@ -173,7 +173,7 @@ function getColumns(line) { exports.parseGridAreas = parseGridAreas -function parseGridAreas({ rows, gap }) { +function parseGridAreas({ gap, rows }) { return rows.reduce((areas, line, rowIndex) => { if (gap.row) rowIndex *= 2 @@ -248,25 +248,25 @@ function parseTemplate({ decl, gap }) { return result }, { - key: 'rows', + areas: [], columns: [], - rows: [], - areas: [] + key: 'rows', + rows: [] } ) return { areas: parseGridAreas({ - rows: gridTemplate.areas, - gap + gap, + rows: gridTemplate.areas }), columns: prefixTrackValue({ - value: gridTemplate.columns.join(' '), - gap: gap.column + gap: gap.column, + value: gridTemplate.columns.join(' ') }), rows: prefixTrackValue({ - value: gridTemplate.rows.join(' '), - gap: gap.row + gap: gap.row, + value: gridTemplate.rows.join(' ') }) } } @@ -429,12 +429,12 @@ function parseGridTemplatesData(css) { parsed[index].allAreas = uniq([...allAreas, ...areaNames]) parsed[index].rules.push({ + areas, + duplicateAreaNames, hasDuplicates: !hasNoDuplicates, - params: media.params, - selectors: rule.selectors, node: rule, - duplicateAreaNames, - areas + params: media.params, + selectors: rule.selectors }) } else { // index is NOT found, push the new item to the parsed array @@ -443,13 +443,13 @@ function parseGridTemplatesData(css) { areasCount: 0, rules: [ { - hasDuplicates: false, + areas, + duplicateAreaNames: [], duplicateRules: [], - params: media.params, - selectors: rule.selectors, + hasDuplicates: false, node: rule, - duplicateAreaNames: [], - areas + params: media.params, + selectors: rule.selectors } ] }) @@ -993,7 +993,7 @@ function inheritGridGap(decl, gap) { exports.warnGridGap = warnGridGap -function warnGridGap({ gap, hasColumns, decl, result }) { +function warnGridGap({ decl, gap, hasColumns, result }) { let hasBothGaps = gap.row && gap.column if (!hasColumns && (hasBothGaps || (gap.column && !gap.row))) { delete gap.column @@ -1079,7 +1079,7 @@ function autoplaceGridItems(decl, result, gap, autoflowValue = 'row') { ).join(' ') }) - let areas = parseGridAreas({ rows: filledRows, gap }) + let areas = parseGridAreas({ gap, rows: filledRows }) let keys = Object.keys(areas) let items = keys.map(i => areas[i]) diff --git a/lib/hacks/image-rendering.js b/lib/hacks/image-rendering.js index 3b0d33aaf..38b571bc0 100644 --- a/lib/hacks/image-rendering.js +++ b/lib/hacks/image-rendering.js @@ -8,6 +8,13 @@ class ImageRendering extends Declaration { return decl.value === 'pixelated' } + /** + * Return property name by spec + */ + normalize() { + return 'image-rendering' + } + /** * Change property name for IE */ @@ -18,6 +25,13 @@ class ImageRendering extends Declaration { return super.prefixed(prop, prefix) } + /** + * Warn on old value + */ + process(node, result) { + return super.process(node, result) + } + /** * Change property and value for IE */ @@ -27,20 +41,6 @@ class ImageRendering extends Declaration { decl.value = 'nearest-neighbor' return decl } - - /** - * Return property name by spec - */ - normalize() { - return 'image-rendering' - } - - /** - * Warn on old value - */ - process(node, result) { - return super.process(node, result) - } } ImageRendering.names = ['image-rendering', 'interpolation-mode'] diff --git a/lib/hacks/inline-logical.js b/lib/hacks/inline-logical.js index 564af2ec9..31dc96876 100644 --- a/lib/hacks/inline-logical.js +++ b/lib/hacks/inline-logical.js @@ -2,17 +2,17 @@ let Declaration = require('../declaration') class InlineLogical extends Declaration { /** - * Use old syntax for -moz- and -webkit- + * Return property name by spec */ - prefixed(prop, prefix) { - return prefix + prop.replace('-inline', '') + normalize(prop) { + return prop.replace(/(margin|padding|border)-(start|end)/, '$1-inline-$2') } /** - * Return property name by spec + * Use old syntax for -moz- and -webkit- */ - normalize(prop) { - return prop.replace(/(margin|padding|border)-(start|end)/, '$1-inline-$2') + prefixed(prop, prefix) { + return prefix + prop.replace('-inline', '') } } diff --git a/lib/hacks/intrinsic.js b/lib/hacks/intrinsic.js index 4e4e1057e..7c5bb5084 100644 --- a/lib/hacks/intrinsic.js +++ b/lib/hacks/intrinsic.js @@ -6,9 +6,11 @@ function regexp(name) { } class Intrinsic extends Value { - regexp() { - if (!this.regexpCache) this.regexpCache = regexp(this.name) - return this.regexpCache + add(decl, prefix) { + if (decl.prop.includes('grid') && prefix !== '-webkit-') { + return undefined + } + return super.add(decl, prefix) } isStretch() { @@ -19,16 +21,6 @@ class Intrinsic extends Value { ) } - replace(string, prefix) { - if (prefix === '-moz-' && this.isStretch()) { - return string.replace(this.regexp(), '$1-moz-available$3') - } - if (prefix === '-webkit-' && this.isStretch()) { - return string.replace(this.regexp(), '$1-webkit-fill-available$3') - } - return super.replace(string, prefix) - } - old(prefix) { let prefixed = prefix + this.name if (this.isStretch()) { @@ -41,11 +33,19 @@ class Intrinsic extends Value { return new OldValue(this.name, prefixed, prefixed, regexp(prefixed)) } - add(decl, prefix) { - if (decl.prop.includes('grid') && prefix !== '-webkit-') { - return undefined + regexp() { + if (!this.regexpCache) this.regexpCache = regexp(this.name) + return this.regexpCache + } + + replace(string, prefix) { + if (prefix === '-moz-' && this.isStretch()) { + return string.replace(this.regexp(), '$1-moz-available$3') } - return super.add(decl, prefix) + if (prefix === '-webkit-' && this.isStretch()) { + return string.replace(this.regexp(), '$1-webkit-fill-available$3') + } + return super.replace(string, prefix) } } diff --git a/lib/hacks/justify-content.js b/lib/hacks/justify-content.js index 2a27cfce4..8ad863f92 100644 --- a/lib/hacks/justify-content.js +++ b/lib/hacks/justify-content.js @@ -2,6 +2,13 @@ let flexSpec = require('./flex-spec') let Declaration = require('../declaration') class JustifyContent extends Declaration { + /** + * Return property name by final spec + */ + normalize() { + return 'justify-content' + } + /** * Change property name for 2009 and 2012 specs */ @@ -17,13 +24,6 @@ class JustifyContent extends Declaration { return super.prefixed(prop, prefix) } - /** - * Return property name by final spec - */ - normalize() { - return 'justify-content' - } - /** * Change value for 2009 and 2012 specs */ @@ -47,8 +47,8 @@ JustifyContent.names = ['justify-content', 'flex-pack', 'box-pack'] JustifyContent.oldValues = { 'flex-end': 'end', 'flex-start': 'start', - 'space-between': 'justify', - 'space-around': 'distribute' + 'space-around': 'distribute', + 'space-between': 'justify' } module.exports = JustifyContent diff --git a/lib/hacks/mask-composite.js b/lib/hacks/mask-composite.js index abb238882..a30df13c2 100644 --- a/lib/hacks/mask-composite.js +++ b/lib/hacks/mask-composite.js @@ -73,9 +73,9 @@ MaskComposite.names = ['mask', 'mask-composite'] MaskComposite.oldValues = { add: 'source-over', - subtract: 'source-out', + exclude: 'xor', intersect: 'source-in', - exclude: 'xor' + subtract: 'source-out' } MaskComposite.regexp = new RegExp( diff --git a/lib/hacks/order.js b/lib/hacks/order.js index 12ccdeacf..3150a940a 100644 --- a/lib/hacks/order.js +++ b/lib/hacks/order.js @@ -2,6 +2,13 @@ let flexSpec = require('./flex-spec') let Declaration = require('../declaration') class Order extends Declaration { + /** + * Return property name by final spec + */ + normalize() { + return 'order' + } + /** * Change property name for 2009 and 2012 specs */ @@ -17,13 +24,6 @@ class Order extends Declaration { return super.prefixed(prop, prefix) } - /** - * Return property name by final spec - */ - normalize() { - return 'order' - } - /** * Fix value for 2009 spec */ diff --git a/lib/hacks/overscroll-behavior.js b/lib/hacks/overscroll-behavior.js index 0a09f1ece..03bd7d45e 100644 --- a/lib/hacks/overscroll-behavior.js +++ b/lib/hacks/overscroll-behavior.js @@ -2,17 +2,17 @@ let Declaration = require('../declaration') class OverscrollBehavior extends Declaration { /** - * Change property name for IE + * Return property name by spec */ - prefixed(prop, prefix) { - return prefix + 'scroll-chaining' + normalize() { + return 'overscroll-behavior' } /** - * Return property name by spec + * Change property name for IE */ - normalize() { - return 'overscroll-behavior' + prefixed(prop, prefix) { + return prefix + 'scroll-chaining' } /** diff --git a/lib/hacks/pixelated.js b/lib/hacks/pixelated.js index 63e7111c1..6084826dd 100644 --- a/lib/hacks/pixelated.js +++ b/lib/hacks/pixelated.js @@ -3,29 +3,29 @@ let Value = require('../value') class Pixelated extends Value { /** - * Use non-standard name for WebKit and Firefox + * Different name for WebKit and Firefox */ - replace(string, prefix) { + old(prefix) { if (prefix === '-webkit-') { - return string.replace(this.regexp(), '$1-webkit-optimize-contrast') + return new OldValue(this.name, '-webkit-optimize-contrast') } if (prefix === '-moz-') { - return string.replace(this.regexp(), '$1-moz-crisp-edges') + return new OldValue(this.name, '-moz-crisp-edges') } - return super.replace(string, prefix) + return super.old(prefix) } /** - * Different name for WebKit and Firefox + * Use non-standard name for WebKit and Firefox */ - old(prefix) { + replace(string, prefix) { if (prefix === '-webkit-') { - return new OldValue(this.name, '-webkit-optimize-contrast') + return string.replace(this.regexp(), '$1-webkit-optimize-contrast') } if (prefix === '-moz-') { - return new OldValue(this.name, '-moz-crisp-edges') + return string.replace(this.regexp(), '$1-moz-crisp-edges') } - return super.old(prefix) + return super.replace(string, prefix) } } diff --git a/lib/hacks/print-color-adjust.js b/lib/hacks/print-color-adjust.js index 951964b6d..6526a8e31 100644 --- a/lib/hacks/print-color-adjust.js +++ b/lib/hacks/print-color-adjust.js @@ -1,6 +1,13 @@ let Declaration = require('../declaration') class PrintColorAdjust extends Declaration { + /** + * Return property name by spec + */ + normalize() { + return 'print-color-adjust' + } + /** * Change property name for WebKit-based browsers */ @@ -11,13 +18,6 @@ class PrintColorAdjust extends Declaration { return prefix + 'print-color-adjust' } } - - /** - * Return property name by spec - */ - normalize() { - return 'print-color-adjust' - } } PrintColorAdjust.names = ['print-color-adjust', 'color-adjust'] diff --git a/lib/hacks/transform-decl.js b/lib/hacks/transform-decl.js index 2cf7e5e87..cecd06d89 100644 --- a/lib/hacks/transform-decl.js +++ b/lib/hacks/transform-decl.js @@ -1,20 +1,6 @@ let Declaration = require('../declaration') class TransformDecl extends Declaration { - /** - * Recursively check all parents for @keyframes - */ - keyframeParents(decl) { - let { parent } = decl - while (parent) { - if (parent.type === 'atrule' && parent.name === 'keyframes') { - return true - } - ;({ parent } = parent) - } - return false - } - /** * Is transform contain 3D commands */ @@ -32,17 +18,6 @@ class TransformDecl extends Declaration { return false } - /** - * Replace rotateZ to rotate for IE 9 - */ - set(decl, prefix) { - decl = super.set(decl, prefix) - if (prefix === '-ms-') { - decl.value = decl.value.replace(/rotatez/gi, 'rotate') - } - return decl - } - /** * Don't add prefix for IE in keyframes */ @@ -60,6 +35,31 @@ class TransformDecl extends Declaration { } return undefined } + + /** + * Recursively check all parents for @keyframes + */ + keyframeParents(decl) { + let { parent } = decl + while (parent) { + if (parent.type === 'atrule' && parent.name === 'keyframes') { + return true + } + ;({ parent } = parent) + } + return false + } + + /** + * Replace rotateZ to rotate for IE 9 + */ + set(decl, prefix) { + decl = super.set(decl, prefix) + if (prefix === '-ms-') { + decl.value = decl.value.replace(/rotatez/gi, 'rotate') + } + return decl + } } TransformDecl.names = ['transform', 'transform-origin'] diff --git a/lib/hacks/user-select.js b/lib/hacks/user-select.js index 3aba21702..850f9816c 100644 --- a/lib/hacks/user-select.js +++ b/lib/hacks/user-select.js @@ -1,16 +1,6 @@ let Declaration = require('../declaration') class UserSelect extends Declaration { - /** - * Change prefixed value for IE - */ - set(decl, prefix) { - if (prefix === '-ms-' && decl.value === 'contain') { - decl.value = 'element' - } - return super.set(decl, prefix) - } - /** * Avoid prefixing all in IE */ @@ -21,6 +11,16 @@ class UserSelect extends Declaration { return super.insert(decl, prefix, prefixes) } } + + /** + * Change prefixed value for IE + */ + set(decl, prefix) { + if (prefix === '-ms-' && decl.value === 'contain') { + decl.value = 'element' + } + return super.set(decl, prefix) + } } UserSelect.names = ['user-select'] diff --git a/lib/hacks/writing-mode.js b/lib/hacks/writing-mode.js index aa7c075f5..71c8eeb1b 100644 --- a/lib/hacks/writing-mode.js +++ b/lib/hacks/writing-mode.js @@ -29,13 +29,13 @@ WritingMode.names = ['writing-mode'] WritingMode.msValues = { ltr: { 'horizontal-tb': 'lr-tb', - 'vertical-rl': 'tb-rl', - 'vertical-lr': 'tb-lr' + 'vertical-lr': 'tb-lr', + 'vertical-rl': 'tb-rl' }, rtl: { 'horizontal-tb': 'rl-tb', - 'vertical-rl': 'bt-rl', - 'vertical-lr': 'bt-lr' + 'vertical-lr': 'bt-lr', + 'vertical-rl': 'bt-rl' } } diff --git a/lib/info.js b/lib/info.js index d8cb8aaf2..a31348619 100644 --- a/lib/info.js +++ b/lib/info.js @@ -5,17 +5,17 @@ function capitalize(str) { } const NAMES = { + and_chr: 'Chrome for Android', + and_ff: 'Firefox for Android', + and_qq: 'QQ Browser', + and_uc: 'UC for Android', + baidu: 'Baidu Browser', ie: 'IE', ie_mob: 'IE Mobile', ios_saf: 'iOS Safari', + kaios: 'KaiOS Browser', op_mini: 'Opera Mini', op_mob: 'Opera Mobile', - and_chr: 'Chrome for Android', - and_ff: 'Firefox for Android', - and_uc: 'UC for Android', - and_qq: 'QQ Browser', - kaios: 'KaiOS Browser', - baidu: 'Baidu Browser', samsung: 'Samsung Internet' } diff --git a/lib/old-selector.js b/lib/old-selector.js index 42624791e..ca98d07a5 100644 --- a/lib/old-selector.js +++ b/lib/old-selector.js @@ -12,6 +12,22 @@ class OldSelector { this.nameRegexp = selector.regexp() } + /** + * Does rule contain an unnecessary prefixed selector + */ + check(rule) { + if (!rule.selector.includes(this.prefixed)) { + return false + } + if (!rule.selector.match(this.regexp)) { + return false + } + if (this.isHack(rule)) { + return false + } + return true + } + /** * Is rule a hack without unprefixed version bottom */ @@ -46,22 +62,6 @@ class OldSelector { return true } - - /** - * Does rule contain an unnecessary prefixed selector - */ - check(rule) { - if (!rule.selector.includes(this.prefixed)) { - return false - } - if (!rule.selector.match(this.regexp)) { - return false - } - if (this.isHack(rule)) { - return false - } - return true - } } module.exports = OldSelector diff --git a/lib/prefixer.js b/lib/prefixer.js index ca28230fd..196dd62c7 100644 --- a/lib/prefixer.js +++ b/lib/prefixer.js @@ -34,6 +34,23 @@ function clone(obj, parent) { } class Prefixer { + constructor(name, prefixes, all) { + this.prefixes = prefixes + this.name = name + this.all = all + } + + /** + * Clone node and clean autprefixer custom caches + */ + static clone(node, overrides) { + let cloned = clone(node) + for (let name in overrides) { + cloned[name] = overrides[name] + } + return cloned + } + /** * Add hack to selected names */ @@ -60,20 +77,10 @@ class Prefixer { } /** - * Clone node and clean autprefixer custom caches + * Shortcut for Prefixer.clone */ - static clone(node, overrides) { - let cloned = clone(node) - for (let name in overrides) { - cloned[name] = overrides[name] - } - return cloned - } - - constructor(name, prefixes, all) { - this.prefixes = prefixes - this.name = name - this.all = all + clone(node, overrides) { + return Prefixer.clone(node, overrides) } /** @@ -132,13 +139,6 @@ class Prefixer { return added } - - /** - * Shortcut for Prefixer.clone - */ - clone(node, overrides) { - return Prefixer.clone(node, overrides) - } } module.exports = Prefixer diff --git a/lib/prefixes.js b/lib/prefixes.js index 2cd497a53..324509e36 100644 --- a/lib/prefixes.js +++ b/lib/prefixes.js @@ -156,76 +156,77 @@ class Prefixes { } /** - * Select prefixes from data, which is necessary for selected browsers + * Declaration loader with caching */ - select(list) { - let selected = { add: {}, remove: {} } + decl(prop) { + if (!declsCache.has(prop)) { + declsCache.set(prop, Declaration.load(prop)) + } - for (let name in list) { - let data = list[name] - let add = data.browsers.map(i => { - let params = i.split(' ') - return { - browser: `${params[0]} ${params[1]}`, - note: params[2] - } - }) + return declsCache.get(prop) + } - let notes = add - .filter(i => i.note) - .map(i => `${this.browsers.prefix(i.browser)} ${i.note}`) - notes = utils.uniq(notes) + /** + * Group declaration by unprefixed property to check them + */ + group(decl) { + let rule = decl.parent + let index = rule.index(decl) + let { length } = rule.nodes + let unprefixed = this.unprefixed(decl.prop) - add = add - .filter(i => this.browsers.isSelected(i.browser)) - .map(i => { - let prefix = this.browsers.prefix(i.browser) - if (i.note) { - return `${prefix} ${i.note}` - } else { - return prefix + let checker = (step, callback) => { + index += step + while (index >= 0 && index < length) { + let other = rule.nodes[index] + if (other.type === 'decl') { + if (step === -1 && other.prop === unprefixed) { + if (!Browsers.withPrefix(other.value)) { + break + } } - }) - add = this.sort(utils.uniq(add)) - - if (this.options.flexbox === 'no-2009') { - add = add.filter(i => !i.includes('2009')) - } - let all = data.browsers.map(i => this.browsers.prefix(i)) - if (data.mistakes) { - all = all.concat(data.mistakes) - } - all = all.concat(notes) - all = utils.uniq(all) + if (this.unprefixed(other.prop) !== unprefixed) { + break + } else if (callback(other) === true) { + return true + } - if (add.length) { - selected.add[name] = add - if (add.length < all.length) { - selected.remove[name] = all.filter(i => !add.includes(i)) + if (step === +1 && other.prop === unprefixed) { + if (!Browsers.withPrefix(other.value)) { + break + } + } } - } else { - selected.remove[name] = all + + index += step } + return false } - return selected + return { + down(callback) { + return checker(+1, callback) + }, + up(callback) { + return checker(-1, callback) + } + } } /** - * Sort vendor prefixes + * Normalize prefix for remover */ - sort(prefixes) { - return prefixes.sort((a, b) => { - let aLength = utils.removeNote(a).length - let bLength = utils.removeNote(b).length + normalize(prop) { + return this.decl(prop).normalize(prop) + } - if (aLength === bLength) { - return b.length - a.length - } else { - return bLength - aLength - } - }) + /** + * Return prefixed version of property + */ + prefixed(prop, prefix) { + prop = vendor.unprefixed(prop) + return this.decl(prop).prefixed(prop, prefix) } /** @@ -233,8 +234,8 @@ class Prefixes { */ preprocess(selected) { let add = { - 'selectors': [], - '@supports': new Supports(Prefixes, this) + '@supports': new Supports(Prefixes, this), + 'selectors': [] } for (let name in selected.add) { let prefixes = selected.add[name] @@ -324,14 +325,76 @@ class Prefixes { } /** - * Declaration loader with caching + * Select prefixes from data, which is necessary for selected browsers */ - decl(prop) { - if (!declsCache.has(prop)) { - declsCache.set(prop, Declaration.load(prop)) + select(list) { + let selected = { add: {}, remove: {} } + + for (let name in list) { + let data = list[name] + let add = data.browsers.map(i => { + let params = i.split(' ') + return { + browser: `${params[0]} ${params[1]}`, + note: params[2] + } + }) + + let notes = add + .filter(i => i.note) + .map(i => `${this.browsers.prefix(i.browser)} ${i.note}`) + notes = utils.uniq(notes) + + add = add + .filter(i => this.browsers.isSelected(i.browser)) + .map(i => { + let prefix = this.browsers.prefix(i.browser) + if (i.note) { + return `${prefix} ${i.note}` + } else { + return prefix + } + }) + add = this.sort(utils.uniq(add)) + + if (this.options.flexbox === 'no-2009') { + add = add.filter(i => !i.includes('2009')) + } + + let all = data.browsers.map(i => this.browsers.prefix(i)) + if (data.mistakes) { + all = all.concat(data.mistakes) + } + all = all.concat(notes) + all = utils.uniq(all) + + if (add.length) { + selected.add[name] = add + if (add.length < all.length) { + selected.remove[name] = all.filter(i => !add.includes(i)) + } + } else { + selected.remove[name] = all + } } - return declsCache.get(prop) + return selected + } + + /** + * Sort vendor prefixes + */ + sort(prefixes) { + return prefixes.sort((a, b) => { + let aLength = utils.removeNote(a).length + let bLength = utils.removeNote(b).length + + if (aLength === bLength) { + return b.length - a.length + } else { + return bLength - aLength + } + }) } /** @@ -345,21 +408,6 @@ class Prefixes { return value } - /** - * Normalize prefix for remover - */ - normalize(prop) { - return this.decl(prop).normalize(prop) - } - - /** - * Return prefixed version of property - */ - prefixed(prop, prefix) { - prop = vendor.unprefixed(prop) - return this.decl(prop).prefixed(prop, prefix) - } - /** * Return values, which must be prefixed in selected property */ @@ -375,54 +423,6 @@ class Prefixes { return global || values || [] } } - - /** - * Group declaration by unprefixed property to check them - */ - group(decl) { - let rule = decl.parent - let index = rule.index(decl) - let { length } = rule.nodes - let unprefixed = this.unprefixed(decl.prop) - - let checker = (step, callback) => { - index += step - while (index >= 0 && index < length) { - let other = rule.nodes[index] - if (other.type === 'decl') { - if (step === -1 && other.prop === unprefixed) { - if (!Browsers.withPrefix(other.value)) { - break - } - } - - if (this.unprefixed(other.prop) !== unprefixed) { - break - } else if (callback(other) === true) { - return true - } - - if (step === +1 && other.prop === unprefixed) { - if (!Browsers.withPrefix(other.value)) { - break - } - } - } - - index += step - } - return false - } - - return { - up(callback) { - return checker(-1, callback) - }, - down(callback) { - return checker(+1, callback) - } - } - } } module.exports = Prefixes diff --git a/lib/processor.js b/lib/processor.js index d27b5e8fe..ee2608119 100644 --- a/lib/processor.js +++ b/lib/processor.js @@ -396,141 +396,6 @@ class Processor { }) } - /** - * Remove unnecessary pefixes - */ - remove(css, result) { - // At-rules - let resolution = this.prefixes.remove['@resolution'] - - css.walkAtRules((rule, i) => { - if (this.prefixes.remove[`@${rule.name}`]) { - if (!this.disabled(rule, result)) { - rule.parent.removeChild(i) - } - } else if ( - rule.name === 'media' && - rule.params.includes('-resolution') && - resolution - ) { - resolution.clean(rule) - } - }) - - // Selectors - for (let checker of this.prefixes.remove.selectors) { - css.walkRules((rule, i) => { - if (checker.check(rule)) { - if (!this.disabled(rule, result)) { - rule.parent.removeChild(i) - } - } - }) - } - - return css.walkDecls((decl, i) => { - if (this.disabled(decl, result)) return - - let rule = decl.parent - let unprefixed = this.prefixes.unprefixed(decl.prop) - - // Transition - if (decl.prop === 'transition' || decl.prop === 'transition-property') { - this.prefixes.transition.remove(decl) - } - - // Properties - if ( - this.prefixes.remove[decl.prop] && - this.prefixes.remove[decl.prop].remove - ) { - let notHack = this.prefixes.group(decl).down(other => { - return this.prefixes.normalize(other.prop) === unprefixed - }) - - if (unprefixed === 'flex-flow') { - notHack = true - } - - if (decl.prop === '-webkit-box-orient') { - let hacks = { 'flex-direction': true, 'flex-flow': true } - if (!decl.parent.some(j => hacks[j.prop])) return - } - - if (notHack && !this.withHackValue(decl)) { - if (decl.raw('before').includes('\n')) { - this.reduceSpaces(decl) - } - rule.removeChild(i) - return - } - } - - // Values - for (let checker of this.prefixes.values('remove', unprefixed)) { - if (!checker.check) continue - if (!checker.check(decl.value)) continue - - unprefixed = checker.unprefixed - let notHack = this.prefixes.group(decl).down(other => { - return other.value.includes(unprefixed) - }) - - if (notHack) { - rule.removeChild(i) - return - } - } - }) - } - - /** - * Some rare old values, which is not in standard - */ - withHackValue(decl) { - return decl.prop === '-webkit-background-clip' && decl.value === 'text' - } - - /** - * Check for grid/flexbox options. - */ - disabledValue(node, result) { - if (this.gridStatus(node, result) === false && node.type === 'decl') { - if (node.prop === 'display' && node.value.includes('grid')) { - return true - } - } - if (this.prefixes.options.flexbox === false && node.type === 'decl') { - if (node.prop === 'display' && node.value.includes('flex')) { - return true - } - } - if (node.type === 'decl' && node.prop === 'content') { - return true - } - - return this.disabled(node, result) - } - - /** - * Check for grid/flexbox options. - */ - disabledDecl(node, result) { - if (this.gridStatus(node, result) === false && node.type === 'decl') { - if (node.prop.includes('grid') || node.prop === 'justify-items') { - return true - } - } - if (this.prefixes.options.flexbox === false && node.type === 'decl') { - let other = ['order', 'justify-content', 'align-items', 'align-content'] - if (node.prop.includes('flex') || other.includes(node.prop)) { - return true - } - } - - return this.disabled(node, result) - } - /** * Check for control comment and global options */ @@ -590,35 +455,43 @@ class Processor { } /** - * Normalize spaces in cascade declaration group + * Check for grid/flexbox options. */ - reduceSpaces(decl) { - let stop = false - this.prefixes.group(decl).up(() => { - stop = true - return true - }) - if (stop) { - return + disabledDecl(node, result) { + if (this.gridStatus(node, result) === false && node.type === 'decl') { + if (node.prop.includes('grid') || node.prop === 'justify-items') { + return true + } + } + if (this.prefixes.options.flexbox === false && node.type === 'decl') { + let other = ['order', 'justify-content', 'align-items', 'align-content'] + if (node.prop.includes('flex') || other.includes(node.prop)) { + return true + } } - let parts = decl.raw('before').split('\n') - let prevMin = parts[parts.length - 1].length - let diff = false - - this.prefixes.group(decl).down(other => { - parts = other.raw('before').split('\n') - let last = parts.length - 1 - - if (parts[last].length > prevMin) { - if (diff === false) { - diff = parts[last].length - prevMin - } + return this.disabled(node, result) + } - parts[last] = parts[last].slice(0, -diff) - other.raws.before = parts.join('\n') + /** + * Check for grid/flexbox options. + */ + disabledValue(node, result) { + if (this.gridStatus(node, result) === false && node.type === 'decl') { + if (node.prop === 'display' && node.value.includes('grid')) { + return true } - }) + } + if (this.prefixes.options.flexbox === false && node.type === 'decl') { + if (node.prop === 'display' && node.value.includes('flex')) { + return true + } + } + if (node.type === 'decl' && node.prop === 'content') { + return true + } + + return this.disabled(node, result) } /** @@ -713,6 +586,133 @@ class Processor { node._autoprefixerGridStatus = value return value } + + /** + * Normalize spaces in cascade declaration group + */ + reduceSpaces(decl) { + let stop = false + this.prefixes.group(decl).up(() => { + stop = true + return true + }) + if (stop) { + return + } + + let parts = decl.raw('before').split('\n') + let prevMin = parts[parts.length - 1].length + let diff = false + + this.prefixes.group(decl).down(other => { + parts = other.raw('before').split('\n') + let last = parts.length - 1 + + if (parts[last].length > prevMin) { + if (diff === false) { + diff = parts[last].length - prevMin + } + + parts[last] = parts[last].slice(0, -diff) + other.raws.before = parts.join('\n') + } + }) + } + + /** + * Remove unnecessary pefixes + */ + remove(css, result) { + // At-rules + let resolution = this.prefixes.remove['@resolution'] + + css.walkAtRules((rule, i) => { + if (this.prefixes.remove[`@${rule.name}`]) { + if (!this.disabled(rule, result)) { + rule.parent.removeChild(i) + } + } else if ( + rule.name === 'media' && + rule.params.includes('-resolution') && + resolution + ) { + resolution.clean(rule) + } + }) + + // Selectors + for (let checker of this.prefixes.remove.selectors) { + css.walkRules((rule, i) => { + if (checker.check(rule)) { + if (!this.disabled(rule, result)) { + rule.parent.removeChild(i) + } + } + }) + } + + return css.walkDecls((decl, i) => { + if (this.disabled(decl, result)) return + + let rule = decl.parent + let unprefixed = this.prefixes.unprefixed(decl.prop) + + // Transition + if (decl.prop === 'transition' || decl.prop === 'transition-property') { + this.prefixes.transition.remove(decl) + } + + // Properties + if ( + this.prefixes.remove[decl.prop] && + this.prefixes.remove[decl.prop].remove + ) { + let notHack = this.prefixes.group(decl).down(other => { + return this.prefixes.normalize(other.prop) === unprefixed + }) + + if (unprefixed === 'flex-flow') { + notHack = true + } + + if (decl.prop === '-webkit-box-orient') { + let hacks = { 'flex-direction': true, 'flex-flow': true } + if (!decl.parent.some(j => hacks[j.prop])) return + } + + if (notHack && !this.withHackValue(decl)) { + if (decl.raw('before').includes('\n')) { + this.reduceSpaces(decl) + } + rule.removeChild(i) + return + } + } + + // Values + for (let checker of this.prefixes.values('remove', unprefixed)) { + if (!checker.check) continue + if (!checker.check(decl.value)) continue + + unprefixed = checker.unprefixed + let notHack = this.prefixes.group(decl).down(other => { + return other.value.includes(unprefixed) + }) + + if (notHack) { + rule.removeChild(i) + return + } + } + }) + } + + /** + * Some rare old values, which is not in standard + */ + withHackValue(decl) { + return decl.prop === '-webkit-background-clip' && decl.value === 'text' + } } module.exports = Processor diff --git a/lib/resolution.js b/lib/resolution.js index ee04d6d99..4b71564e4 100644 --- a/lib/resolution.js +++ b/lib/resolution.js @@ -7,6 +7,23 @@ const REGEXP = /(min|max)-resolution\s*:\s*\d*\.?\d+(dppx|dpcm|dpi|x)/gi const SPLIT = /(min|max)-resolution(\s*:\s*)(\d*\.?\d+)(dppx|dpcm|dpi|x)/i class Resolution extends Prefixer { + /** + * Remove prefixed queries + */ + clean(rule) { + if (!this.bad) { + this.bad = [] + for (let prefix of this.prefixes) { + this.bad.push(this.prefixName(prefix, 'min')) + this.bad.push(this.prefixName(prefix, 'max')) + } + } + + rule.params = utils.editList(rule.params, queries => { + return queries.filter(query => this.bad.every(i => !query.includes(i))) + }) + } + /** * Return prefixed query name */ @@ -39,23 +56,6 @@ class Resolution extends Prefixer { return this.prefixName(prefix, name) + colon + value } - /** - * Remove prefixed queries - */ - clean(rule) { - if (!this.bad) { - this.bad = [] - for (let prefix of this.prefixes) { - this.bad.push(this.prefixName(prefix, 'min')) - this.bad.push(this.prefixName(prefix, 'max')) - } - } - - rule.params = utils.editList(rule.params, queries => { - return queries.filter(query => this.bad.every(i => !query.includes(i))) - }) - } - /** * Add prefixed queries */ diff --git a/lib/selector.js b/lib/selector.js index 2780b6b3e..ff53449f4 100644 --- a/lib/selector.js +++ b/lib/selector.js @@ -12,36 +12,70 @@ class Selector extends Prefixer { } /** - * Is rule selectors need to be prefixed + * Clone and add prefixes for at-rule */ - check(rule) { - if (rule.selector.includes(this.name)) { - return !!rule.selector.match(this.regexp()) + add(rule, prefix) { + let prefixeds = this.prefixeds(rule) + + if (this.already(rule, prefixeds, prefix)) { + return } - return false + let cloned = this.clone(rule, { selector: prefixeds[this.name][prefix] }) + rule.parent.insertBefore(rule, cloned) } /** - * Return prefixed version of selector + * Is rule already prefixed before */ - prefixed(prefix) { - return this.name.replace(/^(\W*)/, `$1${prefix}`) + already(rule, prefixeds, prefix) { + let index = rule.parent.index(rule) - 1 + + while (index >= 0) { + let before = rule.parent.nodes[index] + + if (before.type !== 'rule') { + return false + } + + let some = false + for (let key in prefixeds[this.name]) { + let prefixed = prefixeds[this.name][key] + if (before.selector === prefixed) { + if (prefix === key) { + return true + } else { + some = true + break + } + } + } + if (!some) { + return false + } + + index -= 1 + } + + return false } /** - * Lazy loadRegExp for name + * Is rule selectors need to be prefixed */ - regexp(prefix) { - if (!this.regexpCache.has(prefix)) { - let name = prefix ? this.prefixed(prefix) : this.name - this.regexpCache.set( - prefix, - new RegExp(`(^|[^:"'=])${utils.escapeRegexp(name)}`, 'gi') - ) + check(rule) { + if (rule.selector.includes(this.name)) { + return !!rule.selector.match(this.regexp()) } - return this.regexpCache.get(prefix) + return false + } + + /** + * Return function to fast find prefixed selector + */ + old(prefix) { + return new OldSelector(this, prefix) } /** @@ -51,6 +85,13 @@ class Selector extends Prefixer { return Browsers.prefixes() } + /** + * Return prefixed version of selector + */ + prefixed(prefix) { + return this.name.replace(/^(\W*)/, `$1${prefix}`) + } + /** * Return all possible selector prefixes */ @@ -84,38 +125,18 @@ class Selector extends Prefixer { } /** - * Is rule already prefixed before + * Lazy loadRegExp for name */ - already(rule, prefixeds, prefix) { - let index = rule.parent.index(rule) - 1 - - while (index >= 0) { - let before = rule.parent.nodes[index] - - if (before.type !== 'rule') { - return false - } - - let some = false - for (let key in prefixeds[this.name]) { - let prefixed = prefixeds[this.name][key] - if (before.selector === prefixed) { - if (prefix === key) { - return true - } else { - some = true - break - } - } - } - if (!some) { - return false - } - - index -= 1 + regexp(prefix) { + if (!this.regexpCache.has(prefix)) { + let name = prefix ? this.prefixed(prefix) : this.name + this.regexpCache.set( + prefix, + new RegExp(`(^|[^:"'=])${utils.escapeRegexp(name)}`, 'gi') + ) } - return false + return this.regexpCache.get(prefix) } /** @@ -124,27 +145,6 @@ class Selector extends Prefixer { replace(selector, prefix) { return selector.replace(this.regexp(), `$1${this.prefixed(prefix)}`) } - - /** - * Clone and add prefixes for at-rule - */ - add(rule, prefix) { - let prefixeds = this.prefixeds(rule) - - if (this.already(rule, prefixeds, prefix)) { - return - } - - let cloned = this.clone(rule, { selector: prefixeds[this.name][prefix] }) - rule.parent.insertBefore(rule, cloned) - } - - /** - * Return function to fast find prefixed selector - */ - old(prefix) { - return new OldSelector(this, prefix) - } } module.exports = Selector diff --git a/lib/supports.js b/lib/supports.js index 7d74c5a20..58bd5afae 100644 --- a/lib/supports.js +++ b/lib/supports.js @@ -27,73 +27,89 @@ class Supports { } /** - * Return prefixer only with @supports supported browsers + * Add prefixes */ - prefixer() { - if (this.prefixerCache) { - return this.prefixerCache - } + add(nodes, all) { + return nodes.map(i => { + if (this.isProp(i)) { + let prefixed = this.prefixed(i[0]) + if (prefixed.length > 1) { + return this.convert(prefixed) + } - let filtered = this.all.browsers.selected.filter(i => { - return supported.includes(i) - }) + return i + } - let browsers = new Browsers( - this.all.browsers.data, - filtered, - this.all.options - ) - this.prefixerCache = new this.Prefixes( - this.all.data, - browsers, - this.all.options - ) - return this.prefixerCache + if (typeof i === 'object') { + return this.add(i, all) + } + + return i + }) } /** - * Parse string into declaration property and value + * Clean brackets with one child */ - parse(str) { - let parts = str.split(':') - let prop = parts[0] - let value = parts[1] - if (!value) value = '' - return [prop.trim(), value.trim()] + cleanBrackets(nodes) { + return nodes.map(i => { + if (typeof i !== 'object') { + return i + } + + if (i.length === 1 && typeof i[0] === 'object') { + return this.cleanBrackets(i[0]) + } + + return this.cleanBrackets(i) + }) } /** - * Create virtual rule to process it by prefixer + * Add " or " between properties and convert it to brackets format */ - virtual(str) { - let [prop, value] = this.parse(str) - let rule = parse('a{}').first - rule.append({ prop, value, raws: { before: '' } }) - return rule + convert(progress) { + let result = [''] + for (let i of progress) { + result.push([`${i.prop}: ${i.value}`]) + result.push(' or ') + } + result[result.length - 1] = '' + return result } /** - * Return array of Declaration with all necessary prefixes + * Check global options */ - prefixed(str) { - let rule = this.virtual(str) - if (this.disabled(rule.first)) { - return rule.nodes + disabled(node) { + if (!this.all.options.grid) { + if (node.prop === 'display' && node.value.includes('grid')) { + return true + } + if (node.prop.includes('grid') || node.prop === 'justify-items') { + return true + } } - let result = { warn: () => null } - - let prefixer = this.prefixer().add[rule.first.prop] - prefixer && prefixer.process && prefixer.process(rule.first, result) - - for (let decl of rule.nodes) { - for (let value of this.prefixer().values('add', rule.first.prop)) { - value.process(decl) + if (this.all.options.flexbox === false) { + if (node.prop === 'display' && node.value.includes('flex')) { + return true + } + let other = ['order', 'justify-content', 'align-items', 'align-content'] + if (node.prop.includes('flex') || other.includes(node.prop)) { + return true } - Value.save(this.all, decl) } - return rule.nodes + return false + } + + /** + * Return true if prefixed property has no unprefixed + */ + isHack(all, unprefixed) { + let check = new RegExp(`(\\(|\\s)${utils.escapeRegexp(unprefixed)}:`) + return !check.test(all) } /** @@ -121,99 +137,6 @@ class Supports { ) } - /** - * Return true if prefixed property has no unprefixed - */ - isHack(all, unprefixed) { - let check = new RegExp(`(\\(|\\s)${utils.escapeRegexp(unprefixed)}:`) - return !check.test(all) - } - - /** - * Return true if we need to remove node - */ - toRemove(str, all) { - let [prop, value] = this.parse(str) - let unprefixed = this.all.unprefixed(prop) - - let cleaner = this.all.cleaner() - - if ( - cleaner.remove[prop] && - cleaner.remove[prop].remove && - !this.isHack(all, unprefixed) - ) { - return true - } - - for (let checker of cleaner.values('remove', unprefixed)) { - if (checker.check(value)) { - return true - } - } - - return false - } - - /** - * Remove all unnecessary prefixes - */ - remove(nodes, all) { - let i = 0 - while (i < nodes.length) { - if ( - !this.isNot(nodes[i - 1]) && - this.isProp(nodes[i]) && - this.isOr(nodes[i + 1]) - ) { - if (this.toRemove(nodes[i][0], all)) { - nodes.splice(i, 2) - continue - } - - i += 2 - continue - } - - if (typeof nodes[i] === 'object') { - nodes[i] = this.remove(nodes[i], all) - } - - i += 1 - } - return nodes - } - - /** - * Clean brackets with one child - */ - cleanBrackets(nodes) { - return nodes.map(i => { - if (typeof i !== 'object') { - return i - } - - if (i.length === 1 && typeof i[0] === 'object') { - return this.cleanBrackets(i[0]) - } - - return this.cleanBrackets(i) - }) - } - - /** - * Add " or " between properties and convert it to brackets format - */ - convert(progress) { - let result = [''] - for (let i of progress) { - result.push([`${i.prop}: ${i.value}`]) - result.push(' or ') - } - result[result.length - 1] = '' - return result - } - /** * Compress value functions into a string nodes */ @@ -239,25 +162,63 @@ class Supports { } /** - * Add prefixes + * Parse string into declaration property and value */ - add(nodes, all) { - return nodes.map(i => { - if (this.isProp(i)) { - let prefixed = this.prefixed(i[0]) - if (prefixed.length > 1) { - return this.convert(prefixed) - } + parse(str) { + let parts = str.split(':') + let prop = parts[0] + let value = parts[1] + if (!value) value = '' + return [prop.trim(), value.trim()] + } - return i - } + /** + * Return array of Declaration with all necessary prefixes + */ + prefixed(str) { + let rule = this.virtual(str) + if (this.disabled(rule.first)) { + return rule.nodes + } - if (typeof i === 'object') { - return this.add(i, all) + let result = { warn: () => null } + + let prefixer = this.prefixer().add[rule.first.prop] + prefixer && prefixer.process && prefixer.process(rule.first, result) + + for (let decl of rule.nodes) { + for (let value of this.prefixer().values('add', rule.first.prop)) { + value.process(decl) } + Value.save(this.all, decl) + } - return i + return rule.nodes + } + + /** + * Return prefixer only with @supports supported browsers + */ + prefixer() { + if (this.prefixerCache) { + return this.prefixerCache + } + + let filtered = this.all.browsers.selected.filter(i => { + return supported.includes(i) }) + + let browsers = new Browsers( + this.all.browsers.data, + filtered, + this.all.options + ) + this.prefixerCache = new this.Prefixes( + this.all.data, + browsers, + this.all.options + ) + return this.prefixerCache } /** @@ -273,30 +234,69 @@ class Supports { } /** - * Check global options + * Remove all unnecessary prefixes */ - disabled(node) { - if (!this.all.options.grid) { - if (node.prop === 'display' && node.value.includes('grid')) { - return true + remove(nodes, all) { + let i = 0 + while (i < nodes.length) { + if ( + !this.isNot(nodes[i - 1]) && + this.isProp(nodes[i]) && + this.isOr(nodes[i + 1]) + ) { + if (this.toRemove(nodes[i][0], all)) { + nodes.splice(i, 2) + continue + } + + i += 2 + continue } - if (node.prop.includes('grid') || node.prop === 'justify-items') { - return true + + if (typeof nodes[i] === 'object') { + nodes[i] = this.remove(nodes[i], all) } + + i += 1 } + return nodes + } - if (this.all.options.flexbox === false) { - if (node.prop === 'display' && node.value.includes('flex')) { - return true - } - let other = ['order', 'justify-content', 'align-items', 'align-content'] - if (node.prop.includes('flex') || other.includes(node.prop)) { + /** + * Return true if we need to remove node + */ + toRemove(str, all) { + let [prop, value] = this.parse(str) + let unprefixed = this.all.unprefixed(prop) + + let cleaner = this.all.cleaner() + + if ( + cleaner.remove[prop] && + cleaner.remove[prop].remove && + !this.isHack(all, unprefixed) + ) { + return true + } + + for (let checker of cleaner.values('remove', unprefixed)) { + if (checker.check(value)) { return true } } return false } + + /** + * Create virtual rule to process it by prefixer + */ + virtual(str) { + let [prop, value] = this.parse(str) + let rule = parse('a{}').first + rule.append({ prop, raws: { before: '' }, value }) + return rule + } } module.exports = Supports diff --git a/lib/transition.js b/lib/transition.js index 9df9e5d3b..7137eab69 100644 --- a/lib/transition.js +++ b/lib/transition.js @@ -79,21 +79,6 @@ class Transition { } } - /** - * Find property name - */ - findProp(param) { - let prop = param[0].value - if (/^\d/.test(prop)) { - for (let [i, token] of param.entries()) { - if (i !== 0 && token.type === 'word') { - return token.value - } - } - } - return prop - } - /** * Does we already have this declaration */ @@ -101,15 +86,6 @@ class Transition { return decl.parent.some(i => i.prop === prop && i.value === value) } - /** - * Add declaration if it is not exist - */ - cloneBefore(decl, prop, value) { - if (!this.already(decl, prop, value)) { - decl.cloneBefore({ prop, value }) - } - } - /** * Show transition-property warning */ @@ -156,79 +132,30 @@ class Transition { } /** - * Process transition and remove all unnecessary properties + * Remove all non-webkit prefixes and unprefixed params if we have prefixed */ - remove(decl) { - let params = this.parse(decl.value) - params = params.filter(i => { - let prop = this.prefixes.remove[this.findProp(i)] - return !prop || !prop.remove - }) - let value = this.stringify(params) - - if (decl.value === value) { - return - } - - if (params.length === 0) { - decl.remove() - return - } - - let double = decl.parent.some(i => { - return i.prop === decl.prop && i.value === value - }) - let smaller = decl.parent.some(i => { - return i !== decl && i.prop === decl.prop && i.value.length > value.length - }) - - if (double || smaller) { - decl.remove() - return - } - - decl.value = value - } + cleanFromUnprefixed(params, prefix) { + let remove = params + .map(i => this.findProp(i)) + .filter(i => i.slice(0, prefix.length) === prefix) + .map(i => this.prefixes.unprefixed(i)) - /** - * Parse properties list to array - */ - parse(value) { - let ast = parser(value) let result = [] - let param = [] - for (let node of ast.nodes) { - param.push(node) - if (node.type === 'div' && node.value === ',') { + for (let param of params) { + let prop = this.findProp(param) + let p = vendor.prefix(prop) + if (!remove.includes(prop) && (p === prefix || p === '')) { result.push(param) - param = [] } } - result.push(param) - return result.filter(i => i.length > 0) + return result } - /** - * Return properties string from array - */ - stringify(params) { - if (params.length === 0) { - return '' - } - let nodes = [] - for (let param of params) { - if (param[param.length - 1].type !== 'div') { - param.push(this.div(params)) - } - nodes = nodes.concat(param) - } - if (nodes[0].type === 'div') { - nodes = nodes.slice(1) - } - if (nodes[nodes.length - 1].type === 'div') { - nodes = nodes.slice(0, +-2 + 1 || undefined) - } - return parser.stringify({ nodes }) + cleanOtherPrefixes(params, prefix) { + return params.filter(param => { + let current = vendor.prefix(this.findProp(param)) + return current === '' || current === prefix + }) } /** @@ -248,6 +175,32 @@ class Transition { return result } + /** + * Add declaration if it is not exist + */ + cloneBefore(decl, prop, value) { + if (!this.already(decl, prop, value)) { + decl.cloneBefore({ prop, value }) + } + } + + /** + * Check property for disabled by option + */ + disabled(prop, prefix) { + let other = ['order', 'justify-content', 'align-self', 'align-content'] + if (prop.includes('flex') || other.includes(prop)) { + if (this.prefixes.options.flexbox === false) { + return true + } + + if (this.prefixes.options.flexbox === 'no-2009') { + return prefix.includes('2009') + } + } + return undefined + } + /** * Find or create separator */ @@ -259,51 +212,75 @@ class Transition { } } } - return { type: 'div', value: ',', after: ' ' } + return { after: ' ', type: 'div', value: ',' } } - cleanOtherPrefixes(params, prefix) { - return params.filter(param => { - let current = vendor.prefix(this.findProp(param)) - return current === '' || current === prefix - }) + /** + * Find property name + */ + findProp(param) { + let prop = param[0].value + if (/^\d/.test(prop)) { + for (let [i, token] of param.entries()) { + if (i !== 0 && token.type === 'word') { + return token.value + } + } + } + return prop } /** - * Remove all non-webkit prefixes and unprefixed params if we have prefixed + * Parse properties list to array */ - cleanFromUnprefixed(params, prefix) { - let remove = params - .map(i => this.findProp(i)) - .filter(i => i.slice(0, prefix.length) === prefix) - .map(i => this.prefixes.unprefixed(i)) - + parse(value) { + let ast = parser(value) let result = [] - for (let param of params) { - let prop = this.findProp(param) - let p = vendor.prefix(prop) - if (!remove.includes(prop) && (p === prefix || p === '')) { + let param = [] + for (let node of ast.nodes) { + param.push(node) + if (node.type === 'div' && node.value === ',') { result.push(param) + param = [] } } - return result + result.push(param) + return result.filter(i => i.length > 0) } /** - * Check property for disabled by option + * Process transition and remove all unnecessary properties */ - disabled(prop, prefix) { - let other = ['order', 'justify-content', 'align-self', 'align-content'] - if (prop.includes('flex') || other.includes(prop)) { - if (this.prefixes.options.flexbox === false) { - return true - } + remove(decl) { + let params = this.parse(decl.value) + params = params.filter(i => { + let prop = this.prefixes.remove[this.findProp(i)] + return !prop || !prop.remove + }) + let value = this.stringify(params) - if (this.prefixes.options.flexbox === 'no-2009') { - return prefix.includes('2009') - } + if (decl.value === value) { + return } - return undefined + + if (params.length === 0) { + decl.remove() + return + } + + let double = decl.parent.some(i => { + return i.prop === decl.prop && i.value === value + }) + let smaller = decl.parent.some(i => { + return i !== decl && i.prop === decl.prop && i.value.length > value.length + }) + + if (double || smaller) { + decl.remove() + return + } + + decl.value = value } /** @@ -324,6 +301,29 @@ class Transition { return selectors.length > 0 ? selectors : false } + + /** + * Return properties string from array + */ + stringify(params) { + if (params.length === 0) { + return '' + } + let nodes = [] + for (let param of params) { + if (param[param.length - 1].type !== 'div') { + param.push(this.div(params)) + } + nodes = nodes.concat(param) + } + if (nodes[0].type === 'div') { + nodes = nodes.slice(1) + } + if (nodes[nodes.length - 1].type === 'div') { + nodes = nodes.slice(0, +-2 + 1 || undefined) + } + return parser.stringify({ nodes }) + } } module.exports = Transition diff --git a/lib/value.js b/lib/value.js index ef6e632a5..ca42ba11a 100644 --- a/lib/value.js +++ b/lib/value.js @@ -58,6 +58,25 @@ class Value extends Prefixer { return result } + /** + * Save values with next prefixed token + */ + add(decl, prefix) { + if (!decl._autoprefixerValues) { + decl._autoprefixerValues = {} + } + let value = decl._autoprefixerValues[prefix] || this.value(decl) + + let before + do { + before = value + value = this.replace(value, prefix) + if (value === false) return + } while (value !== before) + + decl._autoprefixerValues[prefix] = value + } + /** * Is declaration need to be prefixed */ @@ -70,6 +89,13 @@ class Value extends Prefixer { return !!value.match(this.regexp()) } + /** + * Return function to fast find prefixed value + */ + old(prefix) { + return new OldValue(this.name, prefix + this.name) + } + /** * Lazy regexp loading */ @@ -94,32 +120,6 @@ class Value extends Prefixer { return decl.value } } - - /** - * Save values with next prefixed token - */ - add(decl, prefix) { - if (!decl._autoprefixerValues) { - decl._autoprefixerValues = {} - } - let value = decl._autoprefixerValues[prefix] || this.value(decl) - - let before - do { - before = value - value = this.replace(value, prefix) - if (value === false) return - } while (value !== before) - - decl._autoprefixerValues[prefix] = value - } - - /** - * Return function to fast find prefixed value - */ - old(prefix) { - return new OldValue(this.name, prefix + this.name) - } } module.exports = Value diff --git a/package.json b/package.json index 96db4176e..cbdf91b37 100644 --- a/package.json +++ b/package.json @@ -43,27 +43,27 @@ "postcss": "^8.1.0" }, "dependencies": { - "browserslist": "^4.21.5", - "caniuse-lite": "^1.0.30001470", + "browserslist": "^4.21.9", + "caniuse-lite": "^1.0.30001513", "fraction.js": "^4.2.0", "normalize-range": "^0.1.2", "picocolors": "^1.0.0", "postcss-value-parser": "^4.2.0" }, "devDependencies": { - "@logux/eslint-config": "^49.0.0", - "@size-limit/preset-small-lib": "8.2.4", - "c8": "^7.13.0", - "clean-publish": "^4.1.1", - "eslint": "^8.36.0", - "eslint-config-standard": "^17.0.0", + "@logux/eslint-config": "^51.0.0", + "@size-limit/preset-small-lib": "8.2.6", + "c8": "^8.0.0", + "clean-publish": "^4.2.0", + "eslint": "^8.44.0", + "eslint-config-standard": "^17.1.0", "eslint-plugin-import": "^2.27.5", - "eslint-plugin-n": "^15.6.1", + "eslint-plugin-n": "^16.0.1", "eslint-plugin-prefer-let": "^3.0.1", "eslint-plugin-promise": "^6.1.1", - "nanospy": "^0.5.0", - "postcss": "^8.4.21", - "size-limit": "^8.2.4", + "nanospy": "^1.0.0", + "postcss": "^8.4.25", + "size-limit": "^8.2.6", "uvu": "^0.5.6" }, "prettier": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c5b3c209c..69446a73c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,11 +6,11 @@ settings: dependencies: browserslist: - specifier: ^4.21.5 - version: 4.21.5 + specifier: ^4.21.9 + version: 4.21.9 caniuse-lite: - specifier: ^1.0.30001470 - version: 1.0.30001470 + specifier: ^1.0.30001513 + version: 1.0.30001513 fraction.js: specifier: ^4.2.0 version: 4.2.0 @@ -26,56 +26,61 @@ dependencies: devDependencies: '@logux/eslint-config': - specifier: ^49.0.0 - version: 49.0.0(eslint-config-standard@17.0.0)(eslint-plugin-import@2.27.5)(eslint-plugin-n@15.6.1)(eslint-plugin-prefer-let@3.0.1)(eslint-plugin-promise@6.1.1)(eslint@8.36.0) + specifier: ^51.0.0 + version: 51.0.0(eslint-config-standard@17.1.0)(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.1)(eslint-plugin-perfectionist@1.4.0)(eslint-plugin-prefer-let@3.0.1)(eslint-plugin-promise@6.1.1)(eslint@8.44.0) '@size-limit/preset-small-lib': - specifier: 8.2.4 - version: 8.2.4(size-limit@8.2.4) + specifier: 8.2.6 + version: 8.2.6(size-limit@8.2.6) c8: - specifier: ^7.13.0 - version: 7.13.0 + specifier: ^8.0.0 + version: 8.0.0 clean-publish: - specifier: ^4.1.1 - version: 4.1.1 + specifier: ^4.2.0 + version: 4.2.0 eslint: - specifier: ^8.36.0 - version: 8.36.0 + specifier: ^8.44.0 + version: 8.44.0 eslint-config-standard: - specifier: ^17.0.0 - version: 17.0.0(eslint-plugin-import@2.27.5)(eslint-plugin-n@15.6.1)(eslint-plugin-promise@6.1.1)(eslint@8.36.0) + specifier: ^17.1.0 + version: 17.1.0(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.1)(eslint-plugin-promise@6.1.1)(eslint@8.44.0) eslint-plugin-import: specifier: ^2.27.5 - version: 2.27.5(eslint@8.36.0) + version: 2.27.5(eslint@8.44.0) eslint-plugin-n: - specifier: ^15.6.1 - version: 15.6.1(eslint@8.36.0) + specifier: ^16.0.1 + version: 16.0.1(eslint@8.44.0) eslint-plugin-prefer-let: specifier: ^3.0.1 version: 3.0.1 eslint-plugin-promise: specifier: ^6.1.1 - version: 6.1.1(eslint@8.36.0) + version: 6.1.1(eslint@8.44.0) nanospy: - specifier: ^0.5.0 - version: 0.5.0 + specifier: ^1.0.0 + version: 1.0.0 postcss: - specifier: ^8.4.21 - version: 8.4.21 + specifier: ^8.4.25 + version: 8.4.25 size-limit: - specifier: ^8.2.4 - version: 8.2.4 + specifier: ^8.2.6 + version: 8.2.6 uvu: specifier: ^0.5.6 version: 0.5.6 packages: + /@aashutoshrathi/word-wrap@1.2.6: + resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} + engines: {node: '>=0.10.0'} + dev: true + /@bcoe/v8-coverage@0.2.3: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true - /@esbuild/android-arm64@0.17.14: - resolution: {integrity: sha512-eLOpPO1RvtsP71afiFTvS7tVFShJBCT0txiv/xjFBo5a7R7Gjw7X0IgIaFoLKhqXYAXhahoXm7qAmRXhY4guJg==} + /@esbuild/android-arm64@0.18.11: + resolution: {integrity: sha512-snieiq75Z1z5LJX9cduSAjUr7vEI1OdlzFPMw0HH5YI7qQHDd3qs+WZoMrWYDsfRJSq36lIA6mfZBkvL46KoIw==} engines: {node: '>=12'} cpu: [arm64] os: [android] @@ -83,8 +88,8 @@ packages: dev: true optional: true - /@esbuild/android-arm@0.17.14: - resolution: {integrity: sha512-0CnlwnjDU8cks0yJLXfkaU/uoLyRf9VZJs4p1PskBr2AlAHeEsFEwJEo0of/Z3g+ilw5mpyDwThlxzNEIxOE4g==} + /@esbuild/android-arm@0.18.11: + resolution: {integrity: sha512-q4qlUf5ucwbUJZXF5tEQ8LF7y0Nk4P58hOsGk3ucY0oCwgQqAnqXVbUuahCddVHfrxmpyewRpiTHwVHIETYu7Q==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -92,8 +97,8 @@ packages: dev: true optional: true - /@esbuild/android-x64@0.17.14: - resolution: {integrity: sha512-nrfQYWBfLGfSGLvRVlt6xi63B5IbfHm3tZCdu/82zuFPQ7zez4XjmRtF/wIRYbJQ/DsZrxJdEvYFE67avYXyng==} + /@esbuild/android-x64@0.18.11: + resolution: {integrity: sha512-iPuoxQEV34+hTF6FT7om+Qwziv1U519lEOvekXO9zaMMlT9+XneAhKL32DW3H7okrCOBQ44BMihE8dclbZtTuw==} engines: {node: '>=12'} cpu: [x64] os: [android] @@ -101,8 +106,8 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64@0.17.14: - resolution: {integrity: sha512-eoSjEuDsU1ROwgBH/c+fZzuSyJUVXQTOIN9xuLs9dE/9HbV/A5IqdXHU1p2OfIMwBwOYJ9SFVGGldxeRCUJFyw==} + /@esbuild/darwin-arm64@0.18.11: + resolution: {integrity: sha512-Gm0QkI3k402OpfMKyQEEMG0RuW2LQsSmI6OeO4El2ojJMoF5NLYb3qMIjvbG/lbMeLOGiW6ooU8xqc+S0fgz2w==} engines: {node: '>=12'} cpu: [arm64] os: [darwin] @@ -110,8 +115,8 @@ packages: dev: true optional: true - /@esbuild/darwin-x64@0.17.14: - resolution: {integrity: sha512-zN0U8RWfrDttdFNkHqFYZtOH8hdi22z0pFm0aIJPsNC4QQZv7je8DWCX5iA4Zx6tRhS0CCc0XC2m7wKsbWEo5g==} + /@esbuild/darwin-x64@0.18.11: + resolution: {integrity: sha512-N15Vzy0YNHu6cfyDOjiyfJlRJCB/ngKOAvoBf1qybG3eOq0SL2Lutzz9N7DYUbb7Q23XtHPn6lMDF6uWbGv9Fw==} engines: {node: '>=12'} cpu: [x64] os: [darwin] @@ -119,8 +124,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64@0.17.14: - resolution: {integrity: sha512-z0VcD4ibeZWVQCW1O7szaLxGsx54gcCnajEJMdYoYjLiq4g1jrP2lMq6pk71dbS5+7op/L2Aod+erw+EUr28/A==} + /@esbuild/freebsd-arm64@0.18.11: + resolution: {integrity: sha512-atEyuq6a3omEY5qAh5jIORWk8MzFnCpSTUruBgeyN9jZq1K/QI9uke0ATi3MHu4L8c59CnIi4+1jDKMuqmR71A==} engines: {node: '>=12'} cpu: [arm64] os: [freebsd] @@ -128,8 +133,8 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64@0.17.14: - resolution: {integrity: sha512-hd9mPcxfTgJlolrPlcXkQk9BMwNBvNBsVaUe5eNUqXut6weDQH8whcNaKNF2RO8NbpT6GY8rHOK2A9y++s+ehw==} + /@esbuild/freebsd-x64@0.18.11: + resolution: {integrity: sha512-XtuPrEfBj/YYYnAAB7KcorzzpGTvOr/dTtXPGesRfmflqhA4LMF0Gh/n5+a9JBzPuJ+CGk17CA++Hmr1F/gI0Q==} engines: {node: '>=12'} cpu: [x64] os: [freebsd] @@ -137,8 +142,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm64@0.17.14: - resolution: {integrity: sha512-FhAMNYOq3Iblcj9i+K0l1Fp/MHt+zBeRu/Qkf0LtrcFu3T45jcwB6A1iMsemQ42vR3GBhjNZJZTaCe3VFPbn9g==} + /@esbuild/linux-arm64@0.18.11: + resolution: {integrity: sha512-c6Vh2WS9VFKxKZ2TvJdA7gdy0n6eSy+yunBvv4aqNCEhSWVor1TU43wNRp2YLO9Vng2G+W94aRz+ILDSwAiYog==} engines: {node: '>=12'} cpu: [arm64] os: [linux] @@ -146,8 +151,8 @@ packages: dev: true optional: true - /@esbuild/linux-arm@0.17.14: - resolution: {integrity: sha512-BNTl+wSJ1omsH8s3TkQmIIIQHwvwJrU9u1ggb9XU2KTVM4TmthRIVyxSp2qxROJHhZuW/r8fht46/QE8hU8Qvg==} + /@esbuild/linux-arm@0.18.11: + resolution: {integrity: sha512-Idipz+Taso/toi2ETugShXjQ3S59b6m62KmLHkJlSq/cBejixmIydqrtM2XTvNCywFl3VC7SreSf6NV0i6sRyg==} engines: {node: '>=12'} cpu: [arm] os: [linux] @@ -155,8 +160,8 @@ packages: dev: true optional: true - /@esbuild/linux-ia32@0.17.14: - resolution: {integrity: sha512-91OK/lQ5y2v7AsmnFT+0EyxdPTNhov3y2CWMdizyMfxSxRqHazXdzgBKtlmkU2KYIc+9ZK3Vwp2KyXogEATYxQ==} + /@esbuild/linux-ia32@0.18.11: + resolution: {integrity: sha512-S3hkIF6KUqRh9n1Q0dSyYcWmcVa9Cg+mSoZEfFuzoYXXsk6196qndrM+ZiHNwpZKi3XOXpShZZ+9dfN5ykqjjw==} engines: {node: '>=12'} cpu: [ia32] os: [linux] @@ -164,8 +169,8 @@ packages: dev: true optional: true - /@esbuild/linux-loong64@0.17.14: - resolution: {integrity: sha512-vp15H+5NR6hubNgMluqqKza85HcGJgq7t6rMH7O3Y6ApiOWPkvW2AJfNojUQimfTp6OUrACUXfR4hmpcENXoMQ==} + /@esbuild/linux-loong64@0.18.11: + resolution: {integrity: sha512-MRESANOoObQINBA+RMZW+Z0TJWpibtE7cPFnahzyQHDCA9X9LOmGh68MVimZlM9J8n5Ia8lU773te6O3ILW8kw==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -173,8 +178,8 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el@0.17.14: - resolution: {integrity: sha512-90TOdFV7N+fgi6c2+GO9ochEkmm9kBAKnuD5e08GQMgMINOdOFHuYLPQ91RYVrnWwQ5683sJKuLi9l4SsbJ7Hg==} + /@esbuild/linux-mips64el@0.18.11: + resolution: {integrity: sha512-qVyPIZrXNMOLYegtD1u8EBccCrBVshxMrn5MkuFc3mEVsw7CCQHaqZ4jm9hbn4gWY95XFnb7i4SsT3eflxZsUg==} engines: {node: '>=12'} cpu: [mips64el] os: [linux] @@ -182,8 +187,8 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64@0.17.14: - resolution: {integrity: sha512-NnBGeoqKkTugpBOBZZoktQQ1Yqb7aHKmHxsw43NddPB2YWLAlpb7THZIzsRsTr0Xw3nqiPxbA1H31ZMOG+VVPQ==} + /@esbuild/linux-ppc64@0.18.11: + resolution: {integrity: sha512-T3yd8vJXfPirZaUOoA9D2ZjxZX4Gr3QuC3GztBJA6PklLotc/7sXTOuuRkhE9W/5JvJP/K9b99ayPNAD+R+4qQ==} engines: {node: '>=12'} cpu: [ppc64] os: [linux] @@ -191,8 +196,8 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64@0.17.14: - resolution: {integrity: sha512-0qdlKScLXA8MGVy21JUKvMzCYWovctuP8KKqhtE5A6IVPq4onxXhSuhwDd2g5sRCzNDlDjitc5sX31BzDoL5Fw==} + /@esbuild/linux-riscv64@0.18.11: + resolution: {integrity: sha512-evUoRPWiwuFk++snjH9e2cAjF5VVSTj+Dnf+rkO/Q20tRqv+644279TZlPK8nUGunjPAtQRCj1jQkDAvL6rm2w==} engines: {node: '>=12'} cpu: [riscv64] os: [linux] @@ -200,8 +205,8 @@ packages: dev: true optional: true - /@esbuild/linux-s390x@0.17.14: - resolution: {integrity: sha512-Hdm2Jo1yaaOro4v3+6/zJk6ygCqIZuSDJHdHaf8nVH/tfOuoEX5Riv03Ka15LmQBYJObUTNS1UdyoMk0WUn9Ww==} + /@esbuild/linux-s390x@0.18.11: + resolution: {integrity: sha512-/SlRJ15XR6i93gRWquRxYCfhTeC5PdqEapKoLbX63PLCmAkXZHY2uQm2l9bN0oPHBsOw2IswRZctMYS0MijFcg==} engines: {node: '>=12'} cpu: [s390x] os: [linux] @@ -209,8 +214,8 @@ packages: dev: true optional: true - /@esbuild/linux-x64@0.17.14: - resolution: {integrity: sha512-8KHF17OstlK4DuzeF/KmSgzrTWQrkWj5boluiiq7kvJCiQVzUrmSkaBvcLB2UgHpKENO2i6BthPkmUhNDaJsVw==} + /@esbuild/linux-x64@0.18.11: + resolution: {integrity: sha512-xcncej+wF16WEmIwPtCHi0qmx1FweBqgsRtEL1mSHLFR6/mb3GEZfLQnx+pUDfRDEM4DQF8dpXIW7eDOZl1IbA==} engines: {node: '>=12'} cpu: [x64] os: [linux] @@ -218,8 +223,8 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64@0.17.14: - resolution: {integrity: sha512-nVwpqvb3yyXztxIT2+VsxJhB5GCgzPdk1n0HHSnchRAcxqKO6ghXwHhJnr0j/B+5FSyEqSxF4q03rbA2fKXtUQ==} + /@esbuild/netbsd-x64@0.18.11: + resolution: {integrity: sha512-aSjMHj/F7BuS1CptSXNg6S3M4F3bLp5wfFPIJM+Km2NfIVfFKhdmfHF9frhiCLIGVzDziggqWll0B+9AUbud/Q==} engines: {node: '>=12'} cpu: [x64] os: [netbsd] @@ -227,8 +232,8 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64@0.17.14: - resolution: {integrity: sha512-1RZ7uQQ9zcy/GSAJL1xPdN7NDdOOtNEGiJalg/MOzeakZeTrgH/DoCkbq7TaPDiPhWqnDF+4bnydxRqQD7il6g==} + /@esbuild/openbsd-x64@0.18.11: + resolution: {integrity: sha512-tNBq+6XIBZtht0xJGv7IBB5XaSyvYPCm1PxJ33zLQONdZoLVM0bgGqUrXnJyiEguD9LU4AHiu+GCXy/Hm9LsdQ==} engines: {node: '>=12'} cpu: [x64] os: [openbsd] @@ -236,8 +241,8 @@ packages: dev: true optional: true - /@esbuild/sunos-x64@0.17.14: - resolution: {integrity: sha512-nqMjDsFwv7vp7msrwWRysnM38Sd44PKmW8EzV01YzDBTcTWUpczQg6mGao9VLicXSgW/iookNK6AxeogNVNDZA==} + /@esbuild/sunos-x64@0.18.11: + resolution: {integrity: sha512-kxfbDOrH4dHuAAOhr7D7EqaYf+W45LsAOOhAet99EyuxxQmjbk8M9N4ezHcEiCYPaiW8Dj3K26Z2V17Gt6p3ng==} engines: {node: '>=12'} cpu: [x64] os: [sunos] @@ -245,8 +250,8 @@ packages: dev: true optional: true - /@esbuild/win32-arm64@0.17.14: - resolution: {integrity: sha512-xrD0mccTKRBBIotrITV7WVQAwNJ5+1va6L0H9zN92v2yEdjfAN7864cUaZwJS7JPEs53bDTzKFbfqVlG2HhyKQ==} + /@esbuild/win32-arm64@0.18.11: + resolution: {integrity: sha512-Sh0dDRyk1Xi348idbal7lZyfSkjhJsdFeuC13zqdipsvMetlGiFQNdO+Yfp6f6B4FbyQm7qsk16yaZk25LChzg==} engines: {node: '>=12'} cpu: [arm64] os: [win32] @@ -254,8 +259,8 @@ packages: dev: true optional: true - /@esbuild/win32-ia32@0.17.14: - resolution: {integrity: sha512-nXpkz9bbJrLLyUTYtRotSS3t5b+FOuljg8LgLdINWFs3FfqZMtbnBCZFUmBzQPyxqU87F8Av+3Nco/M3hEcu1w==} + /@esbuild/win32-ia32@0.18.11: + resolution: {integrity: sha512-o9JUIKF1j0rqJTFbIoF4bXj6rvrTZYOrfRcGyL0Vm5uJ/j5CkBD/51tpdxe9lXEDouhRgdr/BYzUrDOvrWwJpg==} engines: {node: '>=12'} cpu: [ia32] os: [win32] @@ -263,8 +268,8 @@ packages: dev: true optional: true - /@esbuild/win32-x64@0.17.14: - resolution: {integrity: sha512-gPQmsi2DKTaEgG14hc3CHXHp62k8g6qr0Pas+I4lUxRMugGSATh/Bi8Dgusoz9IQ0IfdrvLpco6kujEIBoaogA==} + /@esbuild/win32-x64@0.18.11: + resolution: {integrity: sha512-rQI4cjLHd2hGsM1LqgDI7oOCYbQ6IBOVsX9ejuRMSze0GqXUG2ekwiKkiBU1pRGSeCqFFHxTrcEydB2Hyoz9CA==} engines: {node: '>=12'} cpu: [x64] os: [win32] @@ -272,28 +277,28 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.36.0): + /@eslint-community/eslint-utils@4.4.0(eslint@8.44.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.36.0 - eslint-visitor-keys: 3.3.0 + eslint: 8.44.0 + eslint-visitor-keys: 3.4.1 dev: true - /@eslint-community/regexpp@4.4.1: - resolution: {integrity: sha512-BISJ6ZE4xQsuL/FmsyRaiffpq977bMlsKfGHTQrOGFErfByxIe6iZTxPf/00Zon9b9a7iUykfQwejN3s2ZW/Bw==} + /@eslint-community/regexpp@4.5.1: + resolution: {integrity: sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true - /@eslint/eslintrc@2.0.1: - resolution: {integrity: sha512-eFRmABvW2E5Ho6f5fHLqgena46rOj7r7OKHYfLElqcBfGFHHpjBhivyi5+jOEQuSpdc/1phIZJlbC2te+tZNIw==} + /@eslint/eslintrc@2.1.0: + resolution: {integrity: sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 debug: 4.3.4 - espree: 9.5.0 + espree: 9.6.0 globals: 13.20.0 ignore: 5.2.4 import-fresh: 3.3.0 @@ -304,13 +309,13 @@ packages: - supports-color dev: true - /@eslint/js@8.36.0: - resolution: {integrity: sha512-lxJ9R5ygVm8ZWgYdUweoq5ownDlJ4upvoWmO4eLxBYHdMo+vZ/Rx0EN6MbKWDJOSUGrqJy2Gt+Dyv/VKml0fjg==} + /@eslint/js@8.44.0: + resolution: {integrity: sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@humanwhocodes/config-array@0.11.8: - resolution: {integrity: sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==} + /@humanwhocodes/config-array@0.11.10: + resolution: {integrity: sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==} engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 1.2.1 @@ -343,30 +348,32 @@ packages: resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} dev: true - /@jridgewell/trace-mapping@0.3.17: - resolution: {integrity: sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==} + /@jridgewell/trace-mapping@0.3.18: + resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} dependencies: '@jridgewell/resolve-uri': 3.1.0 '@jridgewell/sourcemap-codec': 1.4.14 dev: true - /@logux/eslint-config@49.0.0(eslint-config-standard@17.0.0)(eslint-plugin-import@2.27.5)(eslint-plugin-n@15.6.1)(eslint-plugin-prefer-let@3.0.1)(eslint-plugin-promise@6.1.1)(eslint@8.36.0): - resolution: {integrity: sha512-5Aj1wytb+1oej3wLH8G7D35Glx88Iuj07JcVL3YruRhl4v7WZnF3w3RR3IVSQAvllQch4eemvHnLenrZ3PimFg==} + /@logux/eslint-config@51.0.0(eslint-config-standard@17.1.0)(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.1)(eslint-plugin-perfectionist@1.4.0)(eslint-plugin-prefer-let@3.0.1)(eslint-plugin-promise@6.1.1)(eslint@8.44.0): + resolution: {integrity: sha512-x8cdRyBGcYyAGtO+sKbA7cAzGhSKRlQjiqHlgtthgFStqKUDK6+C4TmFgosTLw4veNVuoslVX6iU/jNva7pgGQ==} engines: {node: '>=10.0.0'} peerDependencies: - eslint: ^8.35.0 - eslint-config-standard: ^17.0.0 + eslint: ^8.42.0 + eslint-config-standard: ^17.1.0 eslint-plugin-import: ^2.27.5 - eslint-plugin-n: ^15.6.1 + eslint-plugin-n: ^16.0.0 + eslint-plugin-perfectionist: ^1.1.0 eslint-plugin-prefer-let: ^3.0.1 eslint-plugin-promise: ^6.1.1 dependencies: - eslint: 8.36.0 - eslint-config-standard: 17.0.0(eslint-plugin-import@2.27.5)(eslint-plugin-n@15.6.1)(eslint-plugin-promise@6.1.1)(eslint@8.36.0) - eslint-plugin-import: 2.27.5(eslint@8.36.0) - eslint-plugin-n: 15.6.1(eslint@8.36.0) + eslint: 8.44.0 + eslint-config-standard: 17.1.0(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.1)(eslint-plugin-promise@6.1.1)(eslint@8.44.0) + eslint-plugin-import: 2.27.5(eslint@8.44.0) + eslint-plugin-n: 16.0.1(eslint@8.44.0) + eslint-plugin-perfectionist: 1.4.0(eslint@8.44.0)(typescript@5.1.6) eslint-plugin-prefer-let: 3.0.1 - eslint-plugin-promise: 6.1.1(eslint@8.36.0) + eslint-plugin-promise: 6.1.1(eslint@8.44.0) dev: true /@nodelib/fs.scandir@2.1.5: @@ -390,55 +397,125 @@ packages: fastq: 1.15.0 dev: true - /@size-limit/esbuild@8.2.4(size-limit@8.2.4): - resolution: {integrity: sha512-kPgNfpwUvBD98s5axlf1UciFg4Ki4AYSl/cOmSyyYBuzksHiwW7Myeu0w4mTxtV9nwBFbkrrNXqszE7b+OhFLA==} + /@size-limit/esbuild@8.2.6(size-limit@8.2.6): + resolution: {integrity: sha512-a4c8xVDuDMYw5jF655ADjQDluw3jGPPYer6UJock5rSnUlWnIbmT/Ohud7gJGq5gqyLUQOCrBD7NB3g+mlhj4g==} engines: {node: ^14.0.0 || ^16.0.0 || >=18.0.0} peerDependencies: - size-limit: 8.2.4 + size-limit: 8.2.6 dependencies: - esbuild: 0.17.14 - nanoid: 3.3.4 - size-limit: 8.2.4 + esbuild: 0.18.11 + nanoid: 3.3.6 + size-limit: 8.2.6 dev: true - /@size-limit/file@8.2.4(size-limit@8.2.4): - resolution: {integrity: sha512-xLuF97W7m7lxrRJvqXRlxO/4t7cpXtfxOnjml/t4aRVUCMXLdyvebRr9OM4jjoK8Fmiz8jomCbETUCI3jVhLzA==} + /@size-limit/file@8.2.6(size-limit@8.2.6): + resolution: {integrity: sha512-B7ayjxiJsbtXdIIWazJkB5gezi5WBMecdHTFPMDhI3NwEML1RVvUjAkrb1mPAAkIpt2LVHPnhdCUHjqDdjugwg==} engines: {node: ^14.0.0 || ^16.0.0 || >=18.0.0} peerDependencies: - size-limit: 8.2.4 + size-limit: 8.2.6 dependencies: - semver: 7.3.8 - size-limit: 8.2.4 + semver: 7.5.3 + size-limit: 8.2.6 dev: true - /@size-limit/preset-small-lib@8.2.4(size-limit@8.2.4): - resolution: {integrity: sha512-AL4384oBgMcDPlNblgWHreqFSSOui0J9NbgyHhegB1h8AgRyHbdVGC3yWLpEESYQXHYnKdbNrYeRE/TclsViog==} + /@size-limit/preset-small-lib@8.2.6(size-limit@8.2.6): + resolution: {integrity: sha512-roanEuscDaaXDsT5Cg9agMbmsQVlMr66eRg3AwT2o4vE7WFLR8Z42p0AHZiwucW1nGpCxAh8E08Qa/yyVuj5nA==} peerDependencies: - size-limit: 8.2.4 + size-limit: 8.2.6 dependencies: - '@size-limit/esbuild': 8.2.4(size-limit@8.2.4) - '@size-limit/file': 8.2.4(size-limit@8.2.4) - size-limit: 8.2.4 + '@size-limit/esbuild': 8.2.6(size-limit@8.2.6) + '@size-limit/file': 8.2.6(size-limit@8.2.6) + size-limit: 8.2.6 dev: true /@types/istanbul-lib-coverage@2.0.4: resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} dev: true + /@types/json-schema@7.0.12: + resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==} + dev: true + /@types/json5@0.0.29: resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} dev: true - /acorn-jsx@5.3.2(acorn@8.8.2): + /@types/semver@7.5.0: + resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==} + dev: true + + /@typescript-eslint/scope-manager@5.61.0: + resolution: {integrity: sha512-W8VoMjoSg7f7nqAROEmTt6LoBpn81AegP7uKhhW5KzYlehs8VV0ZW0fIDVbcZRcaP3aPSW+JZFua+ysQN+m/Nw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.61.0 + '@typescript-eslint/visitor-keys': 5.61.0 + dev: true + + /@typescript-eslint/types@5.61.0: + resolution: {integrity: sha512-ldyueo58KjngXpzloHUog/h9REmHl59G1b3a5Sng1GfBo14BkS3ZbMEb3693gnP1k//97lh7bKsp6/V/0v1veQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: true + + /@typescript-eslint/typescript-estree@5.61.0(typescript@5.1.6): + resolution: {integrity: sha512-Fud90PxONnnLZ36oR5ClJBLTLfU4pIWBmnvGwTbEa2cXIqj70AEDEmOmpkFComjBZ/037ueKrOdHuYmSFVD7Rw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.61.0 + '@typescript-eslint/visitor-keys': 5.61.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.5.4 + tsutils: 3.21.0(typescript@5.1.6) + typescript: 5.1.6 + transitivePeerDependencies: + - supports-color + dev: true + + /@typescript-eslint/utils@5.61.0(eslint@8.44.0)(typescript@5.1.6): + resolution: {integrity: sha512-mV6O+6VgQmVE6+xzlA91xifndPW9ElFW8vbSF0xCT/czPXVhwDewKila1jOyRwa9AE19zKnrr7Cg5S3pJVrTWQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.44.0) + '@types/json-schema': 7.0.12 + '@types/semver': 7.5.0 + '@typescript-eslint/scope-manager': 5.61.0 + '@typescript-eslint/types': 5.61.0 + '@typescript-eslint/typescript-estree': 5.61.0(typescript@5.1.6) + eslint: 8.44.0 + eslint-scope: 5.1.1 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + - typescript + dev: true + + /@typescript-eslint/visitor-keys@5.61.0: + resolution: {integrity: sha512-50XQ5VdbWrX06mQXhy93WywSFZZGsv3EOjq+lqp6WC2t+j3mb6A9xYVdrRxafvK88vg9k9u+CT4l6D8PEatjKg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.61.0 + eslint-visitor-keys: 3.4.1 + dev: true + + /acorn-jsx@5.3.2(acorn@8.10.0): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.8.2 + acorn: 8.10.0 dev: true - /acorn@8.8.2: - resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} + /acorn@8.10.0: + resolution: {integrity: sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==} engines: {node: '>=0.4.0'} hasBin: true dev: true @@ -490,7 +567,7 @@ packages: call-bind: 1.0.2 define-properties: 1.2.0 es-abstract: 1.21.2 - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 is-string: 1.0.7 dev: true @@ -540,6 +617,12 @@ packages: concat-map: 0.0.1 dev: true + /brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: true + /braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} @@ -547,21 +630,21 @@ packages: fill-range: 7.0.1 dev: true - /browserslist@4.21.5: - resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} + /browserslist@4.21.9: + resolution: {integrity: sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001470 - electron-to-chromium: 1.4.340 - node-releases: 2.0.10 - update-browserslist-db: 1.0.10(browserslist@4.21.5) + caniuse-lite: 1.0.30001513 + electron-to-chromium: 1.4.454 + node-releases: 2.0.13 + update-browserslist-db: 1.0.11(browserslist@4.21.9) dev: false /builtins@5.0.1: resolution: {integrity: sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==} dependencies: - semver: 7.3.8 + semver: 7.5.4 dev: true /bytes-iec@3.1.1: @@ -569,9 +652,9 @@ packages: engines: {node: '>= 0.8'} dev: true - /c8@7.13.0: - resolution: {integrity: sha512-/NL4hQTv1gBL6J6ei80zu3IiTrmePDKXKXOTLpHvcIWZTVYQlDhVWjjWvkhICylE8EwwnMVzDZugCvdx0/DIIA==} - engines: {node: '>=10.12.0'} + /c8@8.0.0: + resolution: {integrity: sha512-XHA5vSfCLglAc0Xt8eLBZMv19lgiBSjnb1FLAQgnwkuhJYEonpilhEB4Ea3jPAbm0FhD6VVJrc0z73jPe7JyGQ==} + engines: {node: '>=12'} hasBin: true dependencies: '@bcoe/v8-coverage': 0.2.3 @@ -592,7 +675,7 @@ packages: resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} dependencies: function-bind: 1.1.1 - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 dev: true /callsites@3.1.0: @@ -600,8 +683,8 @@ packages: engines: {node: '>=6'} dev: true - /caniuse-lite@1.0.30001470: - resolution: {integrity: sha512-065uNwY6QtHCBOExzbV6m236DDhYCCtPmQUCoQtwkVqzud8v5QPidoMr6CoMkC2nfp6nksjttqWQRRh75LqUmA==} + /caniuse-lite@1.0.30001513: + resolution: {integrity: sha512-pnjGJo7SOOjAGytZZ203Em95MRM8Cr6jhCXNF/FAXTpCTRTECnqQWLpiTRqrFtdYcth8hf4WECUpkezuYsMVww==} dev: false /chalk@4.1.2: @@ -627,13 +710,13 @@ packages: fsevents: 2.3.2 dev: true - /clean-publish@4.1.1: - resolution: {integrity: sha512-111O3MNk6x/dAbHZwG+iRZ4AYwpKqc7Qp1MarFhE1KtQIp9m9TkDuI+hedn7qgeFnLgSw3ItgEnHNwvhc7SmGg==} + /clean-publish@4.2.0: + resolution: {integrity: sha512-dqZF5y6KtlkYhbnJoXiOCP4L1TPdI7HtuDysslUrbI8vLPu65ZjVO3pu5xp4qH0X2cWdDN/La04woe6fg4LNSw==} engines: {node: '>= 16.0.0'} hasBin: true dependencies: cross-spawn: 7.0.3 - fast-glob: 3.2.12 + fast-glob: 3.3.0 lilconfig: 2.1.0 micromatch: 4.0.5 dev: true @@ -740,8 +823,8 @@ packages: esutils: 2.0.3 dev: true - /electron-to-chromium@1.4.340: - resolution: {integrity: sha512-zx8hqumOqltKsv/MF50yvdAlPF9S/4PXbyfzJS6ZGhbddGkRegdwImmfSVqCkEziYzrIGZ/TlrzBND4FysfkDg==} + /electron-to-chromium@1.4.454: + resolution: {integrity: sha512-pmf1rbAStw8UEQ0sr2cdJtWl48ZMuPD9Sto8HVQOq9vx9j2WgDEN6lYoaqFvqEHYOmGA9oRGn7LqWI9ta0YugQ==} dev: false /emoji-regex@8.0.0: @@ -758,7 +841,7 @@ packages: es-set-tostringtag: 2.0.1 es-to-primitive: 1.2.1 function.prototype.name: 1.1.5 - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 get-symbol-description: 1.0.0 globalthis: 1.0.3 gopd: 1.0.1 @@ -778,7 +861,7 @@ packages: object-inspect: 1.12.3 object-keys: 1.1.1 object.assign: 4.1.4 - regexp.prototype.flags: 1.4.3 + regexp.prototype.flags: 1.5.0 safe-regex-test: 1.0.0 string.prototype.trim: 1.2.7 string.prototype.trimend: 1.0.6 @@ -792,7 +875,7 @@ packages: resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} engines: {node: '>= 0.4'} dependencies: - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 has: 1.0.3 has-tostringtag: 1.0.0 dev: true @@ -812,34 +895,34 @@ packages: is-symbol: 1.0.4 dev: true - /esbuild@0.17.14: - resolution: {integrity: sha512-vOO5XhmVj/1XQR9NQ1UPq6qvMYL7QFJU57J5fKBKBKxp17uDt5PgxFDb4A2nEiXhr1qQs4x0F5+66hVVw4ruNw==} + /esbuild@0.18.11: + resolution: {integrity: sha512-i8u6mQF0JKJUlGR3OdFLKldJQMMs8OqM9Cc3UCi9XXziJ9WERM5bfkHaEAy0YAvPRMgqSW55W7xYn84XtEFTtA==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.17.14 - '@esbuild/android-arm64': 0.17.14 - '@esbuild/android-x64': 0.17.14 - '@esbuild/darwin-arm64': 0.17.14 - '@esbuild/darwin-x64': 0.17.14 - '@esbuild/freebsd-arm64': 0.17.14 - '@esbuild/freebsd-x64': 0.17.14 - '@esbuild/linux-arm': 0.17.14 - '@esbuild/linux-arm64': 0.17.14 - '@esbuild/linux-ia32': 0.17.14 - '@esbuild/linux-loong64': 0.17.14 - '@esbuild/linux-mips64el': 0.17.14 - '@esbuild/linux-ppc64': 0.17.14 - '@esbuild/linux-riscv64': 0.17.14 - '@esbuild/linux-s390x': 0.17.14 - '@esbuild/linux-x64': 0.17.14 - '@esbuild/netbsd-x64': 0.17.14 - '@esbuild/openbsd-x64': 0.17.14 - '@esbuild/sunos-x64': 0.17.14 - '@esbuild/win32-arm64': 0.17.14 - '@esbuild/win32-ia32': 0.17.14 - '@esbuild/win32-x64': 0.17.14 + '@esbuild/android-arm': 0.18.11 + '@esbuild/android-arm64': 0.18.11 + '@esbuild/android-x64': 0.18.11 + '@esbuild/darwin-arm64': 0.18.11 + '@esbuild/darwin-x64': 0.18.11 + '@esbuild/freebsd-arm64': 0.18.11 + '@esbuild/freebsd-x64': 0.18.11 + '@esbuild/linux-arm': 0.18.11 + '@esbuild/linux-arm64': 0.18.11 + '@esbuild/linux-ia32': 0.18.11 + '@esbuild/linux-loong64': 0.18.11 + '@esbuild/linux-mips64el': 0.18.11 + '@esbuild/linux-ppc64': 0.18.11 + '@esbuild/linux-riscv64': 0.18.11 + '@esbuild/linux-s390x': 0.18.11 + '@esbuild/linux-x64': 0.18.11 + '@esbuild/netbsd-x64': 0.18.11 + '@esbuild/openbsd-x64': 0.18.11 + '@esbuild/sunos-x64': 0.18.11 + '@esbuild/win32-arm64': 0.18.11 + '@esbuild/win32-ia32': 0.18.11 + '@esbuild/win32-x64': 0.18.11 dev: true /escalade@3.1.1: @@ -851,32 +934,33 @@ packages: engines: {node: '>=10'} dev: true - /eslint-config-standard@17.0.0(eslint-plugin-import@2.27.5)(eslint-plugin-n@15.6.1)(eslint-plugin-promise@6.1.1)(eslint@8.36.0): - resolution: {integrity: sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg==} + /eslint-config-standard@17.1.0(eslint-plugin-import@2.27.5)(eslint-plugin-n@16.0.1)(eslint-plugin-promise@6.1.1)(eslint@8.44.0): + resolution: {integrity: sha512-IwHwmaBNtDK4zDHQukFDW5u/aTb8+meQWZvNFWkiGmbWjD6bqyuSSBxxXKkCftCUzc1zwCH2m/baCNDLGmuO5Q==} + engines: {node: '>=12.0.0'} peerDependencies: eslint: ^8.0.1 eslint-plugin-import: ^2.25.2 - eslint-plugin-n: ^15.0.0 + eslint-plugin-n: '^15.0.0 || ^16.0.0 ' eslint-plugin-promise: ^6.0.0 dependencies: - eslint: 8.36.0 - eslint-plugin-import: 2.27.5(eslint@8.36.0) - eslint-plugin-n: 15.6.1(eslint@8.36.0) - eslint-plugin-promise: 6.1.1(eslint@8.36.0) + eslint: 8.44.0 + eslint-plugin-import: 2.27.5(eslint@8.44.0) + eslint-plugin-n: 16.0.1(eslint@8.44.0) + eslint-plugin-promise: 6.1.1(eslint@8.44.0) dev: true /eslint-import-resolver-node@0.3.7: resolution: {integrity: sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==} dependencies: debug: 3.2.7 - is-core-module: 2.11.0 - resolve: 1.22.1 + is-core-module: 2.12.1 + resolve: 1.22.2 transitivePeerDependencies: - supports-color dev: true - /eslint-module-utils@2.7.4(eslint-import-resolver-node@0.3.7)(eslint@8.36.0): - resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} + /eslint-module-utils@2.8.0(eslint-import-resolver-node@0.3.7)(eslint@8.44.0): + resolution: {integrity: sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' @@ -897,24 +981,24 @@ packages: optional: true dependencies: debug: 3.2.7 - eslint: 8.36.0 + eslint: 8.44.0 eslint-import-resolver-node: 0.3.7 transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-es@4.1.0(eslint@8.36.0): - resolution: {integrity: sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==} - engines: {node: '>=8.10.0'} + /eslint-plugin-es-x@7.1.0(eslint@8.44.0): + resolution: {integrity: sha512-AhiaF31syh4CCQ+C5ccJA0VG6+kJK8+5mXKKE7Qs1xcPRg02CDPOj3mWlQxuWS/AYtg7kxrDNgW9YW3vc0Q+Mw==} + engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - eslint: '>=4.19.1' + eslint: '>=8' dependencies: - eslint: 8.36.0 - eslint-utils: 2.1.0 - regexpp: 3.2.0 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.44.0) + '@eslint-community/regexpp': 4.5.1 + eslint: 8.44.0 dev: true - /eslint-plugin-import@2.27.5(eslint@8.36.0): + /eslint-plugin-import@2.27.5(eslint@8.44.0): resolution: {integrity: sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==} engines: {node: '>=4'} peerDependencies: @@ -929,15 +1013,15 @@ packages: array.prototype.flatmap: 1.3.1 debug: 3.2.7 doctrine: 2.1.0 - eslint: 8.36.0 + eslint: 8.44.0 eslint-import-resolver-node: 0.3.7 - eslint-module-utils: 2.7.4(eslint-import-resolver-node@0.3.7)(eslint@8.36.0) + eslint-module-utils: 2.8.0(eslint-import-resolver-node@0.3.7)(eslint@8.44.0) has: 1.0.3 - is-core-module: 2.11.0 + is-core-module: 2.12.1 is-glob: 4.0.3 minimatch: 3.1.2 object.values: 1.1.6 - resolve: 1.22.1 + resolve: 1.22.2 semver: 6.3.0 tsconfig-paths: 3.14.2 transitivePeerDependencies: @@ -946,21 +1030,38 @@ packages: - supports-color dev: true - /eslint-plugin-n@15.6.1(eslint@8.36.0): - resolution: {integrity: sha512-R9xw9OtCRxxaxaszTQmQAlPgM+RdGjaL1akWuY/Fv9fRAi8Wj4CUKc6iYVG8QNRjRuo8/BqVYIpfqberJUEacA==} - engines: {node: '>=12.22.0'} + /eslint-plugin-n@16.0.1(eslint@8.44.0): + resolution: {integrity: sha512-CDmHegJN0OF3L5cz5tATH84RPQm9kG+Yx39wIqIwPR2C0uhBGMWfbbOtetR83PQjjidA5aXMu+LEFw1jaSwvTA==} + engines: {node: '>=16.0.0'} peerDependencies: eslint: '>=7.0.0' dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.44.0) builtins: 5.0.1 - eslint: 8.36.0 - eslint-plugin-es: 4.1.0(eslint@8.36.0) - eslint-utils: 3.0.0(eslint@8.36.0) + eslint: 8.44.0 + eslint-plugin-es-x: 7.1.0(eslint@8.44.0) ignore: 5.2.4 - is-core-module: 2.11.0 + is-core-module: 2.12.1 minimatch: 3.1.2 - resolve: 1.22.1 - semver: 7.3.8 + resolve: 1.22.2 + semver: 7.5.4 + dev: true + + /eslint-plugin-perfectionist@1.4.0(eslint@8.44.0)(typescript@5.1.6): + resolution: {integrity: sha512-9gO+qmuU1DYzoYeN2D0PqYrI1FlqMPYGsZTWUWnWPrMQdFGFtq7eYraeQ57/8ffNBbVX6e6HvQOJ9iok9DfJvw==} + peerDependencies: + eslint: '>=8.0.0' + dependencies: + '@typescript-eslint/types': 5.61.0 + '@typescript-eslint/utils': 5.61.0(eslint@8.44.0)(typescript@5.1.6) + eslint: 8.44.0 + is-core-module: 2.12.1 + json5: 2.2.3 + minimatch: 9.0.3 + natural-compare-lite: 1.4.0 + transitivePeerDependencies: + - supports-color + - typescript dev: true /eslint-plugin-prefer-let@3.0.1: @@ -970,65 +1071,46 @@ packages: requireindex: 1.2.0 dev: true - /eslint-plugin-promise@6.1.1(eslint@8.36.0): + /eslint-plugin-promise@6.1.1(eslint@8.44.0): resolution: {integrity: sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 dependencies: - eslint: 8.36.0 + eslint: 8.44.0 dev: true - /eslint-scope@7.1.1: - resolution: {integrity: sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /eslint-scope@5.1.1: + resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} + engines: {node: '>=8.0.0'} dependencies: esrecurse: 4.3.0 - estraverse: 5.3.0 + estraverse: 4.3.0 dev: true - /eslint-utils@2.1.0: - resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} - engines: {node: '>=6'} - dependencies: - eslint-visitor-keys: 1.3.0 - dev: true - - /eslint-utils@3.0.0(eslint@8.36.0): - resolution: {integrity: sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==} - engines: {node: ^10.0.0 || ^12.0.0 || >= 14.0.0} - peerDependencies: - eslint: '>=5' + /eslint-scope@7.2.0: + resolution: {integrity: sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - eslint: 8.36.0 - eslint-visitor-keys: 2.1.0 - dev: true - - /eslint-visitor-keys@1.3.0: - resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} - engines: {node: '>=4'} - dev: true - - /eslint-visitor-keys@2.1.0: - resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} - engines: {node: '>=10'} + esrecurse: 4.3.0 + estraverse: 5.3.0 dev: true - /eslint-visitor-keys@3.3.0: - resolution: {integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==} + /eslint-visitor-keys@3.4.1: + resolution: {integrity: sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /eslint@8.36.0: - resolution: {integrity: sha512-Y956lmS7vDqomxlaaQAHVmeb4tNMp2FWIvU/RnU5BD3IKMD/MJPr76xdyr68P8tV1iNMvN2mRK0yy3c+UjL+bw==} + /eslint@8.44.0: + resolution: {integrity: sha512-0wpHoUbDUHgNCyvFB5aXLiQVfK9B0at6gUvzy83k4kAsQ/u769TQDX6iKC+aO4upIHO9WSaA3QoXYQDHbNwf1A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} hasBin: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.36.0) - '@eslint-community/regexpp': 4.4.1 - '@eslint/eslintrc': 2.0.1 - '@eslint/js': 8.36.0 - '@humanwhocodes/config-array': 0.11.8 + '@eslint-community/eslint-utils': 4.4.0(eslint@8.44.0) + '@eslint-community/regexpp': 4.5.1 + '@eslint/eslintrc': 2.1.0 + '@eslint/js': 8.44.0 + '@humanwhocodes/config-array': 0.11.10 '@humanwhocodes/module-importer': 1.0.1 '@nodelib/fs.walk': 1.2.8 ajv: 6.12.6 @@ -1037,9 +1119,9 @@ packages: debug: 4.3.4 doctrine: 3.0.0 escape-string-regexp: 4.0.0 - eslint-scope: 7.1.1 - eslint-visitor-keys: 3.3.0 - espree: 9.5.0 + eslint-scope: 7.2.0 + eslint-visitor-keys: 3.4.1 + espree: 9.6.0 esquery: 1.5.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 @@ -1047,20 +1129,19 @@ packages: find-up: 5.0.0 glob-parent: 6.0.2 globals: 13.20.0 - grapheme-splitter: 1.0.4 + graphemer: 1.4.0 ignore: 5.2.4 import-fresh: 3.3.0 imurmurhash: 0.1.4 is-glob: 4.0.3 is-path-inside: 3.0.3 - js-sdsl: 4.4.0 js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 levn: 0.4.1 lodash.merge: 4.6.2 minimatch: 3.1.2 natural-compare: 1.4.0 - optionator: 0.9.1 + optionator: 0.9.3 strip-ansi: 6.0.1 strip-json-comments: 3.1.1 text-table: 0.2.0 @@ -1068,13 +1149,13 @@ packages: - supports-color dev: true - /espree@9.5.0: - resolution: {integrity: sha512-JPbJGhKc47++oo4JkEoTe2wjy4fmMwvFpgJT9cQzmfXKp22Dr6Hf1tdCteLz1h0P3t+mGvWZ+4Uankvh8+c6zw==} + /espree@9.6.0: + resolution: {integrity: sha512-1FH/IiruXZ84tpUlm0aCUEwMl2Ho5ilqVh0VvQXw+byAz/4SAciyHLlfmL5WYqsvD38oymdUwBss0LtK8m4s/A==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.8.2 - acorn-jsx: 5.3.2(acorn@8.8.2) - eslint-visitor-keys: 3.3.0 + acorn: 8.10.0 + acorn-jsx: 5.3.2(acorn@8.10.0) + eslint-visitor-keys: 3.4.1 dev: true /esquery@1.5.0: @@ -1091,6 +1172,11 @@ packages: estraverse: 5.3.0 dev: true + /estraverse@4.3.0: + resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} + engines: {node: '>=4.0'} + dev: true + /estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} @@ -1105,8 +1191,8 @@ packages: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true - /fast-glob@3.2.12: - resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} + /fast-glob@3.3.0: + resolution: {integrity: sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==} engines: {node: '>=8.6.0'} dependencies: '@nodelib/fs.stat': 2.0.5 @@ -1217,11 +1303,12 @@ packages: engines: {node: 6.* || 8.* || >= 10.*} dev: true - /get-intrinsic@1.2.0: - resolution: {integrity: sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==} + /get-intrinsic@1.2.1: + resolution: {integrity: sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==} dependencies: function-bind: 1.1.1 has: 1.0.3 + has-proto: 1.0.1 has-symbols: 1.0.3 dev: true @@ -1230,7 +1317,7 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 dev: true /glob-parent@5.1.2: @@ -1278,7 +1365,7 @@ packages: dependencies: array-union: 2.1.0 dir-glob: 3.0.1 - fast-glob: 3.2.12 + fast-glob: 3.3.0 ignore: 5.2.4 merge2: 1.4.1 slash: 3.0.0 @@ -1287,11 +1374,11 @@ packages: /gopd@1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} dependencies: - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 dev: true - /grapheme-splitter@1.0.4: - resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + /graphemer@1.4.0: + resolution: {integrity: sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==} dev: true /has-bigints@1.0.2: @@ -1306,7 +1393,7 @@ packages: /has-property-descriptors@1.0.0: resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} dependencies: - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 dev: true /has-proto@1.0.1: @@ -1370,7 +1457,7 @@ packages: resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==} engines: {node: '>= 0.4'} dependencies: - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 has: 1.0.3 side-channel: 1.0.4 dev: true @@ -1379,7 +1466,7 @@ packages: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} dependencies: call-bind: 1.0.2 - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 is-typed-array: 1.1.10 dev: true @@ -1409,8 +1496,8 @@ packages: engines: {node: '>= 0.4'} dev: true - /is-core-module@2.11.0: - resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} + /is-core-module@2.12.1: + resolution: {integrity: sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==} dependencies: has: 1.0.3 dev: true @@ -1532,10 +1619,6 @@ packages: istanbul-lib-report: 3.0.0 dev: true - /js-sdsl@4.4.0: - resolution: {integrity: sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==} - dev: true - /js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true @@ -1558,6 +1641,12 @@ packages: minimist: 1.2.8 dev: true + /json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + dev: true + /kleur@4.1.5: resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} engines: {node: '>=6'} @@ -1620,6 +1709,13 @@ packages: brace-expansion: 1.1.11 dev: true + /minimatch@9.0.3: + resolution: {integrity: sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} dev: true @@ -1637,8 +1733,8 @@ packages: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} dev: true - /nanoid@3.3.4: - resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==} + /nanoid@3.3.6: + resolution: {integrity: sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true dev: true @@ -1649,17 +1745,21 @@ packages: picocolors: 1.0.0 dev: true - /nanospy@0.5.0: - resolution: {integrity: sha512-QxH93ntkjRiSP+gJrBLcgOO3neU6pGhUKjPAJ7rAFag/+tJ+/0lw6dXic+iXUQ/3Cxk4Dp/FwLnf57xnQsjecQ==} - engines: {node: ^8.0.0 || ^10.0.0 || ^12.0.0 || ^14.0.0 || >=16.0.0} + /nanospy@1.0.0: + resolution: {integrity: sha512-wvmmALNstRRhLhy7RV11NCRY2k1zxstImiju4VyyKNNRIKDVjyBtmEd/Q4G82/3dN4VSTe+0PRR3DUAASSbEEQ==} + engines: {node: ^8.0.0 || ^10.0.0 || ^12.0.0 || ^14.0.0 || ^16.0.0 || ^18.0.0 || >=20.0.0} + dev: true + + /natural-compare-lite@1.4.0: + resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} dev: true /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true - /node-releases@2.0.10: - resolution: {integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==} + /node-releases@2.0.13: + resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} dev: false /normalize-path@3.0.0: @@ -1706,16 +1806,16 @@ packages: wrappy: 1.0.2 dev: true - /optionator@0.9.1: - resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} + /optionator@0.9.3: + resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} engines: {node: '>= 0.8.0'} dependencies: + '@aashutoshrathi/word-wrap': 1.2.6 deep-is: 0.1.4 fast-levenshtein: 2.0.6 levn: 0.4.1 prelude-ls: 1.2.1 type-check: 0.4.0 - word-wrap: 1.2.3 dev: true /p-limit@3.1.0: @@ -1775,11 +1875,11 @@ packages: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} dev: false - /postcss@8.4.21: - resolution: {integrity: sha512-tP7u/Sn/dVxK2NnruI4H9BG+x+Wxz6oeZ1cJ8P6G/PZY0IKk4k/63TDsQf2kQq3+qoJeLm2kIBUNlZe3zgb4Zg==} + /postcss@8.4.25: + resolution: {integrity: sha512-7taJ/8t2av0Z+sQEvNzCkpDynl0tX3uJMCODi6nT3PfASC7dYCWV9aQ+uiCf+KBD4SEFcu+GvJdGdwzQ6OSjCw==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanoid: 3.3.4 + nanoid: 3.3.6 picocolors: 1.0.0 source-map-js: 1.0.2 dev: true @@ -1805,8 +1905,8 @@ packages: picomatch: 2.3.1 dev: true - /regexp.prototype.flags@1.4.3: - resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==} + /regexp.prototype.flags@1.5.0: + resolution: {integrity: sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 @@ -1814,11 +1914,6 @@ packages: functions-have-names: 1.2.3 dev: true - /regexpp@3.2.0: - resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} - engines: {node: '>=8'} - dev: true - /require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} @@ -1834,11 +1929,11 @@ packages: engines: {node: '>=4'} dev: true - /resolve@1.22.1: - resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} + /resolve@1.22.2: + resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} hasBin: true dependencies: - is-core-module: 2.11.0 + is-core-module: 2.12.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 dev: true @@ -1872,7 +1967,7 @@ packages: resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} dependencies: call-bind: 1.0.2 - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 is-regex: 1.1.4 dev: true @@ -1881,8 +1976,16 @@ packages: hasBin: true dev: true - /semver@7.3.8: - resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} + /semver@7.5.3: + resolution: {integrity: sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: true + + /semver@7.5.4: + resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} engines: {node: '>=10'} hasBin: true dependencies: @@ -1905,7 +2008,7 @@ packages: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} dependencies: call-bind: 1.0.2 - get-intrinsic: 1.2.0 + get-intrinsic: 1.2.1 object-inspect: 1.12.3 dev: true @@ -1913,8 +2016,8 @@ packages: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} dev: true - /size-limit@8.2.4: - resolution: {integrity: sha512-Un16nSreD1v2CYwSorattiJcHuAWqXvg4TsGgzpjnoByqQwsSfCIEQHuaD14HNStzredR8cdsO9oGH91ibypTA==} + /size-limit@8.2.6: + resolution: {integrity: sha512-zpznim/tX/NegjoQuRKgWTF4XiB0cn2qt90uJzxYNTFAqexk4b94DOAkBD3TwhC6c3kw2r0KcnA5upziVMZqDg==} engines: {node: ^14.0.0 || ^16.0.0 || >=18.0.0} hasBin: true dependencies: @@ -2028,6 +2131,20 @@ packages: strip-bom: 3.0.0 dev: true + /tslib@1.14.1: + resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + dev: true + + /tsutils@3.21.0(typescript@5.1.6): + resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} + engines: {node: '>= 6'} + peerDependencies: + typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + dependencies: + tslib: 1.14.1 + typescript: 5.1.6 + dev: true + /type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} @@ -2048,6 +2165,12 @@ packages: is-typed-array: 1.1.10 dev: true + /typescript@5.1.6: + resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} + engines: {node: '>=14.17'} + hasBin: true + dev: true + /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} dependencies: @@ -2057,13 +2180,13 @@ packages: which-boxed-primitive: 1.0.2 dev: true - /update-browserslist-db@1.0.10(browserslist@4.21.5): - resolution: {integrity: sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==} + /update-browserslist-db@1.0.11(browserslist@4.21.9): + resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: - browserslist: 4.21.5 + browserslist: 4.21.9 escalade: 3.1.1 picocolors: 1.0.0 dev: false @@ -2089,7 +2212,7 @@ packages: resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==} engines: {node: '>=10.12.0'} dependencies: - '@jridgewell/trace-mapping': 0.3.17 + '@jridgewell/trace-mapping': 0.3.18 '@types/istanbul-lib-coverage': 2.0.4 convert-source-map: 1.9.0 dev: true @@ -2124,11 +2247,6 @@ packages: isexe: 2.0.0 dev: true - /word-wrap@1.2.3: - resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} - engines: {node: '>=0.10.0'} - dev: true - /wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} diff --git a/test/autoprefixer.test.js b/test/autoprefixer.test.js index 945757bd1..d164f9dfa 100644 --- a/test/autoprefixer.test.js +++ b/test/autoprefixer.test.js @@ -1,4 +1,4 @@ -let { equal, throws, type, match, not } = require('uvu/assert') +let { equal, match, not, throws, type } = require('uvu/assert') let { restoreAll, spyOn } = require('nanospy') let { readFileSync } = require('fs') let { join } = require('path') @@ -8,9 +8,9 @@ let postcss = require('postcss') let autoprefixer = require('..') let grider = autoprefixer({ - overrideBrowserslist: ['Chrome 25', 'Edge 12', 'IE 10'], cascade: false, - grid: 'autoplace' + grid: 'autoplace', + overrideBrowserslist: ['Chrome 25', 'Edge 12', 'IE 10'] }) let cleaner = autoprefixer({ @@ -26,8 +26,8 @@ let borderer = autoprefixer({ overrideBrowserslist: ['Safari 4', 'Firefox 3.6'] }) let cascader = autoprefixer({ - overrideBrowserslist: ['Chrome > 19', 'Firefox 21', 'IE 10'], - cascade: true + cascade: true, + overrideBrowserslist: ['Chrome > 19', 'Firefox 21', 'IE 10'] }) let keyframer = autoprefixer({ overrideBrowserslist: ['Chrome > 19', 'Opera 12'] @@ -48,8 +48,8 @@ let gradienter = autoprefixer({ overrideBrowserslist: ['Chrome 25', 'Opera 12', 'Android 2.3'] }) let grouping = autoprefixer({ - overrideBrowserslist: ['Chrome 25', 'Firefox > 17', 'IE 10', 'Edge 12'], - grid: 'autoplace' + grid: 'autoplace', + overrideBrowserslist: ['Chrome 25', 'Firefox > 17', 'IE 10', 'Edge 12'] }) let ffgradienter = autoprefixer({ overrideBrowserslist: ['Chrome 25', 'Opera 12', 'Firefox 6'] @@ -532,8 +532,8 @@ test('does not remove unnecessary prefixes on request', () => { test('does not add prefixes on request', () => { for (let i of ['transition', 'values', 'fullscreen']) { let remover = autoprefixer({ - overrideBrowserslist: ['Opera 12'], - add: false + add: false, + overrideBrowserslist: ['Opera 12'] }) let unprefixed = read(i) equal(postcss([remover]).process(unprefixed).css, unprefixed) @@ -633,8 +633,8 @@ test('has disabled grid options by default', () => { test('has different outputs for different grid options', () => { function ap(gridValue) { return autoprefixer({ - overrideBrowserslist: ['Edge 12', 'IE 10'], - grid: gridValue + grid: gridValue, + overrideBrowserslist: ['Edge 12', 'IE 10'] }) } let input = read('grid-options') @@ -676,8 +676,8 @@ test('has different outputs for different grid environment variables', () => { test('has option to disable flexbox support', () => { let css = read('flexbox') let instance = autoprefixer({ - overrideBrowserslist: ['IE 10'], - flexbox: false + flexbox: false, + overrideBrowserslist: ['IE 10'] }) let result = postcss([instance]).process(css) equal(result.css, css) @@ -685,8 +685,8 @@ test('has option to disable flexbox support', () => { test('has option to disable 2009 flexbox support', () => { let ap = autoprefixer({ - overrideBrowserslist: ['Chrome > 19'], - flexbox: 'no-2009' + flexbox: 'no-2009', + overrideBrowserslist: ['Chrome > 19'] }) let css = 'a{flex:1;transition:flex}' let result = postcss([ap]).process(css) @@ -718,8 +718,8 @@ test('ignores unknown versions on request', () => { }, /Unknown version 100 of ie/) not.throws(() => { autoprefixer({ - overrideBrowserslist: ['ie 100'], - ignoreUnknownVersions: true + ignoreUnknownVersions: true, + overrideBrowserslist: ['ie 100'] }).info() }) }) @@ -1045,8 +1045,8 @@ test('supports grid autoplacement', () => { test('shows Grid warnings only for IE', () => { let input = 'a { grid-template-rows: repeat(auto-fit, 1px) }' let instance = autoprefixer({ - overrideBrowserslist: 'chrome 27', - grid: true + grid: true, + overrideBrowserslist: 'chrome 27' }) let result = postcss([instance]).process(input) equal(result.warnings().length, 0) @@ -1130,8 +1130,8 @@ test('add prefix for backface-visibility for Safari 9', () => { let input = 'a{ ' + 'backface-visibility: hidden; ' + 'transform-style: preserve-3d }' let ap = autoprefixer({ - overrideBrowserslist: ['Safari 9'], - flexbox: false + flexbox: false, + overrideBrowserslist: ['Safari 9'] }) equal( postcss([ap]).process(input).css, diff --git a/test/info.test.js b/test/info.test.js index f31e4e08d..e5106bcd4 100644 --- a/test/info.test.js +++ b/test/info.test.js @@ -10,18 +10,21 @@ let info = require('../lib/info') let data = { browsers: agents, prefixes: { + '@keyframes': { + browsers: ['firefox 21'] + }, 'a': { browsers: ['firefox 21', 'firefox 20', 'chrome 30'], transition: true }, - 'c': { - browsers: ['firefox 21'], - props: ['c'] - }, 'b': { browsers: ['ie 6', 'firefox 20'], props: ['a', '*'] }, + 'c': { + browsers: ['firefox 21'], + props: ['c'] + }, 'd': { browsers: ['firefox 21'], selector: true @@ -33,9 +36,6 @@ let data = { 'grid-row': { browsers: ['ie 6'] }, - '@keyframes': { - browsers: ['firefox 21'] - }, 'transition': { browsers: ['firefox 21'] } diff --git a/test/postcss.test.js b/test/postcss.test.js index a0172a644..cafc88765 100644 --- a/test/postcss.test.js +++ b/test/postcss.test.js @@ -7,16 +7,16 @@ let autoprefixer = require('..') test('works with other PostCSS plugins', () => { let plugin = () => { return { - postcssPlugin: 'test', - Rule(rule) { - rule.selector = 'b' - }, AtRule: { mixin: (atRule, { Declaration }) => { atRule.replaceWith( new Declaration({ prop: 'user-select', value: 'none' }) ) } + }, + postcssPlugin: 'test', + Rule(rule) { + rule.selector = 'b' } } } diff --git a/test/prefixer.test.js b/test/prefixer.test.js index 835784e18..13a7675d3 100644 --- a/test/prefixer.test.js +++ b/test/prefixer.test.js @@ -1,4 +1,4 @@ -let { equal, type, is } = require('uvu/assert') +let { equal, is, type } = require('uvu/assert') let { parse } = require('postcss') let { test } = require('uvu') diff --git a/test/prefixes.test.js b/test/prefixes.test.js index 35b81d90f..08c7d3317 100644 --- a/test/prefixes.test.js +++ b/test/prefixes.test.js @@ -62,36 +62,38 @@ test('selects necessary prefixes', () => { test('preprocesses prefixes add data', () => { equal(fill.add, { - 'selectors': [cSel], - 'a': aProp, + '@supports': new Supports(Prefixes, fill), '*': { values: [bVal] }, - '@supports': new Supports(Prefixes, fill) + 'a': aProp, + 'selectors': [cSel] }) }) test('preprocesses prefixes remove data', () => { equal( - JSON.stringify(fill.remove), - JSON.stringify({ - 'selectors': [cSel.old('-moz-')], - '-webkit-a': { - remove: true - }, - '-ms-a': { - remove: true - }, - '-moz- olda': { - remove: true - }, - 'a': { - values: [old('-ms-b'), old('-moz-b'), old('-webkit-b')] - }, - '*': { - values: [old('-ms-b'), old('-moz-b'), old('-webkit-b')] - } - }) + JSON.parse(JSON.stringify(fill.remove)), + JSON.parse( + JSON.stringify({ + '-moz- olda': { + remove: true + }, + '-ms-a': { + remove: true + }, + '-webkit-a': { + remove: true + }, + '*': { + values: [old('-ms-b'), old('-moz-b'), old('-webkit-b')] + }, + 'a': { + values: [old('-ms-b'), old('-moz-b'), old('-webkit-b')] + }, + 'selectors': [cSel.old('-moz-')] + }) + ) ) }) diff --git a/test/selector.test.js b/test/selector.test.js index 7fe3ab1b6..20179e3de 100644 --- a/test/selector.test.js +++ b/test/selector.test.js @@ -42,16 +42,16 @@ test('grouping rule gets correct _autoprefixerPrefixeds property', () => { rSel.prefixeds(css.first) equal(css.first._autoprefixerPrefixeds, { '::selection': { - '-webkit-': '.c::-webkit-selection', '-moz-': '.c::-moz-selection', '-ms-': '.c::-ms-selection', - '-o-': '.c::-o-selection' + '-o-': '.c::-o-selection', + '-webkit-': '.c::-webkit-selection' }, ':read-only': { - '-webkit-': '.d:-webkit-read-only', '-moz-': '.d:-moz-read-only', '-ms-': '.d:-ms-read-only', - '-o-': '.d:-o-read-only' + '-o-': '.d:-o-read-only', + '-webkit-': '.d:-webkit-read-only' } }) }) @@ -60,10 +60,10 @@ test('returns all available prefixed selectors', () => { let css = parse('::selection {}') equal(selector.prefixeds(css.first), { '::selection': { - '-webkit-': '::-webkit-selection', '-moz-': '::-moz-selection', '-ms-': '::-ms-selection', - '-o-': '::-o-selection' + '-o-': '::-o-selection', + '-webkit-': '::-webkit-selection' } }) })