update
This commit is contained in:
@@ -0,0 +1 @@
|
||||
module.exports={C:{"4":0.0804,"52":0.00643,"59":0.00322,"108":0.00322,"109":0.00965,"111":0.00643,"115":0.05789,"116":0.00322,"125":0.00322,"127":0.00322,"128":0.02251,"131":0.00322,"133":0.00322,"134":0.02573,"135":0.10291,"136":0.46632,"137":0.01286,_:"2 3 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 110 112 113 114 117 118 119 120 121 122 123 124 126 129 130 132 138 139 140 3.5 3.6"},D:{"34":0.00322,"39":0.00643,"40":0.00643,"41":0.01286,"42":0.00643,"43":0.03216,"44":0.00643,"45":0.00643,"46":0.00643,"47":0.02894,"48":0.02573,"49":0.00965,"50":0.00643,"51":0.00643,"52":0.00643,"53":0.00643,"54":0.00643,"55":0.00643,"56":0.00643,"57":0.00643,"58":0.00643,"59":0.00643,"60":0.00643,"62":0.00965,"64":0.00322,"65":0.00643,"72":0.00643,"73":0.00643,"75":0.00322,"76":0.00322,"79":0.01286,"81":0.00322,"83":0.00322,"84":0.00322,"85":0.00643,"87":0.02573,"88":0.00322,"89":0.00643,"90":0.00322,"91":0.00322,"92":0.00965,"93":0.03538,"94":0.0193,"95":0.00643,"96":0.00322,"98":0.00643,"100":0.0193,"102":0.00322,"103":0.05146,"104":0.04181,"105":0.00643,"106":0.03859,"107":0.02251,"108":0.06432,"109":0.69466,"110":0.05146,"111":0.03216,"112":0.01286,"113":0.00643,"114":0.00643,"115":0.00322,"116":0.0611,"117":0.00322,"118":0.00322,"119":0.01608,"120":0.06754,"121":0.01286,"122":0.03538,"123":0.02573,"124":0.0804,"125":0.07075,"126":0.02894,"127":0.04824,"128":0.08683,"129":0.03216,"130":0.03538,"131":0.21226,"132":0.30552,"133":5.61835,"134":10.85078,"135":0.00965,"136":0.00322,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 35 36 37 38 61 63 66 67 68 69 70 71 74 77 78 80 86 97 99 101 137 138"},F:{"87":0.01286,"88":0.00643,"95":0.00965,"102":0.00322,"114":0.00322,"115":0.03216,"116":0.33768,"117":1.05485,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 89 90 91 92 93 94 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 113 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"15":0.01286,"18":0.0193,"84":0.00322,"85":0.00322,"92":0.03859,"100":0.00322,"103":0.00322,"105":0.00643,"106":0.00322,"107":0.00322,"108":0.01608,"109":0.04824,"114":0.00965,"120":0.00322,"121":0.00322,"122":0.00643,"124":0.00322,"125":0.00322,"126":0.0804,"127":0.00322,"128":0.04181,"129":0.02894,"130":0.01608,"131":0.04502,"132":0.0804,"133":1.17706,"134":2.83008,_:"12 13 14 16 17 79 80 81 83 86 87 88 89 90 91 93 94 95 96 97 98 99 101 102 104 110 111 112 113 115 116 117 118 119 123"},E:{"4":0.00322,"14":0.00322,_:"0 5 6 7 8 9 10 11 12 13 15 3.1 3.2 6.1 7.1 9.1 10.1 12.1","5.1":0.00643,"11.1":0.01286,"13.1":0.00965,"14.1":0.03216,"15.1":0.00322,"15.2-15.3":0.00643,"15.4":0.00322,"15.5":0.01608,"15.6":0.08362,"16.0":0.00322,"16.1":0.00965,"16.2":0.00322,"16.3":0.01286,"16.4":0.00322,"16.5":0.00965,"16.6":0.07718,"17.0":0.00965,"17.1":0.03216,"17.2":0.00643,"17.3":0.01608,"17.4":0.21547,"17.5":0.04181,"17.6":0.20904,"18.0":0.05789,"18.1":0.09648,"18.2":0.03216,"18.3":0.84581,"18.4":0.02894},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00601,"5.0-5.1":0,"6.0-6.1":0.01804,"7.0-7.1":0.01202,"8.1-8.4":0,"9.0-9.2":0.00902,"9.3":0.04209,"10.0-10.2":0.00301,"10.3":0.06914,"11.0-11.2":0.31866,"11.3-11.4":0.02104,"12.0-12.1":0.01202,"12.2-12.5":0.29762,"13.0-13.1":0.00601,"13.2":0.00902,"13.3":0.01202,"13.4-13.7":0.04209,"14.0-14.4":0.10522,"14.5-14.8":0.12626,"15.0-15.1":0.06914,"15.2-15.3":0.06914,"15.4":0.08417,"15.5":0.0962,"15.6-15.8":1.18445,"16.0":0.16835,"16.1":0.34572,"16.2":0.18037,"16.3":0.31265,"16.4":0.06914,"16.5":0.12927,"16.6-16.7":1.40391,"17.0":0.08417,"17.1":0.15031,"17.2":0.11424,"17.3":0.15933,"17.4":0.31866,"17.5":0.70947,"17.6-17.7":2.05926,"18.0":0.5772,"18.1":1.88791,"18.2":0.84475,"18.3":17.65556,"18.4":0.26154},P:{"4":0.0316,"21":0.02107,"22":0.0316,"23":0.01053,"24":0.04213,"25":0.02107,"26":0.0632,"27":1.00063,_:"20 8.2 9.2 10.1 12.0 13.0 14.0 15.0 17.0 18.0 19.0","5.0-5.4":0.01053,"6.2-6.4":0.01053,"7.2-7.4":0.02107,"11.1-11.2":0.01053,"16.0":0.02107},I:{"0":0.03384,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00004},K:{"0":0.23741,_:"10 11 12 11.1 11.5 12.1"},A:{"6":0.00415,"7":0.00831,"8":0.03739,"9":0.00831,"10":0.02077,"11":0.02077,_:"5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.12888},Q:{"14.9":0.00678},O:{"0":0.02035},H:{"0":0},L:{"0":39.18764}};
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"name": "readable-stream",
|
||||
"version": "3.6.2",
|
||||
"description": "Streams3, a user-land copy of the stream library from Node.js",
|
||||
"main": "readable.js",
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
},
|
||||
"dependencies": {
|
||||
"inherits": "^2.0.3",
|
||||
"string_decoder": "^1.1.1",
|
||||
"util-deprecate": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.2.0",
|
||||
"@babel/core": "^7.2.0",
|
||||
"@babel/polyfill": "^7.0.0",
|
||||
"@babel/preset-env": "^7.2.0",
|
||||
"airtap": "0.0.9",
|
||||
"assert": "^1.4.0",
|
||||
"bl": "^2.0.0",
|
||||
"deep-strict-equal": "^0.2.0",
|
||||
"events.once": "^2.0.2",
|
||||
"glob": "^7.1.2",
|
||||
"gunzip-maybe": "^1.4.1",
|
||||
"hyperquest": "^2.1.3",
|
||||
"lolex": "^2.6.0",
|
||||
"nyc": "^11.0.0",
|
||||
"pump": "^3.0.0",
|
||||
"rimraf": "^2.6.2",
|
||||
"tap": "^12.0.0",
|
||||
"tape": "^4.9.0",
|
||||
"tar-fs": "^1.16.2",
|
||||
"util-promisify": "^2.1.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tap -J --no-esm test/parallel/*.js test/ours/*.js",
|
||||
"ci": "TAP=1 tap --no-esm test/parallel/*.js test/ours/*.js | tee test.tap",
|
||||
"test-browsers": "airtap --sauce-connect --loopback airtap.local -- test/browser.js",
|
||||
"test-browser-local": "airtap --open --local -- test/browser.js",
|
||||
"cover": "nyc npm test",
|
||||
"report": "nyc report --reporter=lcov",
|
||||
"update-browser-errors": "babel -o errors-browser.js errors.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/nodejs/readable-stream"
|
||||
},
|
||||
"keywords": [
|
||||
"readable",
|
||||
"stream",
|
||||
"pipe"
|
||||
],
|
||||
"browser": {
|
||||
"util": false,
|
||||
"worker_threads": false,
|
||||
"./errors": "./errors-browser.js",
|
||||
"./readable.js": "./readable-browser.js",
|
||||
"./lib/internal/streams/from.js": "./lib/internal/streams/from-browser.js",
|
||||
"./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js"
|
||||
},
|
||||
"nyc": {
|
||||
"include": [
|
||||
"lib/**.js"
|
||||
]
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["_AwaitValue","value","wrapped"],"sources":["../../src/helpers/AwaitValue.js"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n/* @onlyBabel7 */\n\nexport default function _AwaitValue(value) {\n this.wrapped = value;\n}\n"],"mappings":";;;;;;AAGe,SAASA,WAAWA,CAACC,KAAK,EAAE;EACzC,IAAI,CAACC,OAAO,GAAGD,KAAK;AACtB","ignoreList":[]}
|
||||
@@ -0,0 +1,247 @@
|
||||
const Range = require('../classes/range.js')
|
||||
const Comparator = require('../classes/comparator.js')
|
||||
const { ANY } = Comparator
|
||||
const satisfies = require('../functions/satisfies.js')
|
||||
const compare = require('../functions/compare.js')
|
||||
|
||||
// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
|
||||
// - Every simple range `r1, r2, ...` is a null set, OR
|
||||
// - Every simple range `r1, r2, ...` which is not a null set is a subset of
|
||||
// some `R1, R2, ...`
|
||||
//
|
||||
// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
|
||||
// - If c is only the ANY comparator
|
||||
// - If C is only the ANY comparator, return true
|
||||
// - Else if in prerelease mode, return false
|
||||
// - else replace c with `[>=0.0.0]`
|
||||
// - If C is only the ANY comparator
|
||||
// - if in prerelease mode, return true
|
||||
// - else replace C with `[>=0.0.0]`
|
||||
// - Let EQ be the set of = comparators in c
|
||||
// - If EQ is more than one, return true (null set)
|
||||
// - Let GT be the highest > or >= comparator in c
|
||||
// - Let LT be the lowest < or <= comparator in c
|
||||
// - If GT and LT, and GT.semver > LT.semver, return true (null set)
|
||||
// - If any C is a = range, and GT or LT are set, return false
|
||||
// - If EQ
|
||||
// - If GT, and EQ does not satisfy GT, return true (null set)
|
||||
// - If LT, and EQ does not satisfy LT, return true (null set)
|
||||
// - If EQ satisfies every C, return true
|
||||
// - Else return false
|
||||
// - If GT
|
||||
// - If GT.semver is lower than any > or >= comp in C, return false
|
||||
// - If GT is >=, and GT.semver does not satisfy every C, return false
|
||||
// - If GT.semver has a prerelease, and not in prerelease mode
|
||||
// - If no C has a prerelease and the GT.semver tuple, return false
|
||||
// - If LT
|
||||
// - If LT.semver is greater than any < or <= comp in C, return false
|
||||
// - If LT is <=, and LT.semver does not satisfy every C, return false
|
||||
// - If GT.semver has a prerelease, and not in prerelease mode
|
||||
// - If no C has a prerelease and the LT.semver tuple, return false
|
||||
// - Else return true
|
||||
|
||||
const subset = (sub, dom, options = {}) => {
|
||||
if (sub === dom) {
|
||||
return true
|
||||
}
|
||||
|
||||
sub = new Range(sub, options)
|
||||
dom = new Range(dom, options)
|
||||
let sawNonNull = false
|
||||
|
||||
OUTER: for (const simpleSub of sub.set) {
|
||||
for (const simpleDom of dom.set) {
|
||||
const isSub = simpleSubset(simpleSub, simpleDom, options)
|
||||
sawNonNull = sawNonNull || isSub !== null
|
||||
if (isSub) {
|
||||
continue OUTER
|
||||
}
|
||||
}
|
||||
// the null set is a subset of everything, but null simple ranges in
|
||||
// a complex range should be ignored. so if we saw a non-null range,
|
||||
// then we know this isn't a subset, but if EVERY simple range was null,
|
||||
// then it is a subset.
|
||||
if (sawNonNull) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]
|
||||
const minimumVersion = [new Comparator('>=0.0.0')]
|
||||
|
||||
const simpleSubset = (sub, dom, options) => {
|
||||
if (sub === dom) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (sub.length === 1 && sub[0].semver === ANY) {
|
||||
if (dom.length === 1 && dom[0].semver === ANY) {
|
||||
return true
|
||||
} else if (options.includePrerelease) {
|
||||
sub = minimumVersionWithPreRelease
|
||||
} else {
|
||||
sub = minimumVersion
|
||||
}
|
||||
}
|
||||
|
||||
if (dom.length === 1 && dom[0].semver === ANY) {
|
||||
if (options.includePrerelease) {
|
||||
return true
|
||||
} else {
|
||||
dom = minimumVersion
|
||||
}
|
||||
}
|
||||
|
||||
const eqSet = new Set()
|
||||
let gt, lt
|
||||
for (const c of sub) {
|
||||
if (c.operator === '>' || c.operator === '>=') {
|
||||
gt = higherGT(gt, c, options)
|
||||
} else if (c.operator === '<' || c.operator === '<=') {
|
||||
lt = lowerLT(lt, c, options)
|
||||
} else {
|
||||
eqSet.add(c.semver)
|
||||
}
|
||||
}
|
||||
|
||||
if (eqSet.size > 1) {
|
||||
return null
|
||||
}
|
||||
|
||||
let gtltComp
|
||||
if (gt && lt) {
|
||||
gtltComp = compare(gt.semver, lt.semver, options)
|
||||
if (gtltComp > 0) {
|
||||
return null
|
||||
} else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
// will iterate one or zero times
|
||||
for (const eq of eqSet) {
|
||||
if (gt && !satisfies(eq, String(gt), options)) {
|
||||
return null
|
||||
}
|
||||
|
||||
if (lt && !satisfies(eq, String(lt), options)) {
|
||||
return null
|
||||
}
|
||||
|
||||
for (const c of dom) {
|
||||
if (!satisfies(eq, String(c), options)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
let higher, lower
|
||||
let hasDomLT, hasDomGT
|
||||
// if the subset has a prerelease, we need a comparator in the superset
|
||||
// with the same tuple and a prerelease, or it's not a subset
|
||||
let needDomLTPre = lt &&
|
||||
!options.includePrerelease &&
|
||||
lt.semver.prerelease.length ? lt.semver : false
|
||||
let needDomGTPre = gt &&
|
||||
!options.includePrerelease &&
|
||||
gt.semver.prerelease.length ? gt.semver : false
|
||||
// exception: <1.2.3-0 is the same as <1.2.3
|
||||
if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
|
||||
lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
|
||||
needDomLTPre = false
|
||||
}
|
||||
|
||||
for (const c of dom) {
|
||||
hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='
|
||||
hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='
|
||||
if (gt) {
|
||||
if (needDomGTPre) {
|
||||
if (c.semver.prerelease && c.semver.prerelease.length &&
|
||||
c.semver.major === needDomGTPre.major &&
|
||||
c.semver.minor === needDomGTPre.minor &&
|
||||
c.semver.patch === needDomGTPre.patch) {
|
||||
needDomGTPre = false
|
||||
}
|
||||
}
|
||||
if (c.operator === '>' || c.operator === '>=') {
|
||||
higher = higherGT(gt, c, options)
|
||||
if (higher === c && higher !== gt) {
|
||||
return false
|
||||
}
|
||||
} else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (lt) {
|
||||
if (needDomLTPre) {
|
||||
if (c.semver.prerelease && c.semver.prerelease.length &&
|
||||
c.semver.major === needDomLTPre.major &&
|
||||
c.semver.minor === needDomLTPre.minor &&
|
||||
c.semver.patch === needDomLTPre.patch) {
|
||||
needDomLTPre = false
|
||||
}
|
||||
}
|
||||
if (c.operator === '<' || c.operator === '<=') {
|
||||
lower = lowerLT(lt, c, options)
|
||||
if (lower === c && lower !== lt) {
|
||||
return false
|
||||
}
|
||||
} else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// if there was a < or >, and nothing in the dom, then must be false
|
||||
// UNLESS it was limited by another range in the other direction.
|
||||
// Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
|
||||
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
||||
return false
|
||||
}
|
||||
|
||||
// we needed a prerelease range in a specific tuple, but didn't get one
|
||||
// then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,
|
||||
// because it includes prereleases in the 1.2.3 tuple
|
||||
if (needDomGTPre || needDomLTPre) {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// >=1.2.3 is lower than >1.2.3
|
||||
const higherGT = (a, b, options) => {
|
||||
if (!a) {
|
||||
return b
|
||||
}
|
||||
const comp = compare(a.semver, b.semver, options)
|
||||
return comp > 0 ? a
|
||||
: comp < 0 ? b
|
||||
: b.operator === '>' && a.operator === '>=' ? b
|
||||
: a
|
||||
}
|
||||
|
||||
// <=1.2.3 is higher than <1.2.3
|
||||
const lowerLT = (a, b, options) => {
|
||||
if (!a) {
|
||||
return b
|
||||
}
|
||||
const comp = compare(a.semver, b.semver, options)
|
||||
return comp < 0 ? a
|
||||
: comp > 0 ? b
|
||||
: b.operator === '<' && a.operator === '<=' ? b
|
||||
: a
|
||||
}
|
||||
|
||||
module.exports = subset
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"52":0.00497,"59":0.04473,"60":0.00497,"78":0.00994,"102":0.00497,"113":0.00497,"115":0.11928,"124":0.00497,"127":0.00497,"128":0.18886,"133":0.00994,"134":0.06461,"135":0.38766,"136":1.24747,"137":0.00497,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 114 116 117 118 119 120 121 122 123 125 126 129 130 131 132 138 139 140 3.5 3.6"},D:{"38":0.00497,"41":0.00497,"49":0.00497,"65":0.01491,"66":0.1988,"79":0.00994,"87":0.01988,"88":0.00994,"90":0.00497,"91":0.00497,"93":0.00497,"94":0.00497,"99":0.00497,"102":0.01491,"103":0.02982,"104":0.00994,"106":0.00994,"108":0.01988,"109":0.21868,"110":0.00497,"111":0.00994,"112":0.00497,"113":0.02485,"114":0.05467,"115":0.00497,"116":0.0994,"117":0.00497,"118":7.56931,"119":0.00497,"120":0.01491,"121":0.00994,"122":0.06958,"123":0.04473,"124":0.02982,"125":0.07455,"126":0.14413,"127":0.04473,"128":0.10437,"129":0.08946,"130":0.06461,"131":0.59143,"132":1.2922,"133":7.86751,"134":12.26099,"135":0.01988,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 39 40 42 43 44 45 46 47 48 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 67 68 69 70 71 72 73 74 75 76 77 78 80 81 83 84 85 86 89 92 95 96 97 98 100 101 105 107 136 137 138"},F:{"69":0.00497,"87":0.00994,"88":0.00497,"95":0.01988,"108":0.00497,"114":0.00994,"115":0.00497,"116":0.51191,"117":1.41148,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 109 110 111 112 113 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"17":0.02485,"92":0.00497,"108":0.00497,"109":0.04473,"114":0.00497,"115":0.00497,"116":0.00497,"122":0.00497,"124":0.00497,"125":0.00497,"126":0.00497,"127":0.00497,"128":0.00497,"129":0.00497,"130":0.01988,"131":0.0497,"132":0.08946,"133":2.01285,"134":4.61713,_:"12 13 14 15 16 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 110 111 112 113 117 118 119 120 121 123"},E:{"14":0.00994,"15":0.00497,_:"0 4 5 6 7 8 9 10 11 12 13 3.1 3.2 5.1 6.1 7.1 9.1 10.1","11.1":0.03479,"12.1":0.00994,"13.1":0.02485,"14.1":0.0497,"15.1":0.00497,"15.2-15.3":0.00994,"15.4":0.01988,"15.5":0.01988,"15.6":0.27832,"16.0":0.03479,"16.1":0.03479,"16.2":0.04473,"16.3":0.07952,"16.4":0.03479,"16.5":0.02982,"16.6":0.40754,"17.0":0.01988,"17.1":0.38766,"17.2":0.04473,"17.3":0.03976,"17.4":0.09443,"17.5":0.21868,"17.6":0.55664,"18.0":0.07455,"18.1":0.30814,"18.2":0.12425,"18.3":3.19074,"18.4":0.02485},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00571,"5.0-5.1":0,"6.0-6.1":0.01713,"7.0-7.1":0.01142,"8.1-8.4":0,"9.0-9.2":0.00856,"9.3":0.03996,"10.0-10.2":0.00285,"10.3":0.06565,"11.0-11.2":0.30258,"11.3-11.4":0.01998,"12.0-12.1":0.01142,"12.2-12.5":0.2826,"13.0-13.1":0.00571,"13.2":0.00856,"13.3":0.01142,"13.4-13.7":0.03996,"14.0-14.4":0.09991,"14.5-14.8":0.11989,"15.0-15.1":0.06565,"15.2-15.3":0.06565,"15.4":0.07993,"15.5":0.09134,"15.6-15.8":1.12468,"16.0":0.15985,"16.1":0.32827,"16.2":0.17127,"16.3":0.29687,"16.4":0.06565,"16.5":0.12274,"16.6-16.7":1.33306,"17.0":0.07993,"17.1":0.14273,"17.2":0.10847,"17.3":0.15129,"17.4":0.30258,"17.5":0.67367,"17.6-17.7":1.95535,"18.0":0.54807,"18.1":1.79264,"18.2":0.80212,"18.3":16.76463,"18.4":0.24834},P:{"4":0.03128,"21":0.01043,"23":0.01043,"24":0.01043,"25":0.01043,"26":0.0417,"27":3.29456,_:"20 22 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","5.0-5.4":0.01043,"7.2-7.4":0.01043},I:{"0":0.01506,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00002},K:{"0":0.24144,_:"10 11 12 11.1 11.5 12.1"},A:{"11":0.00994,_:"6 7 8 9 10 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},R:{_:"0"},M:{"0":0.45773},Q:{_:"14.9"},O:{"0":0.02012},H:{"0":0},L:{"0":17.60852}};
|
||||
@@ -0,0 +1,29 @@
|
||||
import {
|
||||
defaultGetScrollRestorationKey,
|
||||
restoreScroll,
|
||||
storageKey,
|
||||
} from '@tanstack/router-core'
|
||||
import { useRouter } from './useRouter'
|
||||
import { ScriptOnce } from './ScriptOnce'
|
||||
|
||||
export function ScrollRestoration() {
|
||||
const router = useRouter()
|
||||
const getKey =
|
||||
router.options.getScrollRestorationKey || defaultGetScrollRestorationKey
|
||||
const userKey = getKey(router.latestLocation)
|
||||
const resolvedKey =
|
||||
userKey !== defaultGetScrollRestorationKey(router.latestLocation)
|
||||
? userKey
|
||||
: null
|
||||
|
||||
if (!router.isScrollRestoring || !router.isServer) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<ScriptOnce
|
||||
children={`(${restoreScroll.toString()})(${JSON.stringify(storageKey)},${JSON.stringify(resolvedKey)}, undefined, true)`}
|
||||
log={false}
|
||||
/>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"1":"Q","2":"0 9 C L M G N O P H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I"},C:{"2":"0 1 2 3 4 5 6 7 8 9 nC LC J PB K D E F A B C L M G N O P QB RB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC qC rC","66":"SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB"},D:{"1":"YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q","2":"0 1 2 3 4 5 9 J PB K D E F A B C L M G N O P QB H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","33":"6 7 8 RB SB TB UB VB WB XB"},E:{"2":"J PB K D E F A B C L M G sC SC tC uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C"},F:{"1":"3 4 5 6 7 8 RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B","2":"0 F B C 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 4C 5C 6C 7C FC kC 8C GC","33":"1 2 G N O P QB"},G:{"2":"E SC 9C lC AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC"},H:{"2":"WD"},I:{"2":"LC J I XD YD ZD aD lC","33":"bD cD"},J:{"2":"D A"},K:{"2":"A B C H FC kC GC"},L:{"2":"I"},M:{"2":"EC"},N:{"2":"A B"},O:{"2":"HC"},P:{"1":"dD eD fD gD hD TC iD jD","2":"1 2 3 4 5 6 7 8 kD lD mD IC JC KC nD","33":"J"},Q:{"1":"oD"},R:{"2":"pD"},S:{"1":"qD","2":"rD"}},B:7,C:"Shadow DOM (deprecated V0 spec)",D:true};
|
||||
@@ -0,0 +1,267 @@
|
||||
/**
|
||||
* @fileoverview Rule to enforce grouped require statements for Node.JS
|
||||
* @author Raphael Pigulla
|
||||
* @deprecated in ESLint v7.0.0
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
deprecated: {
|
||||
message: "Node.js rules were moved out of ESLint core.",
|
||||
url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
|
||||
deprecatedSince: "7.0.0",
|
||||
availableUntil: null,
|
||||
replacedBy: [
|
||||
{
|
||||
message:
|
||||
"eslint-plugin-n now maintains deprecated Node.js-related rules.",
|
||||
plugin: {
|
||||
name: "eslint-plugin-n",
|
||||
url: "https://github.com/eslint-community/eslint-plugin-n",
|
||||
},
|
||||
rule: {
|
||||
name: "no-mixed-requires",
|
||||
url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-mixed-requires.md",
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
type: "suggestion",
|
||||
|
||||
docs: {
|
||||
description:
|
||||
"Disallow `require` calls to be mixed with regular variable declarations",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/latest/rules/no-mixed-requires",
|
||||
},
|
||||
|
||||
schema: [
|
||||
{
|
||||
oneOf: [
|
||||
{
|
||||
type: "boolean",
|
||||
},
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
grouping: {
|
||||
type: "boolean",
|
||||
},
|
||||
allowCall: {
|
||||
type: "boolean",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
messages: {
|
||||
noMixRequire: "Do not mix 'require' and other declarations.",
|
||||
noMixCoreModuleFileComputed:
|
||||
"Do not mix core, module, file and computed requires.",
|
||||
},
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const options = context.options[0];
|
||||
let grouping = false,
|
||||
allowCall = false;
|
||||
|
||||
if (typeof options === "object") {
|
||||
grouping = options.grouping;
|
||||
allowCall = options.allowCall;
|
||||
} else {
|
||||
grouping = !!options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of built-in modules.
|
||||
* @returns {string[]} An array of built-in Node.js modules.
|
||||
*/
|
||||
function getBuiltinModules() {
|
||||
/*
|
||||
* This list is generated using:
|
||||
* `require("repl")._builtinLibs.concat('repl').sort()`
|
||||
* This particular list is as per nodejs v0.12.2 and iojs v0.7.1
|
||||
*/
|
||||
return [
|
||||
"assert",
|
||||
"buffer",
|
||||
"child_process",
|
||||
"cluster",
|
||||
"crypto",
|
||||
"dgram",
|
||||
"dns",
|
||||
"domain",
|
||||
"events",
|
||||
"fs",
|
||||
"http",
|
||||
"https",
|
||||
"net",
|
||||
"os",
|
||||
"path",
|
||||
"punycode",
|
||||
"querystring",
|
||||
"readline",
|
||||
"repl",
|
||||
"smalloc",
|
||||
"stream",
|
||||
"string_decoder",
|
||||
"tls",
|
||||
"tty",
|
||||
"url",
|
||||
"util",
|
||||
"v8",
|
||||
"vm",
|
||||
"zlib",
|
||||
];
|
||||
}
|
||||
|
||||
const BUILTIN_MODULES = getBuiltinModules();
|
||||
|
||||
const DECL_REQUIRE = "require",
|
||||
DECL_UNINITIALIZED = "uninitialized",
|
||||
DECL_OTHER = "other";
|
||||
|
||||
const REQ_CORE = "core",
|
||||
REQ_FILE = "file",
|
||||
REQ_MODULE = "module",
|
||||
REQ_COMPUTED = "computed";
|
||||
|
||||
/**
|
||||
* Determines the type of a declaration statement.
|
||||
* @param {ASTNode} initExpression The init node of the VariableDeclarator.
|
||||
* @returns {string} The type of declaration represented by the expression.
|
||||
*/
|
||||
function getDeclarationType(initExpression) {
|
||||
if (!initExpression) {
|
||||
// "var x;"
|
||||
return DECL_UNINITIALIZED;
|
||||
}
|
||||
|
||||
if (
|
||||
initExpression.type === "CallExpression" &&
|
||||
initExpression.callee.type === "Identifier" &&
|
||||
initExpression.callee.name === "require"
|
||||
) {
|
||||
// "var x = require('util');"
|
||||
return DECL_REQUIRE;
|
||||
}
|
||||
if (
|
||||
allowCall &&
|
||||
initExpression.type === "CallExpression" &&
|
||||
initExpression.callee.type === "CallExpression"
|
||||
) {
|
||||
// "var x = require('diagnose')('sub-module');"
|
||||
return getDeclarationType(initExpression.callee);
|
||||
}
|
||||
if (initExpression.type === "MemberExpression") {
|
||||
// "var x = require('glob').Glob;"
|
||||
return getDeclarationType(initExpression.object);
|
||||
}
|
||||
|
||||
// "var x = 42;"
|
||||
return DECL_OTHER;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines the type of module that is loaded via require.
|
||||
* @param {ASTNode} initExpression The init node of the VariableDeclarator.
|
||||
* @returns {string} The module type.
|
||||
*/
|
||||
function inferModuleType(initExpression) {
|
||||
if (initExpression.type === "MemberExpression") {
|
||||
// "var x = require('glob').Glob;"
|
||||
return inferModuleType(initExpression.object);
|
||||
}
|
||||
if (initExpression.arguments.length === 0) {
|
||||
// "var x = require();"
|
||||
return REQ_COMPUTED;
|
||||
}
|
||||
|
||||
const arg = initExpression.arguments[0];
|
||||
|
||||
if (arg.type !== "Literal" || typeof arg.value !== "string") {
|
||||
// "var x = require(42);"
|
||||
return REQ_COMPUTED;
|
||||
}
|
||||
|
||||
if (BUILTIN_MODULES.includes(arg.value)) {
|
||||
// "var fs = require('fs');"
|
||||
return REQ_CORE;
|
||||
}
|
||||
if (/^\.{0,2}\//u.test(arg.value)) {
|
||||
// "var utils = require('./utils');"
|
||||
return REQ_FILE;
|
||||
}
|
||||
|
||||
// "var async = require('async');"
|
||||
return REQ_MODULE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the list of variable declarations is mixed, i.e. whether it
|
||||
* contains both require and other declarations.
|
||||
* @param {ASTNode} declarations The list of VariableDeclarators.
|
||||
* @returns {boolean} True if the declarations are mixed, false if not.
|
||||
*/
|
||||
function isMixed(declarations) {
|
||||
const contains = {};
|
||||
|
||||
declarations.forEach(declaration => {
|
||||
const type = getDeclarationType(declaration.init);
|
||||
|
||||
contains[type] = true;
|
||||
});
|
||||
|
||||
return !!(
|
||||
contains[DECL_REQUIRE] &&
|
||||
(contains[DECL_UNINITIALIZED] || contains[DECL_OTHER])
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if all require declarations in the given list are of the same
|
||||
* type.
|
||||
* @param {ASTNode} declarations The list of VariableDeclarators.
|
||||
* @returns {boolean} True if the declarations are grouped, false if not.
|
||||
*/
|
||||
function isGrouped(declarations) {
|
||||
const found = {};
|
||||
|
||||
declarations.forEach(declaration => {
|
||||
if (getDeclarationType(declaration.init) === DECL_REQUIRE) {
|
||||
found[inferModuleType(declaration.init)] = true;
|
||||
}
|
||||
});
|
||||
|
||||
return Object.keys(found).length <= 1;
|
||||
}
|
||||
|
||||
return {
|
||||
VariableDeclaration(node) {
|
||||
if (isMixed(node.declarations)) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: "noMixRequire",
|
||||
});
|
||||
} else if (grouping && !isGrouped(node.declarations)) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: "noMixCoreModuleFileComputed",
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,95 @@
|
||||
/**
|
||||
* @fileoverview A rule to disallow unnecessary `.call()` and `.apply()`.
|
||||
* @author Toru Nagashima
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
const astUtils = require("./utils/ast-utils");
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Checks whether or not a node is a `.call()`/`.apply()`.
|
||||
* @param {ASTNode} node A CallExpression node to check.
|
||||
* @returns {boolean} Whether or not the node is a `.call()`/`.apply()`.
|
||||
*/
|
||||
function isCallOrNonVariadicApply(node) {
|
||||
const callee = astUtils.skipChainExpression(node.callee);
|
||||
|
||||
return (
|
||||
callee.type === "MemberExpression" &&
|
||||
callee.property.type === "Identifier" &&
|
||||
callee.computed === false &&
|
||||
((callee.property.name === "call" && node.arguments.length >= 1) ||
|
||||
(callee.property.name === "apply" &&
|
||||
node.arguments.length === 2 &&
|
||||
node.arguments[1].type === "ArrayExpression"))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether or not `thisArg` is not changed by `.call()`/`.apply()`.
|
||||
* @param {ASTNode|null} expectedThis The node that is the owner of the applied function.
|
||||
* @param {ASTNode} thisArg The node that is given to the first argument of the `.call()`/`.apply()`.
|
||||
* @param {SourceCode} sourceCode The ESLint source code object.
|
||||
* @returns {boolean} Whether or not `thisArg` is not changed by `.call()`/`.apply()`.
|
||||
*/
|
||||
function isValidThisArg(expectedThis, thisArg, sourceCode) {
|
||||
if (!expectedThis) {
|
||||
return astUtils.isNullOrUndefined(thisArg);
|
||||
}
|
||||
return astUtils.equalTokens(expectedThis, thisArg, sourceCode);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
|
||||
docs: {
|
||||
description:
|
||||
"Disallow unnecessary calls to `.call()` and `.apply()`",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/latest/rules/no-useless-call",
|
||||
},
|
||||
|
||||
schema: [],
|
||||
|
||||
messages: {
|
||||
unnecessaryCall: "Unnecessary '.{{name}}()'.",
|
||||
},
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const sourceCode = context.sourceCode;
|
||||
|
||||
return {
|
||||
CallExpression(node) {
|
||||
if (!isCallOrNonVariadicApply(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const callee = astUtils.skipChainExpression(node.callee);
|
||||
const applied = astUtils.skipChainExpression(callee.object);
|
||||
const expectedThis =
|
||||
applied.type === "MemberExpression" ? applied.object : null;
|
||||
const thisArg = node.arguments[0];
|
||||
|
||||
if (isValidThisArg(expectedThis, thisArg, sourceCode)) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: "unnecessaryCall",
|
||||
data: { name: callee.property.name },
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.findPackageData = findPackageData;
|
||||
function _path() {
|
||||
const data = require("path");
|
||||
_path = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
var _utils = require("./utils.js");
|
||||
var _configError = require("../../errors/config-error.js");
|
||||
const PACKAGE_FILENAME = "package.json";
|
||||
const readConfigPackage = (0, _utils.makeStaticFileCache)((filepath, content) => {
|
||||
let options;
|
||||
try {
|
||||
options = JSON.parse(content);
|
||||
} catch (err) {
|
||||
throw new _configError.default(`Error while parsing JSON - ${err.message}`, filepath);
|
||||
}
|
||||
if (!options) throw new Error(`${filepath}: No config detected`);
|
||||
if (typeof options !== "object") {
|
||||
throw new _configError.default(`Config returned typeof ${typeof options}`, filepath);
|
||||
}
|
||||
if (Array.isArray(options)) {
|
||||
throw new _configError.default(`Expected config object but found array`, filepath);
|
||||
}
|
||||
return {
|
||||
filepath,
|
||||
dirname: _path().dirname(filepath),
|
||||
options
|
||||
};
|
||||
});
|
||||
function* findPackageData(filepath) {
|
||||
let pkg = null;
|
||||
const directories = [];
|
||||
let isPackage = true;
|
||||
let dirname = _path().dirname(filepath);
|
||||
while (!pkg && _path().basename(dirname) !== "node_modules") {
|
||||
directories.push(dirname);
|
||||
pkg = yield* readConfigPackage(_path().join(dirname, PACKAGE_FILENAME));
|
||||
const nextLoc = _path().dirname(dirname);
|
||||
if (dirname === nextLoc) {
|
||||
isPackage = false;
|
||||
break;
|
||||
}
|
||||
dirname = nextLoc;
|
||||
}
|
||||
return {
|
||||
filepath,
|
||||
directories,
|
||||
pkg,
|
||||
isPackage
|
||||
};
|
||||
}
|
||||
0 && 0;
|
||||
|
||||
//# sourceMappingURL=package.js.map
|
||||
@@ -0,0 +1,2 @@
|
||||
export const rootRouteId = '__root__'
|
||||
export type RootRouteId = typeof rootRouteId
|
||||
@@ -0,0 +1,412 @@
|
||||
export { TSR_DEFERRED_PROMISE, defer } from './defer'
|
||||
export type { DeferredPromiseState, DeferredPromise } from './defer'
|
||||
export { preloadWarning } from './link'
|
||||
export type {
|
||||
IsRequiredParams,
|
||||
ParsePathParams,
|
||||
AddTrailingSlash,
|
||||
RemoveTrailingSlashes,
|
||||
AddLeadingSlash,
|
||||
RemoveLeadingSlashes,
|
||||
ActiveOptions,
|
||||
LinkOptionsProps,
|
||||
ResolveCurrentPath,
|
||||
ResolveParentPath,
|
||||
ResolveRelativePath,
|
||||
LinkCurrentTargetElement,
|
||||
FindDescendantToPaths,
|
||||
InferDescendantToPaths,
|
||||
RelativeToPath,
|
||||
RelativeToParentPath,
|
||||
RelativeToCurrentPath,
|
||||
AbsoluteToPath,
|
||||
RelativeToPathAutoComplete,
|
||||
NavigateOptions,
|
||||
ToOptions,
|
||||
ToMaskOptions,
|
||||
ToSubOptions,
|
||||
ResolveRoute,
|
||||
SearchParamOptions,
|
||||
PathParamOptions,
|
||||
ToPathOption,
|
||||
LinkOptions,
|
||||
MakeOptionalPathParams,
|
||||
FromPathOption,
|
||||
MakeOptionalSearchParams,
|
||||
MaskOptions,
|
||||
ToSubOptionsProps,
|
||||
RequiredToOptions,
|
||||
} from './link'
|
||||
|
||||
export type {
|
||||
RouteToPath,
|
||||
TrailingSlashOptionByRouter,
|
||||
ParseRoute,
|
||||
CodeRouteToPath,
|
||||
RouteIds,
|
||||
FullSearchSchema,
|
||||
FullSearchSchemaInput,
|
||||
AllParams,
|
||||
RouteById,
|
||||
AllContext,
|
||||
RoutePaths,
|
||||
RoutesById,
|
||||
RoutesByPath,
|
||||
AllLoaderData,
|
||||
RouteByPath,
|
||||
} from './routeInfo'
|
||||
|
||||
export type {
|
||||
InferFileRouteTypes,
|
||||
FileRouteTypes,
|
||||
FileRoutesByPath,
|
||||
LazyRoute,
|
||||
LazyRouteOptions,
|
||||
} from './fileRoute'
|
||||
|
||||
export type {
|
||||
StartSerializer,
|
||||
Serializable,
|
||||
SerializerParse,
|
||||
SerializerParseBy,
|
||||
SerializerStringify,
|
||||
SerializerStringifyBy,
|
||||
SerializerExtensions,
|
||||
} from './serializer'
|
||||
|
||||
export type { ParsedLocation } from './location'
|
||||
export type { Manifest, RouterManagedTag } from './manifest'
|
||||
export { isMatch } from './Matches'
|
||||
export type {
|
||||
AnyMatchAndValue,
|
||||
FindValueByIndex,
|
||||
FindValueByKey,
|
||||
CreateMatchAndValue,
|
||||
NextMatchAndValue,
|
||||
IsMatchKeyOf,
|
||||
IsMatchPath,
|
||||
IsMatchResult,
|
||||
IsMatchParse,
|
||||
IsMatch,
|
||||
RouteMatch,
|
||||
RouteMatchExtensions,
|
||||
MakeRouteMatchUnion,
|
||||
MakeRouteMatch,
|
||||
AnyRouteMatch,
|
||||
MakeRouteMatchFromRoute,
|
||||
MatchRouteOptions,
|
||||
} from './Matches'
|
||||
export {
|
||||
joinPaths,
|
||||
cleanPath,
|
||||
trimPathLeft,
|
||||
trimPathRight,
|
||||
trimPath,
|
||||
removeTrailingSlash,
|
||||
exactPathTest,
|
||||
resolvePath,
|
||||
parsePathname,
|
||||
interpolatePath,
|
||||
matchPathname,
|
||||
removeBasepath,
|
||||
matchByPath,
|
||||
} from './path'
|
||||
export type { Segment } from './path'
|
||||
export { encode, decode } from './qss'
|
||||
export { rootRouteId } from './root'
|
||||
export type { RootRouteId } from './root'
|
||||
|
||||
export { BaseRoute, BaseRouteApi, BaseRootRoute } from './route'
|
||||
export type {
|
||||
AnyPathParams,
|
||||
SearchSchemaInput,
|
||||
AnyContext,
|
||||
RouteContext,
|
||||
PreloadableObj,
|
||||
RoutePathOptions,
|
||||
StaticDataRouteOption,
|
||||
RoutePathOptionsIntersection,
|
||||
SearchFilter,
|
||||
SearchMiddlewareContext,
|
||||
SearchMiddleware,
|
||||
ResolveId,
|
||||
InferFullSearchSchema,
|
||||
InferFullSearchSchemaInput,
|
||||
InferAllParams,
|
||||
InferAllContext,
|
||||
MetaDescriptor,
|
||||
RouteLinkEntry,
|
||||
SearchValidator,
|
||||
AnySearchValidator,
|
||||
DefaultSearchValidator,
|
||||
ErrorRouteProps,
|
||||
ErrorComponentProps,
|
||||
NotFoundRouteProps,
|
||||
ParseSplatParams,
|
||||
SplatParams,
|
||||
ResolveParams,
|
||||
ParseParamsFn,
|
||||
StringifyParamsFn,
|
||||
ParamsOptions,
|
||||
UpdatableStaticRouteOption,
|
||||
LooseReturnType,
|
||||
LooseAsyncReturnType,
|
||||
ContextReturnType,
|
||||
ContextAsyncReturnType,
|
||||
ResolveRouteContext,
|
||||
ResolveLoaderData,
|
||||
RoutePrefix,
|
||||
TrimPath,
|
||||
TrimPathLeft,
|
||||
TrimPathRight,
|
||||
ResolveSearchSchemaFnInput,
|
||||
ResolveSearchSchemaInput,
|
||||
ResolveSearchSchemaFn,
|
||||
ResolveSearchSchema,
|
||||
ResolveFullSearchSchema,
|
||||
ResolveFullSearchSchemaInput,
|
||||
ResolveAllContext,
|
||||
BeforeLoadContextParameter,
|
||||
RouteContextParameter,
|
||||
ResolveAllParamsFromParent,
|
||||
AnyRoute,
|
||||
Route,
|
||||
RouteTypes,
|
||||
FullSearchSchemaOption,
|
||||
RemountDepsOptions,
|
||||
MakeRemountDepsOptionsUnion,
|
||||
ResolveFullPath,
|
||||
AnyRouteWithContext,
|
||||
RouteOptions,
|
||||
FileBaseRouteOptions,
|
||||
BaseRouteOptions,
|
||||
UpdatableRouteOptions,
|
||||
RouteLoaderFn,
|
||||
LoaderFnContext,
|
||||
RouteContextFn,
|
||||
BeforeLoadFn,
|
||||
ContextOptions,
|
||||
RouteContextOptions,
|
||||
BeforeLoadContextOptions,
|
||||
RootRouteOptions,
|
||||
UpdatableRouteOptionsExtensions,
|
||||
RouteConstraints,
|
||||
RouteTypesById,
|
||||
RouteMask,
|
||||
RouteExtensions,
|
||||
RouteLazyFn,
|
||||
RouteAddChildrenFn,
|
||||
RouteAddFileChildrenFn,
|
||||
RouteAddFileTypesFn,
|
||||
} from './route'
|
||||
|
||||
export {
|
||||
defaultSerializeError,
|
||||
getLocationChangeInfo,
|
||||
RouterCore,
|
||||
componentTypes,
|
||||
lazyFn,
|
||||
SearchParamError,
|
||||
PathParamError,
|
||||
getInitialRouterState,
|
||||
} from './router'
|
||||
export type {
|
||||
ViewTransitionOptions,
|
||||
ExtractedBaseEntry,
|
||||
ExtractedStream,
|
||||
ExtractedPromise,
|
||||
ExtractedEntry,
|
||||
StreamState,
|
||||
TrailingSlashOption,
|
||||
Register,
|
||||
AnyRouter,
|
||||
AnyRouterWithContext,
|
||||
RegisteredRouter,
|
||||
RouterState,
|
||||
BuildNextOptions,
|
||||
RouterListener,
|
||||
RouterEvent,
|
||||
ListenerFn,
|
||||
RouterEvents,
|
||||
MatchRoutesOpts,
|
||||
RouterOptionsExtensions,
|
||||
DefaultRemountDepsFn,
|
||||
PreloadRouteFn,
|
||||
MatchRouteFn,
|
||||
RouterContextOptions,
|
||||
RouterOptions,
|
||||
RouterConstructorOptions,
|
||||
UpdateFn,
|
||||
ParseLocationFn,
|
||||
InvalidateFn,
|
||||
ControllablePromise,
|
||||
InjectedHtmlEntry,
|
||||
RouterErrorSerializer,
|
||||
MatchedRoutesResult,
|
||||
EmitFn,
|
||||
LoadFn,
|
||||
GetMatchFn,
|
||||
SubscribeFn,
|
||||
UpdateMatchFn,
|
||||
CommitLocationFn,
|
||||
GetMatchRoutesFn,
|
||||
MatchRoutesFn,
|
||||
StartTransitionFn,
|
||||
LoadRouteChunkFn,
|
||||
ServerSrr,
|
||||
ClearCacheFn,
|
||||
CreateRouterFn,
|
||||
} from './router'
|
||||
|
||||
export type {
|
||||
MatchLocation,
|
||||
CommitLocationOptions,
|
||||
NavigateFn,
|
||||
BuildLocationFn,
|
||||
} from './RouterProvider'
|
||||
|
||||
export { retainSearchParams, stripSearchParams } from './searchMiddleware'
|
||||
|
||||
export {
|
||||
defaultParseSearch,
|
||||
defaultStringifySearch,
|
||||
parseSearchWith,
|
||||
stringifySearchWith,
|
||||
} from './searchParams'
|
||||
export type { SearchSerializer, SearchParser } from './searchParams'
|
||||
|
||||
export type { OptionalStructuralSharing } from './structuralSharing'
|
||||
|
||||
export {
|
||||
last,
|
||||
functionalUpdate,
|
||||
pick,
|
||||
replaceEqualDeep,
|
||||
isPlainObject,
|
||||
isPlainArray,
|
||||
deepEqual,
|
||||
escapeJSON,
|
||||
shallow,
|
||||
createControlledPromise,
|
||||
} from './utils'
|
||||
export type {
|
||||
NoInfer,
|
||||
IsAny,
|
||||
PickAsRequired,
|
||||
PickRequired,
|
||||
PickOptional,
|
||||
WithoutEmpty,
|
||||
Expand,
|
||||
DeepPartial,
|
||||
MakeDifferenceOptional,
|
||||
IsUnion,
|
||||
IsNonEmptyObject,
|
||||
Assign,
|
||||
IntersectAssign,
|
||||
Timeout,
|
||||
Updater,
|
||||
NonNullableUpdater,
|
||||
StringLiteral,
|
||||
ThrowOrOptional,
|
||||
ThrowConstraint,
|
||||
ControlledPromise,
|
||||
ExtractObjects,
|
||||
PartialMergeAllObject,
|
||||
MergeAllPrimitive,
|
||||
ExtractPrimitives,
|
||||
PartialMergeAll,
|
||||
Constrain,
|
||||
ConstrainLiteral,
|
||||
UnionToIntersection,
|
||||
MergeAllObjects,
|
||||
MergeAll,
|
||||
ValidateJSON,
|
||||
StrictOrFrom,
|
||||
} from './utils'
|
||||
|
||||
export type {
|
||||
StandardSchemaValidatorProps,
|
||||
StandardSchemaValidator,
|
||||
AnyStandardSchemaValidator,
|
||||
StandardSchemaValidatorTypes,
|
||||
AnyStandardSchemaValidateSuccess,
|
||||
AnyStandardSchemaValidateFailure,
|
||||
AnyStandardSchemaValidateIssue,
|
||||
AnyStandardSchemaValidateInput,
|
||||
AnyStandardSchemaValidate,
|
||||
ValidatorObj,
|
||||
AnyValidatorObj,
|
||||
ValidatorAdapter,
|
||||
AnyValidatorAdapter,
|
||||
AnyValidatorFn,
|
||||
ValidatorFn,
|
||||
Validator,
|
||||
AnyValidator,
|
||||
AnySchema,
|
||||
DefaultValidator,
|
||||
ResolveSearchValidatorInputFn,
|
||||
ResolveSearchValidatorInput,
|
||||
ResolveValidatorInputFn,
|
||||
ResolveValidatorInput,
|
||||
ResolveValidatorOutputFn,
|
||||
ResolveValidatorOutput,
|
||||
} from './validators'
|
||||
|
||||
export type {
|
||||
UseRouteContextBaseOptions,
|
||||
UseRouteContextOptions,
|
||||
UseRouteContextResult,
|
||||
} from './useRouteContext'
|
||||
|
||||
export type { UseSearchResult, ResolveUseSearch } from './useSearch'
|
||||
|
||||
export type { UseParamsResult, ResolveUseParams } from './useParams'
|
||||
|
||||
export type { UseNavigateResult } from './useNavigate'
|
||||
|
||||
export type { UseLoaderDepsResult, ResolveUseLoaderDeps } from './useLoaderDeps'
|
||||
|
||||
export type { UseLoaderDataResult, ResolveUseLoaderData } from './useLoaderData'
|
||||
|
||||
export type { Redirect, ResolvedRedirect, AnyRedirect } from './redirect'
|
||||
|
||||
export { redirect, isRedirect, isResolvedRedirect } from './redirect'
|
||||
|
||||
export type { NotFoundError } from './not-found'
|
||||
export { isNotFound, notFound } from './not-found'
|
||||
|
||||
export {
|
||||
defaultGetScrollRestorationKey,
|
||||
restoreScroll,
|
||||
storageKey,
|
||||
getCssSelector,
|
||||
scrollRestorationCache,
|
||||
setupScrollRestoration,
|
||||
handleHashScroll,
|
||||
} from './scroll-restoration'
|
||||
|
||||
export type {
|
||||
ScrollRestorationOptions,
|
||||
ScrollRestorationEntry,
|
||||
} from './scroll-restoration'
|
||||
|
||||
export type {
|
||||
ValidateFromPath,
|
||||
ValidateToPath,
|
||||
ValidateSearch,
|
||||
ValidateParams,
|
||||
InferFrom,
|
||||
InferTo,
|
||||
InferMaskTo,
|
||||
InferMaskFrom,
|
||||
ValidateNavigateOptions,
|
||||
ValidateNavigateOptionsArray,
|
||||
ValidateRedirectOptions,
|
||||
ValidateRedirectOptionsArray,
|
||||
ValidateId,
|
||||
InferStrict,
|
||||
InferShouldThrow,
|
||||
InferSelected,
|
||||
ValidateUseSearchResult,
|
||||
ValidateUseParamsResult,
|
||||
} from './typePrimitives'
|
||||
@@ -0,0 +1,102 @@
|
||||
/**
|
||||
* @fileoverview Rule to flag use of unary increment and decrement operators.
|
||||
* @author Ian Christian Myers
|
||||
* @author Brody McKee (github.com/mrmckeb)
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Helpers
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Determines whether the given node is the update node of a `ForStatement`.
|
||||
* @param {ASTNode} node The node to check.
|
||||
* @returns {boolean} `true` if the node is `ForStatement` update.
|
||||
*/
|
||||
function isForStatementUpdate(node) {
|
||||
const parent = node.parent;
|
||||
|
||||
return parent.type === "ForStatement" && parent.update === node;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether the given node is considered to be a for loop "afterthought" by the logic of this rule.
|
||||
* In particular, it returns `true` if the given node is either:
|
||||
* - The update node of a `ForStatement`: for (;; i++) {}
|
||||
* - An operand of a sequence expression that is the update node: for (;; foo(), i++) {}
|
||||
* - An operand of a sequence expression that is child of another sequence expression, etc.,
|
||||
* up to the sequence expression that is the update node: for (;; foo(), (bar(), (baz(), i++))) {}
|
||||
* @param {ASTNode} node The node to check.
|
||||
* @returns {boolean} `true` if the node is a for loop afterthought.
|
||||
*/
|
||||
function isForLoopAfterthought(node) {
|
||||
const parent = node.parent;
|
||||
|
||||
if (parent.type === "SequenceExpression") {
|
||||
return isForLoopAfterthought(parent);
|
||||
}
|
||||
|
||||
return isForStatementUpdate(node);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
|
||||
defaultOptions: [
|
||||
{
|
||||
allowForLoopAfterthoughts: false,
|
||||
},
|
||||
],
|
||||
|
||||
docs: {
|
||||
description: "Disallow the unary operators `++` and `--`",
|
||||
recommended: false,
|
||||
frozen: true,
|
||||
url: "https://eslint.org/docs/latest/rules/no-plusplus",
|
||||
},
|
||||
|
||||
schema: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
allowForLoopAfterthoughts: {
|
||||
type: "boolean",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
|
||||
messages: {
|
||||
unexpectedUnaryOp: "Unary operator '{{operator}}' used.",
|
||||
},
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const [{ allowForLoopAfterthoughts }] = context.options;
|
||||
|
||||
return {
|
||||
UpdateExpression(node) {
|
||||
if (allowForLoopAfterthoughts && isForLoopAfterthought(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
context.report({
|
||||
node,
|
||||
messageId: "unexpectedUnaryOp",
|
||||
data: {
|
||||
operator: node.operator,
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
declare module 'fast-deep-equal' {
|
||||
const equal: (a: any, b: any) => boolean;
|
||||
export = equal;
|
||||
}
|
||||
Reference in New Issue
Block a user