diff --git a/packages/critters/package.json b/packages/critters/package.json index cfeb6e5..fe68f4c 100644 --- a/packages/critters/package.json +++ b/packages/critters/package.json @@ -52,8 +52,7 @@ "domhandler": "^5.0.2", "htmlparser2": "^8.0.2", "postcss": "^8.4.23", - "postcss-media-query-parser": "^0.2.3", - "pretty-bytes": "^5.3.0" + "postcss-media-query-parser": "^0.2.3" }, "devDependencies": { "documentation": "^13.0.2", diff --git a/packages/critters/src/css.js b/packages/critters/src/css.js index 48cf03c..8cdc1b2 100644 --- a/packages/critters/src/css.js +++ b/packages/critters/src/css.js @@ -199,33 +199,29 @@ function filterSelectors(predicate) { const MEDIA_TYPES = new Set(['all', 'print', 'screen', 'speech']); const MEDIA_KEYWORDS = new Set(['and', 'not', ',']); -const MEDIA_FEATURES = [ - 'width', - 'aspect-ratio', - 'color', - 'color-index', - 'grid', - 'height', - 'monochrome', - 'orientation', - 'resolution', - 'scan' -]; +const MEDIA_FEATURES = new Set( + [ + 'width', + 'aspect-ratio', + 'color', + 'color-index', + 'grid', + 'height', + 'monochrome', + 'orientation', + 'resolution', + 'scan' + ].flatMap((feature) => [feature, `min-${feature}`, `max-${feature}`]) +); + function validateMediaType(node) { const { type: nodeType, value: nodeValue } = node; - if (nodeType === 'media-type') { return MEDIA_TYPES.has(nodeValue); } else if (nodeType === 'keyword') { return MEDIA_KEYWORDS.has(nodeValue); } else if (nodeType === 'media-feature') { - return MEDIA_FEATURES.some((feature) => { - return ( - nodeValue === feature || - nodeValue === `min-${feature}` || - nodeValue === `max-${feature}` - ); - }); + return MEDIA_FEATURES.has(nodeValue); } } diff --git a/packages/critters/src/index.js b/packages/critters/src/index.js index 98b9a79..c48ca84 100644 --- a/packages/critters/src/index.js +++ b/packages/critters/src/index.js @@ -16,7 +16,6 @@ import path from 'path'; import { readFile } from 'fs'; -import prettyBytes from 'pretty-bytes'; import { createDocument, serializeDocument } from './dom'; import { parseStylesheet, @@ -241,7 +240,7 @@ export default class Critters { // path on disk (with output.publicPath removed) let normalizedPath = href.replace(/^\//, ''); const pathPrefix = (publicPath || '').replace(/(^\/|\/$)/g, '') + '/'; - if (normalizedPath.indexOf(pathPrefix) === 0) { + if (normalizedPath.startsWith(pathPrefix)) { normalizedPath = normalizedPath .substring(pathPrefix.length) .replace(/^\//, ''); @@ -325,7 +324,7 @@ export default class Critters { const preloadMode = this.options.preload; // skip filtered resources, or network resources if no filter is provided - if (this.urlFilter ? this.urlFilter(href) : !(href || '').match(/\.css$/)) { + if (this.urlFilter ? this.urlFilter(href) : !href?.endsWith('.css')) { return Promise.resolve(); } @@ -478,13 +477,18 @@ export default class Critters { const failedSelectors = []; - const criticalKeyframeNames = []; + const criticalKeyframeNames = new Set(); let includeNext = false; let includeAll = false; let excludeNext = false; let excludeAll = false; + const shouldPreloadFonts = + options.fonts === true || options.preloadFonts === true; + const shouldInlineFonts = + options.fonts !== false && options.inlineFonts === true; + // Walk all CSS rules, marking unused rules with `.$$remove=true` for removal in the second pass. // This first pass is also used to collect font and keyframe usage used in the second pass. walkStyleRules( @@ -553,9 +557,9 @@ export default class Critters { // This means any selector for a pseudo-element or having a pseudo-class will be inlined if the rest of the selector matches. if ( sel === ':root' || - sel.match(/^::?(before|after)$/) || sel === 'html' || - sel === 'body' + sel === 'body' || + /^::?(before|after)$/.test(sel) ) { return true; } @@ -582,21 +586,22 @@ export default class Critters { } if (rule.nodes) { - for (let i = 0; i < rule.nodes.length; i++) { - const decl = rule.nodes[i]; - + for (const decl of rule.nodes) { // detect used fonts - if (decl.prop && decl.prop.match(/\bfont(-family)?\b/i)) { + if ( + shouldInlineFonts && + decl.prop && + /\bfont(-family)?\b/i.test(decl.prop) + ) { criticalFonts += ' ' + decl.value; } // detect used keyframes if (decl.prop === 'animation' || decl.prop === 'animation-name') { - // @todo: parse animation declarations and extract only the name. for now we'll do a lazy match. - const names = decl.value.split(/\s+/); - for (let j = 0; j < names.length; j++) { - const name = names[j].trim(); - if (name) criticalKeyframeNames.push(name); + for (const name of decl.value.split(/\s+/)) { + // @todo: parse animation declarations and extract only the name. for now we'll do a lazy match. + const nameTrimmed = name.trim(); + if (nameTrimmed) criticalKeyframeNames.add(nameTrimmed); } } } @@ -607,7 +612,7 @@ export default class Critters { if (rule.type === 'atrule' && rule.name === 'font-face') return; // If there are no remaining rules, remove the whole rule: - const rules = rule.nodes && rule.nodes.filter((rule) => !rule.$$remove); + const rules = rule.nodes?.filter((rule) => !rule.$$remove); return !rules || rules.length !== 0; }) ); @@ -622,12 +627,7 @@ export default class Critters { ); } - const shouldPreloadFonts = - options.fonts === true || options.preloadFonts === true; - const shouldInlineFonts = - options.fonts !== false && options.inlineFonts === true; - - const preloadedFonts = []; + const preloadedFonts = new Set(); // Second pass, using data picked up from the first walkStyleRulesWithReverseMirror(ast, astInverse, (rule) => { // remove any rules marked in the first pass @@ -639,14 +639,13 @@ export default class Critters { if (rule.type === 'atrule' && rule.name === 'keyframes') { if (keyframesMode === 'none') return false; if (keyframesMode === 'all') return true; - return criticalKeyframeNames.indexOf(rule.params) !== -1; + return criticalKeyframeNames.has(rule.params); } // prune @font-face rules if (rule.type === 'atrule' && rule.name === 'font-face') { let family, src; - for (let i = 0; i < rule.nodes.length; i++) { - const decl = rule.nodes[i]; + for (const decl of rule.nodes) { if (decl.prop === 'src') { // @todo parse this properly and generate multiple preloads with type="font/woff2" etc src = (decl.value.match(/url\s*\(\s*(['"]?)(.+?)\1\s*\)/) || [])[2]; @@ -655,8 +654,8 @@ export default class Critters { } } - if (src && shouldPreloadFonts && preloadedFonts.indexOf(src) === -1) { - preloadedFonts.push(src); + if (src && shouldPreloadFonts && !preloadedFonts.has(src)) { + preloadedFonts.add(src); const preload = document.createElement('link'); preload.setAttribute('rel', 'preload'); preload.setAttribute('as', 'font'); @@ -667,10 +666,10 @@ export default class Critters { // if we're missing info, if the font is unused, or if critical font inlining is disabled, remove the rule: if ( + !shouldInlineFonts || !family || !src || - criticalFonts.indexOf(family) === -1 || - !shouldInlineFonts + !criticalFonts.includes(family) ) { return false; } @@ -702,7 +701,7 @@ export default class Critters { const percent = (sheetInverse.length / before.length) * 100; afterText = `, reducing non-inlined size ${ percent | 0 - }% to ${prettyBytes(sheetInverse.length)}`; + }% to ${formatSize(sheetInverse.length)}`; } } @@ -715,11 +714,11 @@ export default class Critters { const percent = ((sheet.length / before.length) * 100) | 0; this.logger.info( '\u001b[32mInlined ' + - prettyBytes(sheet.length) + + formatSize(sheet.length) + ' (' + percent + '% of original ' + - prettyBytes(before.length) + + formatSize(before.length) + ') of ' + name + afterText + @@ -727,3 +726,17 @@ export default class Critters { ); } } + +function formatSize(size) { + if (size <= 0) { + return '0 bytes'; + } + + const abbreviations = ['bytes', 'kB', 'MB', 'GB']; + const index = Math.floor(Math.log(size) / Math.log(1024)); + const roundedSize = size / Math.pow(1024, index); + // bytes don't have a fraction + const fractionDigits = index === 0 ? 0 : 2; + + return `${roundedSize.toFixed(fractionDigits)} ${abbreviations[index]}`; +} diff --git a/yarn.lock b/yarn.lock index 3d52c64..6f17f3a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1526,9 +1526,9 @@ integrity sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag== "@types/node@*": - version "20.11.20" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.20.tgz#f0a2aee575215149a62784210ad88b3a34843659" - integrity sha512-7/rR21OS+fq8IyHTgtLkDK949uzsa6n8BkziAKtPVpugIkO6D+/ooXMvzXxDnZrmtXVfjb1bKQafYpb8s89LOg== + version "20.11.19" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.19.tgz#b466de054e9cb5b3831bee38938de64ac7f81195" + integrity sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ== dependencies: undici-types "~5.26.4" @@ -2204,12 +2204,10 @@ autoprefixer@^9.8.0: postcss "^7.0.32" postcss-value-parser "^4.1.0" -available-typed-arrays@^1.0.6, available-typed-arrays@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" - integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ== - dependencies: - possible-typed-array-names "^1.0.0" +available-typed-arrays@^1.0.5, available-typed-arrays@^1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.6.tgz#ac812d8ce5a6b976d738e1c45f08d0b00bc7d725" + integrity sha512-j1QzY8iPNPG4o4xmO3ptzpRxTciqD3MgEHtifP/YnJpIo58Xu+ne4BejlbkuaLfXn/nz6HFiw29bLpj2PNMdGg== babel-code-frame@^6.26.0: version "6.26.0" @@ -2818,9 +2816,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001587: - version "1.0.30001589" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001589.tgz#7ad6dba4c9bf6561aec8291976402339dc157dfb" - integrity sha512-vNQWS6kI+q6sBlHbh71IIeC+sRwK2N3EDySc/updIGhIee2x5z00J4c1242/5/d6EpEMdOnk/m+6tuk4/tcsqg== + version "1.0.30001587" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001587.tgz#a0bce920155fa56a1885a69c74e1163fc34b4881" + integrity sha512-HMFNotUmLXn71BQxg8cijvqxnIAofforZOwGsxyXJ0qugTdspUF4sPSJ2vhgprHCB996tIDzEq1ubumPDV8ULA== capture-exit@^2.0.0: version "2.0.0" @@ -3798,7 +3796,7 @@ deepmerge@^4.2.2: resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== -define-data-property@^1.0.1, define-data-property@^1.1.2, define-data-property@^1.1.4: +define-data-property@^1.0.1, define-data-property@^1.1.2: version "1.1.4" resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== @@ -4123,9 +4121,9 @@ duplexify@^3.4.2, duplexify@^3.6.0: stream-shift "^1.0.0" electron-to-chromium@^1.4.668: - version "1.4.681" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.681.tgz#5f23fad8aa7e1f64cbb7dd9d15c7e39a1cd7e6e3" - integrity sha512-1PpuqJUFWoXZ1E54m8bsLPVYwIVCRzvaL+n5cjigGga4z854abDnFRc+cTa2th4S79kyGqya/1xoR7h+Y5G5lg== + version "1.4.672" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.672.tgz#f8ce803b43898b7e91dcfcf70d6fd656b11a645d" + integrity sha512-YYCy+goe3UqZqa3MOQCI5Mx/6HdBLzXL/mkbGCEWL3sP3Z1BP9zqAzeD3YEmLZlespYGFtyM8tRp5i2vfaUGCA== elliptic@^6.5.3, elliptic@^6.5.4: version "6.5.4" @@ -4280,13 +4278,13 @@ es-errors@^1.0.0, es-errors@^1.2.1, es-errors@^1.3.0: integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== es-set-tostringtag@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.3.tgz#8bb60f0a440c2e4281962428438d58545af39777" - integrity sha512-3T8uNMC3OQTHkFUsFq8r/BwAXLHvU/9O9mE0fBc/MY5iq/8H7ncvO947LmYA6ldWw9Uh8Yhf25zu6n7nML5QWQ== + version "2.0.2" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.2.tgz#11f7cc9f63376930a5f20be4915834f4bc74f9c9" + integrity sha512-BuDyupZt65P9D2D2vA/zqcI3G5xRsklm5N3xCwuiy+/vKy8i0ifdsQP1sLgO4tZDSCaQUSnmC48khknGMV3D2Q== dependencies: - get-intrinsic "^1.2.4" - has-tostringtag "^1.0.2" - hasown "^2.0.1" + get-intrinsic "^1.2.2" + has-tostringtag "^1.0.0" + hasown "^2.0.0" es-shim-unscopables@^1.0.0, es-shim-unscopables@^1.0.2: version "1.0.2" @@ -4839,9 +4837,9 @@ flat-cache@^3.0.4: rimraf "^3.0.2" flatted@^3.2.9: - version "3.3.1" - resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a" - integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw== + version "3.2.9" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf" + integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ== flush-write-stream@^1.0.0, flush-write-stream@^1.0.2: version "1.1.1" @@ -5264,17 +5262,17 @@ has-property-descriptors@^1.0.0, has-property-descriptors@^1.0.1, has-property-d dependencies: es-define-property "^1.0.0" -has-proto@^1.0.1, has-proto@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.3.tgz#b31ddfe9b0e6e9914536a6ab286426d0214f77fd" - integrity sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q== +has-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has-proto/-/has-proto-1.0.1.tgz#1885c1305538958aff469fef37937c22795408e0" + integrity sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg== has-symbols@^1.0.1, has-symbols@^1.0.2, has-symbols@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== -has-tostringtag@^1.0.0, has-tostringtag@^1.0.1, has-tostringtag@^1.0.2: +has-tostringtag@^1.0.0, has-tostringtag@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== @@ -5903,9 +5901,9 @@ is-negated-glob@^1.0.0: integrity sha512-czXVVn/QEmgvej1f50BZ648vUI+em0xqMq2Sn+QncCLN4zj1UAxlT+kw/6ggQTOaZPd1HqKQGEqbpQVtJucWug== is-negative-zero@^2.0.2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.3.tgz#ced903a027aca6381b777a5743069d7376a49747" - integrity sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw== + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== is-number-object@^1.0.4: version "1.0.7" @@ -5981,11 +5979,11 @@ is-resolvable@^1.0.0: integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg== is-shared-array-buffer@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.3.tgz#1237f1cba059cdb62431d378dcc37d9680181688" - integrity sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg== + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" + integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== dependencies: - call-bind "^1.0.7" + call-bind "^1.0.2" is-ssh@^1.3.0: version "1.4.0" @@ -6025,7 +6023,7 @@ is-text-path@^1.0.1: dependencies: text-extensions "^1.0.0" -is-typed-array@^1.1.13: +is-typed-array@^1.1.10, is-typed-array@^1.1.13, is-typed-array@^1.1.9: version "1.1.13" resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.13.tgz#d6c5ca56df62334959322d7d7dd1cca50debe229" integrity sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw== @@ -6150,9 +6148,9 @@ istanbul-lib-source-maps@^4.0.0: source-map "^0.6.1" istanbul-reports@^3.0.2: - version "3.1.7" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.7.tgz#daed12b9e1dca518e15c056e1e537e741280fa0b" - integrity sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g== + version "3.1.6" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.6.tgz#2544bcab4768154281a2f0870471902704ccaa1a" + integrity sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" @@ -8166,11 +8164,6 @@ posix-character-classes@^0.1.0: resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg== -possible-typed-array-names@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz#89bb63c6fada2c3e90adc4a647beeeb39cc7bf8f" - integrity sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q== - postcss-calc@^7.0.1: version "7.0.5" resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-7.0.5.tgz#f8a6e99f12e619c2ebc23cf6c486fdc15860933e" @@ -9461,14 +9454,13 @@ set-function-length@^1.2.1: has-property-descriptors "^1.0.1" set-function-name@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.2.tgz#16a705c5a0dc2f5e638ca96d8a8cd4e1c2b90985" - integrity sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ== + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-function-name/-/set-function-name-2.0.1.tgz#12ce38b7954310b9f61faa12701620a0c882793a" + integrity sha512-tMNCiqYVkXIZgc2Hnoy2IvC/f8ezc5koaRFkCjrpWzGpCd3qbZXPzVy9MAZzK1ch/X0jvSkojys3oqJN0qCmdA== dependencies: - define-data-property "^1.1.4" - es-errors "^1.3.0" + define-data-property "^1.0.1" functions-have-names "^1.2.3" - has-property-descriptors "^1.0.2" + has-property-descriptors "^1.0.0" set-value@^2.0.0, set-value@^2.0.1: version "2.0.1" @@ -10367,48 +10359,43 @@ type-fest@^0.8.1: integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== typed-array-buffer@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.2.tgz#1867c5d83b20fcb5ccf32649e5e2fc7424474ff3" - integrity sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ== + version "1.0.1" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.1.tgz#0608ffe6bca71bf15a45bff0ca2604107a1325f5" + integrity sha512-RSqu1UEuSlrBhHTWC8O9FnPjOduNs4M7rJ4pRKoEjtx1zUNOPN2sSXHLDX+Y2WPbHIxbvg4JFo2DNAEfPIKWoQ== dependencies: - call-bind "^1.0.7" + call-bind "^1.0.6" es-errors "^1.3.0" is-typed-array "^1.1.13" typed-array-byte-length@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.1.tgz#d92972d3cff99a3fa2e765a28fcdc0f1d89dec67" - integrity sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw== + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz#d787a24a995711611fb2b87a4052799517b230d0" + integrity sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA== dependencies: - call-bind "^1.0.7" + call-bind "^1.0.2" for-each "^0.3.3" - gopd "^1.0.1" - has-proto "^1.0.3" - is-typed-array "^1.1.13" + has-proto "^1.0.1" + is-typed-array "^1.1.10" typed-array-byte-offset@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.2.tgz#f9ec1acb9259f395093e4567eb3c28a580d02063" - integrity sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA== + version "1.0.0" + resolved "https://registry.yarnpkg.com/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz#cbbe89b51fdef9cd6aaf07ad4707340abbc4ea0b" + integrity sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg== dependencies: - available-typed-arrays "^1.0.7" - call-bind "^1.0.7" + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" for-each "^0.3.3" - gopd "^1.0.1" - has-proto "^1.0.3" - is-typed-array "^1.1.13" + has-proto "^1.0.1" + is-typed-array "^1.1.10" typed-array-length@^1.0.4: - version "1.0.5" - resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.5.tgz#57d44da160296d8663fd63180a1802ebf25905d5" - integrity sha512-yMi0PlwuznKHxKmcpoOdeLwxBoVPkqZxd7q2FgMkmD3bNwvF5VW0+UlUQ1k1vmktTu4Yu13Q0RIxEP8+B+wloA== + version "1.0.4" + resolved "https://registry.yarnpkg.com/typed-array-length/-/typed-array-length-1.0.4.tgz#89d83785e5c4098bec72e08b319651f0eac9c1bb" + integrity sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng== dependencies: - call-bind "^1.0.7" + call-bind "^1.0.2" for-each "^0.3.3" - gopd "^1.0.1" - has-proto "^1.0.3" - is-typed-array "^1.1.13" - possible-typed-array-names "^1.0.0" + is-typed-array "^1.1.9" typedarray-to-buffer@^3.1.5: version "3.1.5"