Ignore:
Timestamp:
12/12/24 17:06:06 (5 weeks ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
d565449
Message:

Pred finalna verzija

Location:
imaps-frontend/node_modules/browserslist
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/browserslist/browser.js

    rd565449 r0c6b92a  
    4545  findConfig: noop,
    4646
     47  findConfigFile: noop,
     48
    4749  clearCaches: noop,
    4850
  • imaps-frontend/node_modules/browserslist/cli.js

    rd565449 r0c6b92a  
    11#!/usr/bin/env node
    22
     3var fs = require('fs')
    34var updateDb = require('update-browserslist-db')
    4 var fs = require('fs')
    55
    66var browserslist = require('./')
  • imaps-frontend/node_modules/browserslist/index.d.ts

    rd565449 r0c6b92a  
    167167  ): Query[]
    168168
     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
    169180  function clearCaches(): void
    170181
     
    175186  function findConfig(...pathSegments: string[]): Config | undefined
    176187
     188  function findConfigFile(...pathSegments: string[]): string | undefined
     189
    177190  interface LoadConfigOptions {
     191    /**
     192     * Path to config file
     193     * */
    178194    config?: string
     195
     196    /**
     197     * Path to file inside the project to find Browserslist config
     198     * in closest folder
     199     */
    179200    path?: string
     201
     202    /**
     203     * Environment to choose part of config.
     204     */
    180205    env?: string
    181206  }
    182 
    183   function loadConfig(options: LoadConfigOptions): string[] | undefined
    184207}
    185208
  • imaps-frontend/node_modules/browserslist/index.js

    rd565449 r0c6b92a  
    11var jsReleases = require('node-releases/data/processed/envs.json')
    22var agents = require('caniuse-lite/dist/unpacker/agents').agents
     3var e2c = require('electron-to-chromium/versions')
    34var jsEOL = require('node-releases/data/release-schedule/release-schedule.json')
    45var path = require('path')
    5 var e2c = require('electron-to-chromium/versions')
    66
    77var BrowserslistError = require('./error')
    8 var parse = require('./parse')
    9 var env = require('./node') // Will load browser.js in webpack
     8var env = require('./node')
     9var parse = require('./parse') // Will load browser.js in webpack
    1010
    1111var YEAR = 365.259641 * 24 * 60 * 60 * 1000
     
    492492browserslist.parseConfig = env.parseConfig
    493493browserslist.readConfig = env.readConfig
     494browserslist.findConfigFile = env.findConfigFile
    494495browserslist.findConfig = env.findConfig
    495496browserslist.loadConfig = env.loadConfig
  • imaps-frontend/node_modules/browserslist/node.js

    rd565449 r0c6b92a  
    11var feature = require('caniuse-lite/dist/unpacker/feature').default
    22var region = require('caniuse-lite/dist/unpacker/region').default
     3var fs = require('fs')
    34var path = require('path')
    4 var fs = require('fs')
    55
    66var BrowserslistError = require('./error')
     
    99var CONFIG_PATTERN = /^browserslist-config-/
    1010var SCOPED_CONFIG__PATTERN = /@[^/]+(?:\/[^/]+)?\/browserslist-config(?:-|$|\/)/
    11 var TIME_TO_UPDATE_CANIUSE = 6 * 30 * 24 * 60 * 60 * 1000
    1211var FORMAT =
    1312  'Browserslist config should be a string or an array ' +
     
    127126}
    128127
     128function parsePackageOrReadConfig(file) {
     129  if (path.basename(file) === 'package.json') {
     130    return parsePackage(file)
     131  } else {
     132    return module.exports.readConfig(file)
     133  }
     134}
     135
    129136function latestReleaseTime(agents) {
    130137  var latest = 0
     
    138145  }
    139146  return latest * 1000
     147}
     148
     149function 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
    140157}
    141158
     
    238255    } else if (opts.config || process.env.BROWSERSLIST_CONFIG) {
    239256      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)
    245258    } else if (opts.path) {
    246259      return pickEnv(module.exports.findConfig(opts.path), opts)
     
    331344  },
    332345
    333   findConfig: function findConfig(from) {
    334     from = path.resolve(from)
    335 
    336     var passed = []
     346  findConfigFile: function findConfigFile(from) {
    337347    var resolved = eachParent(from, function (dir) {
    338       if (dir in configCache) {
    339         return configCache[dir]
    340       }
    341 
    342       passed.push(dir)
    343 
    344348      var config = path.join(dir, 'browserslist')
    345349      var pkg = path.join(dir, 'package.json')
     
    371375        )
    372376      } else if (isFile(config)) {
    373         return module.exports.readConfig(config)
     377        return config
    374378      } else if (isFile(rc)) {
    375         return module.exports.readConfig(rc)
    376       } else {
    377         return pkgBrowserslist
     379        return rc
     380      } else if (pkgBrowserslist) {
     381        return pkg
    378382      }
    379383    })
     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
    380402    if (!process.env.BROWSERSLIST_DISABLE_CACHE) {
    381       passed.forEach(function (dir) {
     403      var configDir = configFile && path.dirname(configFile)
     404      eachParent(from, function (dir) {
    382405        configCache[dir] = resolved
     406        if (dir === configDir) {
     407          return null
     408        }
    383409      })
    384410    }
     
    400426
    401427    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')
    405432      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' +
    407436          '  npx update-browserslist-db@latest\n' +
    408437          '  Why you should do it regularly: ' +
  • imaps-frontend/node_modules/browserslist/package.json

    rd565449 r0c6b92a  
    11{
    22  "name": "browserslist",
    3   "version": "4.23.3",
     3  "version": "4.24.2",
    44  "description": "Share target browsers between different front-end tools, like Autoprefixer, Stylelint and babel-env-preset",
    55  "keywords": [
     
    2626  "repository": "browserslist/browserslist",
    2727  "dependencies": {
    28     "caniuse-lite": "^1.0.30001646",
    29     "electron-to-chromium": "^1.5.4",
     28    "caniuse-lite": "^1.0.30001669",
     29    "electron-to-chromium": "^1.5.41",
    3030    "node-releases": "^2.0.18",
    31     "update-browserslist-db": "^1.1.0"
     31    "update-browserslist-db": "^1.1.1"
    3232  },
    3333  "engines": {
  • imaps-frontend/node_modules/browserslist/parse.js

    rd565449 r0c6b92a  
    1010
    1111function 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++) {
    1313    var parsed = string.substr(-n, n)
    1414    if (predicate(parsed, n, max)) {
Note: See TracChangeset for help on using the changeset viewer.