Changeset 0c6b92a for imaps-frontend/node_modules/browserslist
- Timestamp:
- 12/12/24 17:06:06 (5 weeks ago)
- Branches:
- main
- Parents:
- d565449
- Location:
- imaps-frontend/node_modules/browserslist
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
imaps-frontend/node_modules/browserslist/browser.js
rd565449 r0c6b92a 45 45 findConfig: noop, 46 46 47 findConfigFile: noop, 48 47 49 clearCaches: noop, 48 50 -
imaps-frontend/node_modules/browserslist/cli.js
rd565449 r0c6b92a 1 1 #!/usr/bin/env node 2 2 3 var fs = require('fs') 3 4 var updateDb = require('update-browserslist-db') 4 var fs = require('fs')5 5 6 6 var browserslist = require('./') -
imaps-frontend/node_modules/browserslist/index.d.ts
rd565449 r0c6b92a 167 167 ): Query[] 168 168 169 /** 170 * Return queries for specific file inside the project. 171 * 172 * ```js 173 * browserslist.loadConfig({ 174 * file: process.cwd() 175 * }) ?? browserslist.defaults 176 * ``` 177 */ 178 function loadConfig(options: LoadConfigOptions): string[] | undefined 179 169 180 function clearCaches(): void 170 181 … … 175 186 function findConfig(...pathSegments: string[]): Config | undefined 176 187 188 function findConfigFile(...pathSegments: string[]): string | undefined 189 177 190 interface LoadConfigOptions { 191 /** 192 * Path to config file 193 * */ 178 194 config?: string 195 196 /** 197 * Path to file inside the project to find Browserslist config 198 * in closest folder 199 */ 179 200 path?: string 201 202 /** 203 * Environment to choose part of config. 204 */ 180 205 env?: string 181 206 } 182 183 function loadConfig(options: LoadConfigOptions): string[] | undefined184 207 } 185 208 -
imaps-frontend/node_modules/browserslist/index.js
rd565449 r0c6b92a 1 1 var jsReleases = require('node-releases/data/processed/envs.json') 2 2 var agents = require('caniuse-lite/dist/unpacker/agents').agents 3 var e2c = require('electron-to-chromium/versions') 3 4 var jsEOL = require('node-releases/data/release-schedule/release-schedule.json') 4 5 var path = require('path') 5 var e2c = require('electron-to-chromium/versions')6 6 7 7 var BrowserslistError = require('./error') 8 var parse = require('./parse')9 var env = require('./node') // Will load browser.js in webpack8 var env = require('./node') 9 var parse = require('./parse') // Will load browser.js in webpack 10 10 11 11 var YEAR = 365.259641 * 24 * 60 * 60 * 1000 … … 492 492 browserslist.parseConfig = env.parseConfig 493 493 browserslist.readConfig = env.readConfig 494 browserslist.findConfigFile = env.findConfigFile 494 495 browserslist.findConfig = env.findConfig 495 496 browserslist.loadConfig = env.loadConfig -
imaps-frontend/node_modules/browserslist/node.js
rd565449 r0c6b92a 1 1 var feature = require('caniuse-lite/dist/unpacker/feature').default 2 2 var region = require('caniuse-lite/dist/unpacker/region').default 3 var fs = require('fs') 3 4 var path = require('path') 4 var fs = require('fs')5 5 6 6 var BrowserslistError = require('./error') … … 9 9 var CONFIG_PATTERN = /^browserslist-config-/ 10 10 var SCOPED_CONFIG__PATTERN = /@[^/]+(?:\/[^/]+)?\/browserslist-config(?:-|$|\/)/ 11 var TIME_TO_UPDATE_CANIUSE = 6 * 30 * 24 * 60 * 60 * 100012 11 var FORMAT = 13 12 'Browserslist config should be a string or an array ' + … … 127 126 } 128 127 128 function parsePackageOrReadConfig(file) { 129 if (path.basename(file) === 'package.json') { 130 return parsePackage(file) 131 } else { 132 return module.exports.readConfig(file) 133 } 134 } 135 129 136 function latestReleaseTime(agents) { 130 137 var latest = 0 … … 138 145 } 139 146 return latest * 1000 147 } 148 149 function getMonthsPassed(date) { 150 var now = new Date() 151 var past = new Date(date) 152 153 var years = now.getFullYear() - past.getFullYear() 154 var months = now.getMonth() - past.getMonth() 155 156 return years * 12 + months 140 157 } 141 158 … … 238 255 } else if (opts.config || process.env.BROWSERSLIST_CONFIG) { 239 256 var file = opts.config || process.env.BROWSERSLIST_CONFIG 240 if (path.basename(file) === 'package.json') { 241 return pickEnv(parsePackage(file), opts) 242 } else { 243 return pickEnv(module.exports.readConfig(file), opts) 244 } 257 return pickEnv(parsePackageOrReadConfig(file), opts) 245 258 } else if (opts.path) { 246 259 return pickEnv(module.exports.findConfig(opts.path), opts) … … 331 344 }, 332 345 333 findConfig: function findConfig(from) { 334 from = path.resolve(from) 335 336 var passed = [] 346 findConfigFile: function findConfigFile(from) { 337 347 var resolved = eachParent(from, function (dir) { 338 if (dir in configCache) {339 return configCache[dir]340 }341 342 passed.push(dir)343 344 348 var config = path.join(dir, 'browserslist') 345 349 var pkg = path.join(dir, 'package.json') … … 371 375 ) 372 376 } else if (isFile(config)) { 373 return module.exports.readConfig(config)377 return config 374 378 } else if (isFile(rc)) { 375 return module.exports.readConfig(rc)376 } else {377 return pkg Browserslist379 return rc 380 } else if (pkgBrowserslist) { 381 return pkg 378 382 } 379 383 }) 384 385 return resolved 386 }, 387 388 findConfig: function findConfig(from) { 389 from = path.resolve(from) 390 391 var fromDir = isFile(from) ? path.dirname(from) : from 392 if (fromDir in configCache) { 393 return configCache[fromDir] 394 } 395 396 var resolved 397 var configFile = this.findConfigFile(from) 398 if (configFile) { 399 resolved = parsePackageOrReadConfig(configFile) 400 } 401 380 402 if (!process.env.BROWSERSLIST_DISABLE_CACHE) { 381 passed.forEach(function (dir) { 403 var configDir = configFile && path.dirname(configFile) 404 eachParent(from, function (dir) { 382 405 configCache[dir] = resolved 406 if (dir === configDir) { 407 return null 408 } 383 409 }) 384 410 } … … 400 426 401 427 var latest = latestReleaseTime(agentsObj) 402 var halfYearAgo = Date.now() - TIME_TO_UPDATE_CANIUSE 403 404 if (latest !== 0 && latest < halfYearAgo) { 428 var monthsPassed = getMonthsPassed(latest) 429 430 if (latest !== 0 && monthsPassed >= 6) { 431 var months = monthsPassed + ' ' + (monthsPassed > 1 ? 'months' : 'month') 405 432 console.warn( 406 'Browserslist: caniuse-lite is outdated. Please run:\n' + 433 'Browserslist: browsers data (caniuse-lite) is ' + 434 months + 435 ' old. Please run:\n' + 407 436 ' npx update-browserslist-db@latest\n' + 408 437 ' Why you should do it regularly: ' + -
imaps-frontend/node_modules/browserslist/package.json
rd565449 r0c6b92a 1 1 { 2 2 "name": "browserslist", 3 "version": "4.2 3.3",3 "version": "4.24.2", 4 4 "description": "Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset", 5 5 "keywords": [ … … 26 26 "repository": "browserslist/browserslist", 27 27 "dependencies": { 28 "caniuse-lite": "^1.0.300016 46",29 "electron-to-chromium": "^1.5.4 ",28 "caniuse-lite": "^1.0.30001669", 29 "electron-to-chromium": "^1.5.41", 30 30 "node-releases": "^2.0.18", 31 "update-browserslist-db": "^1.1. 0"31 "update-browserslist-db": "^1.1.1" 32 32 }, 33 33 "engines": { -
imaps-frontend/node_modules/browserslist/parse.js
rd565449 r0c6b92a 10 10 11 11 function find(string, predicate) { 12 for (var n = 1, max = string.length; n <= max; n++) {12 for (var max = string.length, n = 1; n <= max; n++) { 13 13 var parsed = string.substr(-n, n) 14 14 if (predicate(parsed, n, max)) {
Note:
See TracChangeset
for help on using the changeset viewer.