updated npm modules

This commit is contained in:
2019-05-20 20:43:45 -05:00
parent 2319197b81
commit f166b72b7d
1113 changed files with 8758 additions and 12227 deletions

131
node_modules/browserslist/index.js generated vendored
View File

@@ -91,17 +91,73 @@ function generateFilter (sign, version) {
}
}
function compareStrings (a, b) {
function generateSemverFilter (sign, version) {
version = version.split('.').map(parseSimpleInt)
version[1] = version[1] || 0
version[2] = version[2] || 0
if (sign === '>') {
return function (v) {
v = v.split('.').map(parseSimpleInt)
return compareSemver(v, version) > 0
}
} else if (sign === '>=') {
return function (v) {
v = v.split('.').map(parseSimpleInt)
return compareSemver(v, version) >= 0
}
} else if (sign === '<') {
return function (v) {
v = v.split('.').map(parseSimpleInt)
return compareSemver(version, v) > 0
}
} else {
return function (v) {
v = v.split('.').map(parseSimpleInt)
return compareSemver(version, v) >= 0
}
}
}
function parseSimpleInt (x) {
return parseInt(x)
}
function compare (a, b) {
if (a < b) return -1
if (a > b) return +1
return 0
}
function normalizeVersion (data, version) {
function compareSemver (a, b) {
return (
compare(a[0], b[0]) ||
compare(a[1], b[1]) ||
compare(a[2], b[2])
)
}
function resolveVersion (data, version) {
if (data.versions.indexOf(version) !== -1) {
return version
} else if (browserslist.versionAliases[data.name][version]) {
return browserslist.versionAliases[data.name][version]
} else {
return false
}
}
function normalizeVersion (data, version, context) {
var resolved = resolveVersion(data, version)
if (
!resolved &&
context.mobileToDesktop &&
browserslist.desktopNames[data.name]
) {
var alias = checkName(browserslist.desktopNames[data.name])
resolved = resolveVersion(alias, version)
}
if (resolved) {
return resolved
} else if (data.versions.length === 1) {
return data.versions[0]
} else {
@@ -235,6 +291,9 @@ function resolve (queries, context) {
* version in direct query.
* @param {boolean} [opts.dangerousExtend] Disable security checks
* for extend query.
* @param {boolean} [opts.mobileToDesktop] Alias mobile browsers to the desktop
* version when Can I Use doesn't have
* data about the specified version.
* @returns {string[]} Array with browser names in Can I Use.
*
* @example
@@ -263,7 +322,8 @@ function browserslist (queries, opts) {
var context = {
ignoreUnknownVersions: opts.ignoreUnknownVersions,
dangerousExtend: opts.dangerousExtend
dangerousExtend: opts.dangerousExtend,
mobileToDesktop: opts.mobileToDesktop
}
env.oldDataWarning(browserslist.data)
@@ -282,10 +342,10 @@ function browserslist (queries, opts) {
if (FLOAT_RANGE.test(name1[1]) && FLOAT_RANGE.test(name2[1])) {
return parseFloat(name2[1]) - parseFloat(name1[1])
} else {
return compareStrings(name2[1], name1[1])
return compare(name2[1], name1[1])
}
} else {
return compareStrings(name1[0], name2[0])
return compare(name1[0], name2[0])
}
})
@@ -325,29 +385,26 @@ function doMatch (string, qs) {
var or = /^(?:,\s*|\s+OR\s+)(.*)/i
var and = /^\s+AND\s+(.*)/i
return find(
string,
function (parsed, n, max) {
if (and.test(parsed)) {
qs.unshift({ type: QUERY_AND, queryString: parsed.match(and)[1] })
return true
} else if (or.test(parsed)) {
qs.unshift({ type: QUERY_OR, queryString: parsed.match(or)[1] })
return true
} else if (n === max) {
qs.unshift({ type: QUERY_OR, queryString: parsed.trim() })
return true
}
return false
return find(string, function (parsed, n, max) {
if (and.test(parsed)) {
qs.unshift({ type: QUERY_AND, queryString: parsed.match(and)[1] })
return true
} else if (or.test(parsed)) {
qs.unshift({ type: QUERY_OR, queryString: parsed.match(or)[1] })
return true
} else if (n === max) {
qs.unshift({ type: QUERY_OR, queryString: parsed.trim() })
return true
}
)
return false
})
}
function find (string, predicate) {
for (var n = 1, max = string.length; n <= max; n++) {
var parsed = string.substr(-n, n)
if (predicate(parsed, n, max)) {
return string.replace(parsed, '')
return string.slice(0, -n)
}
}
return ''
@@ -391,6 +448,15 @@ browserslist.aliases = {
qqandroid: 'and_qq'
}
// Can I Use only provides a few versions for some browsers (e.g. and_chr).
// Fallback to a similar browser for unknown versions
browserslist.desktopNames = {
and_chr: 'chrome',
and_ff: 'firefox',
ie_mob: 'ie',
op_mob: 'opera'
}
// Aliases to work with joined versions like `ios_saf 7.0-7.1`
browserslist.versionAliases = { }
@@ -724,8 +790,8 @@ var QUERIES = [
regexp: /^(\w+)\s+([\d.]+)\s*-\s*([\d.]+)$/i,
select: function (context, name, from, to) {
var data = checkName(name)
from = parseFloat(normalizeVersion(data, from) || from)
to = parseFloat(normalizeVersion(data, to) || to)
from = parseFloat(normalizeVersion(data, from, context) || from)
to = parseFloat(normalizeVersion(data, to, context) || to)
function filter (v) {
var parsed = parseFloat(v)
@@ -745,6 +811,21 @@ var QUERIES = [
})
}
},
{
regexp: /^node\s*(>=?|<=?)\s*([\d.]+)$/i,
select: function (context, sign, version) {
var nodeVersions = jsReleases.filter(function (i) {
return i.name === 'nodejs'
}).map(function (i) {
return i.version
})
return nodeVersions
.filter(generateSemverFilter(sign, version))
.map(function (v) {
return 'node ' + v
})
}
},
{
regexp: /^(\w+)\s*(>=?|<=?)\s*([\d.]+)$/,
select: function (context, name, sign, version) {
@@ -828,7 +909,7 @@ var QUERIES = [
select: function (context, name, version) {
if (/^tp$/i.test(version)) version = 'TP'
var data = checkName(name)
var alias = normalizeVersion(data, version)
var alias = normalizeVersion(data, version, context)
if (alias) {
version = alias
} else {
@@ -837,7 +918,7 @@ var QUERIES = [
} else {
alias = version.replace(/\.0$/, '')
}
alias = normalizeVersion(data, alias)
alias = normalizeVersion(data, alias, context)
if (alias) {
version = alias
} else if (context.ignoreUnknownVersions) {