Update checked-in dependencies
This commit is contained in:
parent
99c9f6a498
commit
e266801e21
242 changed files with 2638 additions and 9296 deletions
177
node_modules/.package-lock.json
generated
vendored
177
node_modules/.package-lock.json
generated
vendored
|
|
@ -808,24 +808,6 @@
|
|||
"resolved": "https://registry.npmjs.org/@schemastore/package/-/package-0.0.8.tgz",
|
||||
"integrity": "sha512-1jMrmFLUZBeQ7zdxe3ez1LSLYrUH4eY3gAPisW1rbNZ62zoYy8sudo9fXSS182s8f7p6TRy7wD6ybZvz9SUT1Q=="
|
||||
},
|
||||
"node_modules/@sinonjs/commons": {
|
||||
"version": "1.8.3",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz",
|
||||
"integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"type-detect": "4.0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/@sinonjs/fake-timers": {
|
||||
"version": "7.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-7.1.2.tgz",
|
||||
"integrity": "sha512-iQADsW4LBMISqZ6Ci1dupJL9pprqwcVFTcOsEmQOEhW+KLCVn/Y4Jrvg2k19fIHCp+iFprriYPTdRcQR8NbUPg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@sinonjs/commons": "^1.7.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@sinonjs/samsam": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-8.0.0.tgz",
|
||||
|
|
@ -924,14 +906,20 @@
|
|||
"dev": true
|
||||
},
|
||||
"node_modules/@types/sinon": {
|
||||
"version": "10.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.2.tgz",
|
||||
"integrity": "sha512-BHn8Bpkapj8Wdfxvh2jWIUoaYB/9/XhsL0oOvBfRagJtKlSl9NWPcFOz2lRukI9szwGxFtYZCTejJSqsGDbdmw==",
|
||||
"version": "10.0.15",
|
||||
"resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.15.tgz",
|
||||
"integrity": "sha512-3lrFNQG0Kr2LDzvjyjB6AMJk4ge+8iYhQfdnSwIwlG88FUOV43kPcQqDZkDa/h3WSZy6i8Fr0BSjfQtB1B3xuQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@sinonjs/fake-timers": "^7.1.0"
|
||||
"@types/sinonjs__fake-timers": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/sinonjs__fake-timers": {
|
||||
"version": "8.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.2.tgz",
|
||||
"integrity": "sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@types/tunnel": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/tunnel/-/tunnel-0.0.3.tgz",
|
||||
|
|
@ -946,23 +934,22 @@
|
|||
"integrity": "sha512-kNnC1GFBLuhImSnV7w4njQkUiJi0ZXUycu1rUaouPqiKlXkh77JKgdRnTAp1x5eBwcIwbtI+3otwzuIDEuDoxQ=="
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.0.0.tgz",
|
||||
"integrity": "sha512-xuv6ghKGoiq856Bww/yVYnXGsKa588kY3M0XK7uUW/3fJNNULKRfZfSBkMTSpqGG/8ZCXCadfh8G/z/B4aqS/A==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.1.0.tgz",
|
||||
"integrity": "sha512-qg7Bm5TyP/I7iilGyp6DRqqkt8na00lI6HbjWZObgk3FFSzH5ypRwAHXJhJkwiRtTcfn+xYQIMOR5kJgpo6upw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.5.0",
|
||||
"@typescript-eslint/scope-manager": "6.0.0",
|
||||
"@typescript-eslint/type-utils": "6.0.0",
|
||||
"@typescript-eslint/utils": "6.0.0",
|
||||
"@typescript-eslint/visitor-keys": "6.0.0",
|
||||
"@eslint-community/regexpp": "^4.5.1",
|
||||
"@typescript-eslint/scope-manager": "6.1.0",
|
||||
"@typescript-eslint/type-utils": "6.1.0",
|
||||
"@typescript-eslint/utils": "6.1.0",
|
||||
"@typescript-eslint/visitor-keys": "6.1.0",
|
||||
"debug": "^4.3.4",
|
||||
"grapheme-splitter": "^1.0.4",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.2.4",
|
||||
"natural-compare": "^1.4.0",
|
||||
"natural-compare-lite": "^1.4.0",
|
||||
"semver": "^7.5.0",
|
||||
"semver": "^7.5.4",
|
||||
"ts-api-utils": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
|
|
@ -983,15 +970,15 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.0.0.tgz",
|
||||
"integrity": "sha512-TNaufYSPrr1U8n+3xN+Yp9g31vQDJqhXzzPSHfQDLcaO4tU+mCfODPxCwf4H530zo7aUBE3QIdxCXamEnG04Tg==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.1.0.tgz",
|
||||
"integrity": "sha512-hIzCPvX4vDs4qL07SYzyomamcs2/tQYXg5DtdAfj35AyJ5PIUqhsLf4YrEIFzZcND7R2E8tpQIZKayxg8/6Wbw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "6.0.0",
|
||||
"@typescript-eslint/types": "6.0.0",
|
||||
"@typescript-eslint/typescript-estree": "6.0.0",
|
||||
"@typescript-eslint/visitor-keys": "6.0.0",
|
||||
"@typescript-eslint/scope-manager": "6.1.0",
|
||||
"@typescript-eslint/types": "6.1.0",
|
||||
"@typescript-eslint/typescript-estree": "6.1.0",
|
||||
"@typescript-eslint/visitor-keys": "6.1.0",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
|
|
@ -1011,13 +998,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.0.0.tgz",
|
||||
"integrity": "sha512-o4q0KHlgCZTqjuaZ25nw5W57NeykZT9LiMEG4do/ovwvOcPnDO1BI5BQdCsUkjxFyrCL0cSzLjvIMfR9uo7cWg==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.1.0.tgz",
|
||||
"integrity": "sha512-AxjgxDn27hgPpe2rQe19k0tXw84YCOsjDJ2r61cIebq1t+AIxbgiXKvD4999Wk49GVaAcdJ/d49FYel+Pp3jjw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.0.0",
|
||||
"@typescript-eslint/visitor-keys": "6.0.0"
|
||||
"@typescript-eslint/types": "6.1.0",
|
||||
"@typescript-eslint/visitor-keys": "6.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
|
|
@ -1028,13 +1015,13 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.0.0.tgz",
|
||||
"integrity": "sha512-ah6LJvLgkoZ/pyJ9GAdFkzeuMZ8goV6BH7eC9FPmojrnX9yNCIsfjB+zYcnex28YO3RFvBkV6rMV6WpIqkPvoQ==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.1.0.tgz",
|
||||
"integrity": "sha512-kFXBx6QWS1ZZ5Ni89TyT1X9Ag6RXVIVhqDs0vZE/jUeWlBv/ixq2diua6G7ece6+fXw3TvNRxP77/5mOMusx2w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/typescript-estree": "6.0.0",
|
||||
"@typescript-eslint/utils": "6.0.0",
|
||||
"@typescript-eslint/typescript-estree": "6.1.0",
|
||||
"@typescript-eslint/utils": "6.1.0",
|
||||
"debug": "^4.3.4",
|
||||
"ts-api-utils": "^1.0.1"
|
||||
},
|
||||
|
|
@ -1055,9 +1042,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.0.0.tgz",
|
||||
"integrity": "sha512-Zk9KDggyZM6tj0AJWYYKgF0yQyrcnievdhG0g5FqyU3Y2DRxJn4yWY21sJC0QKBckbsdKKjYDV2yVrrEvuTgxg==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.1.0.tgz",
|
||||
"integrity": "sha512-+Gfd5NHCpDoHDOaU/yIF3WWRI2PcBRKKpP91ZcVbL0t5tQpqYWBs3z/GGhvU+EV1D0262g9XCnyqQh19prU0JQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
|
|
@ -1068,17 +1055,17 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.0.0.tgz",
|
||||
"integrity": "sha512-2zq4O7P6YCQADfmJ5OTDQTP3ktajnXIRrYAtHM9ofto/CJZV3QfJ89GEaM2BNGeSr1KgmBuLhEkz5FBkS2RQhQ==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.1.0.tgz",
|
||||
"integrity": "sha512-nUKAPWOaP/tQjU1IQw9sOPCDavs/iU5iYLiY/6u7gxS7oKQoi4aUxXS1nrrVGTyBBaGesjkcwwHkbkiD5eBvcg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.0.0",
|
||||
"@typescript-eslint/visitor-keys": "6.0.0",
|
||||
"@typescript-eslint/types": "6.1.0",
|
||||
"@typescript-eslint/visitor-keys": "6.1.0",
|
||||
"debug": "^4.3.4",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
"semver": "^7.5.0",
|
||||
"semver": "^7.5.4",
|
||||
"ts-api-utils": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
|
|
@ -1095,19 +1082,18 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.0.0.tgz",
|
||||
"integrity": "sha512-SOr6l4NB6HE4H/ktz0JVVWNXqCJTOo/mHnvIte1ZhBQ0Cvd04x5uKZa3zT6tiodL06zf5xxdK8COiDvPnQ27JQ==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.1.0.tgz",
|
||||
"integrity": "sha512-wp652EogZlKmQoMS5hAvWqRKplXvkuOnNzZSE0PVvsKjpexd/XznRVHAtrfHFYmqaJz0DFkjlDsGYC9OXw+OhQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.3.0",
|
||||
"@types/json-schema": "^7.0.11",
|
||||
"@types/semver": "^7.3.12",
|
||||
"@typescript-eslint/scope-manager": "6.0.0",
|
||||
"@typescript-eslint/types": "6.0.0",
|
||||
"@typescript-eslint/typescript-estree": "6.0.0",
|
||||
"eslint-scope": "^5.1.1",
|
||||
"semver": "^7.5.0"
|
||||
"@eslint-community/eslint-utils": "^4.4.0",
|
||||
"@types/json-schema": "^7.0.12",
|
||||
"@types/semver": "^7.5.0",
|
||||
"@typescript-eslint/scope-manager": "6.1.0",
|
||||
"@typescript-eslint/types": "6.1.0",
|
||||
"@typescript-eslint/typescript-estree": "6.1.0",
|
||||
"semver": "^7.5.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
|
|
@ -1121,12 +1107,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.0.0.tgz",
|
||||
"integrity": "sha512-cvJ63l8c0yXdeT5POHpL0Q1cZoRcmRKFCtSjNGJxPkcP571EfZMcNbzWAc7oK3D1dRzm/V5EwtkANTZxqvuuUA==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.1.0.tgz",
|
||||
"integrity": "sha512-yQeh+EXhquh119Eis4k0kYhj9vmFzNpbhM3LftWQVwqVjipCkwHBQOZutcYW+JVkjtTG9k8nrZU1UoNedPDd1A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.0.0",
|
||||
"@typescript-eslint/types": "6.1.0",
|
||||
"eslint-visitor-keys": "^3.4.1"
|
||||
},
|
||||
"engines": {
|
||||
|
|
@ -1258,12 +1244,12 @@
|
|||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
|
||||
},
|
||||
"node_modules/aria-query": {
|
||||
"version": "5.1.3",
|
||||
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.1.3.tgz",
|
||||
"integrity": "sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==",
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.0.tgz",
|
||||
"integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"deep-equal": "^2.0.5"
|
||||
"dequal": "^2.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/array-find-index": {
|
||||
|
|
@ -2200,6 +2186,15 @@
|
|||
"version": "2.3.1",
|
||||
"integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ=="
|
||||
},
|
||||
"node_modules/dequal": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
|
||||
"integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/diff": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz",
|
||||
|
|
@ -2405,9 +2400,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/eslint": {
|
||||
"version": "8.44.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.44.0.tgz",
|
||||
"integrity": "sha512-0wpHoUbDUHgNCyvFB5aXLiQVfK9B0at6gUvzy83k4kAsQ/u769TQDX6iKC+aO4upIHO9WSaA3QoXYQDHbNwf1A==",
|
||||
"version": "8.45.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.45.0.tgz",
|
||||
"integrity": "sha512-pd8KSxiQpdYRfYa9Wufvdoct3ZPQQuVuU5O6scNgMuOMYuxvH0IGaYK0wUFjo4UYYQQCUndlXiMbnxopwvvTiw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.2.0",
|
||||
|
|
@ -2435,7 +2430,6 @@
|
|||
"globals": "^13.19.0",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.2.0",
|
||||
"import-fresh": "^3.0.0",
|
||||
"imurmurhash": "^0.1.4",
|
||||
"is-glob": "^4.0.0",
|
||||
"is-path-inside": "^3.0.3",
|
||||
|
|
@ -2447,7 +2441,6 @@
|
|||
"natural-compare": "^1.4.0",
|
||||
"optionator": "^0.9.3",
|
||||
"strip-ansi": "^6.0.1",
|
||||
"strip-json-comments": "^3.1.0",
|
||||
"text-table": "^0.2.0"
|
||||
},
|
||||
"bin": {
|
||||
|
|
@ -2620,15 +2613,15 @@
|
|||
}
|
||||
},
|
||||
"node_modules/eslint-plugin-github": {
|
||||
"version": "4.8.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-github/-/eslint-plugin-github-4.8.0.tgz",
|
||||
"integrity": "sha512-1qu1qcyac4FfZmT9KNPr5250DwWzwp6uy6xAqHD2boE4OquUpeTni05yPn1b6y6vUYm/q8+npTdyYiRSqvg+BQ==",
|
||||
"version": "4.9.0",
|
||||
"resolved": "https://registry.npmjs.org/eslint-plugin-github/-/eslint-plugin-github-4.9.0.tgz",
|
||||
"integrity": "sha512-c4jnJXJzHy8lzdYjOXlXcY7jX4b2ciGh+ugZM5b6vs6q2+m+6BrNl20u5WxloJvH6Q8CbZ0+Lnh7lDJxUd3WkQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@github/browserslist-config": "^1.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.1.0",
|
||||
"@typescript-eslint/parser": "^5.1.0",
|
||||
"aria-query": "^5.1.3",
|
||||
"aria-query": "^5.3.0",
|
||||
"eslint-config-prettier": ">=8.0.0",
|
||||
"eslint-plugin-escompat": "^3.3.3",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
|
|
@ -3699,12 +3692,6 @@
|
|||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
|
||||
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA=="
|
||||
},
|
||||
"node_modules/grapheme-splitter": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz",
|
||||
"integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/graphemer": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",
|
||||
|
|
@ -4692,9 +4679,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/nock": {
|
||||
"version": "13.3.1",
|
||||
"resolved": "https://registry.npmjs.org/nock/-/nock-13.3.1.tgz",
|
||||
"integrity": "sha512-vHnopocZuI93p2ccivFyGuUfzjq2fxNyNurp7816mlT5V5HF4SzXu8lvLrVzBbNqzs+ODooZ6OksuSUNM7Njkw==",
|
||||
"version": "13.3.2",
|
||||
"resolved": "https://registry.npmjs.org/nock/-/nock-13.3.2.tgz",
|
||||
"integrity": "sha512-CwbljitiWJhF1gL83NbanhoKs1l23TDlRioNraPTZrzZIEooPemrHRj5m0FZCPkB1ecdYCSWWGcHysJgX/ngnQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"debug": "^4.1.0",
|
||||
|
|
|
|||
57
node_modules/@sinonjs/commons/CHANGES.md
generated
vendored
57
node_modules/@sinonjs/commons/CHANGES.md
generated
vendored
|
|
@ -1,57 +0,0 @@
|
|||
# Changes
|
||||
|
||||
## 1.8.3
|
||||
|
||||
- [`6af2d0c`](https://github.com/sinonjs/commons/commit/6af2d0cf33e9fd1e4aaef5308fd16a9cd78a5782)
|
||||
Bump y18n from 4.0.0 to 4.0.1 (dependabot[bot])
|
||||
>
|
||||
> Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
|
||||
> - [Release notes](https://github.com/yargs/y18n/releases)
|
||||
> - [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
|
||||
> - [Commits](https://github.com/yargs/y18n/commits)
|
||||
>
|
||||
> Signed-off-by: dependabot[bot] <support@github.com>
|
||||
|
||||
_Released on 2021-04-08._
|
||||
|
||||
## 1.8.2
|
||||
|
||||
- [`6b7a796`](https://github.com/sinonjs/commons/commit/6b7a796ffc088b43dc283cc4477a7d641720dc96)
|
||||
Add .d.ts files to package (Morgan Roderick)
|
||||
>
|
||||
> In order to improve the experience of TypeScript users, we are compiling
|
||||
> `.d.ts` files from the JSDoc and distributing them with the package
|
||||
>
|
||||
|
||||
_Released on 2021-01-13._
|
||||
|
||||
## 1.8.1
|
||||
|
||||
- [`07b9e7a`](https://github.com/sinonjs/commons/commit/07b9e7a1d784771273a9a58d74945bbc7319b5d4)
|
||||
Optimize npm package size (Uladzimir Havenchyk)
|
||||
|
||||
_Released on 2020-07-17._
|
||||
|
||||
## 1.8.0
|
||||
|
||||
- [`4282205`](https://github.com/sinonjs/commons/commit/4282205343a4dcde2a35ccf2a8c2094300dad369)
|
||||
Emit deprecationg warnings in node, and keep console info in browsers (mshaaban0)
|
||||
|
||||
_Released on 2020-05-20._
|
||||
|
||||
## 1.7.2
|
||||
|
||||
- [`76ad9c1`](https://github.com/sinonjs/commons/commit/76ad9c16bad29f72420ed55bdf45b65d076108c8)
|
||||
Fix generators causing exceptions in function-name (Sebastian Mayr)
|
||||
|
||||
_Released on 2020-04-08._
|
||||
|
||||
## 1.7.1
|
||||
|
||||
- [`0486d25`](https://github.com/sinonjs/commons/commit/0486d250ecec9b5f9aa2210357767e413f4162d3)
|
||||
Upgrade eslint-config-sinon, add eslint-plugin-jsdoc (Morgan Roderick)
|
||||
>
|
||||
> This adds linting of jsdoc
|
||||
>
|
||||
|
||||
_Released on 2020-02-19._
|
||||
29
node_modules/@sinonjs/commons/LICENSE
generated
vendored
29
node_modules/@sinonjs/commons/LICENSE
generated
vendored
|
|
@ -1,29 +0,0 @@
|
|||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2018, Sinon.JS
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
16
node_modules/@sinonjs/commons/README.md
generated
vendored
16
node_modules/@sinonjs/commons/README.md
generated
vendored
|
|
@ -1,16 +0,0 @@
|
|||
# commons
|
||||
|
||||
[](https://circleci.com/gh/sinonjs/commons)
|
||||
[](https://codecov.io/gh/sinonjs/commons)
|
||||
<a href="CODE_OF_CONDUCT.md"><img src="https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg" alt="Contributor Covenant" /></a>
|
||||
|
||||
Simple functions shared among the sinon end user libraries
|
||||
|
||||
## Rules
|
||||
|
||||
- Follows the [Sinon.JS compatibility](https://github.com/sinonjs/sinon/blob/master/CONTRIBUTING.md#compatibility)
|
||||
- 100% test coverage
|
||||
- Code formatted using [Prettier](https://prettier.io)
|
||||
- No side effects welcome! (only pure functions)
|
||||
- No platform specific functions
|
||||
- One export per file (any bundler can do tree shaking)
|
||||
57
node_modules/@sinonjs/commons/lib/called-in-order.js
generated
vendored
57
node_modules/@sinonjs/commons/lib/called-in-order.js
generated
vendored
|
|
@ -1,57 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var every = require("./prototypes/array").every;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
function hasCallsLeft(callMap, spy) {
|
||||
if (callMap[spy.id] === undefined) {
|
||||
callMap[spy.id] = 0;
|
||||
}
|
||||
|
||||
return callMap[spy.id] < spy.callCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
function checkAdjacentCalls(callMap, spy, index, spies) {
|
||||
var calledBeforeNext = true;
|
||||
|
||||
if (index !== spies.length - 1) {
|
||||
calledBeforeNext = spy.calledBefore(spies[index + 1]);
|
||||
}
|
||||
|
||||
if (hasCallsLeft(callMap, spy) && calledBeforeNext) {
|
||||
callMap[spy.id] += 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Sinon proxy object (fake, spy, stub)
|
||||
*
|
||||
* @typedef {object} SinonProxy
|
||||
* @property {Function} calledBefore - A method that determines if this proxy was called before another one
|
||||
* @property {string} id - Some id
|
||||
* @property {number} callCount - Number of times this proxy has been called
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns true when the spies have been called in the order they were supplied in
|
||||
*
|
||||
* @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments
|
||||
* @returns {boolean} true when spies are called in order, false otherwise
|
||||
*/
|
||||
function calledInOrder(spies) {
|
||||
var callMap = {};
|
||||
// eslint-disable-next-line no-underscore-dangle
|
||||
var _spies = arguments.length > 1 ? arguments : spies;
|
||||
|
||||
return every(_spies, checkAdjacentCalls.bind(null, callMap));
|
||||
}
|
||||
|
||||
module.exports = calledInOrder;
|
||||
121
node_modules/@sinonjs/commons/lib/called-in-order.test.js
generated
vendored
121
node_modules/@sinonjs/commons/lib/called-in-order.test.js
generated
vendored
|
|
@ -1,121 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var assert = require("@sinonjs/referee-sinon").assert;
|
||||
var calledInOrder = require("./called-in-order");
|
||||
var sinon = require("@sinonjs/referee-sinon").sinon;
|
||||
|
||||
var testObject1 = {
|
||||
someFunction: function() {
|
||||
return;
|
||||
}
|
||||
};
|
||||
var testObject2 = {
|
||||
otherFunction: function() {
|
||||
return;
|
||||
}
|
||||
};
|
||||
var testObject3 = {
|
||||
thirdFunction: function() {
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
function testMethod() {
|
||||
testObject1.someFunction();
|
||||
testObject2.otherFunction();
|
||||
testObject2.otherFunction();
|
||||
testObject2.otherFunction();
|
||||
testObject3.thirdFunction();
|
||||
}
|
||||
|
||||
describe("calledInOrder", function() {
|
||||
beforeEach(function() {
|
||||
sinon.stub(testObject1, "someFunction");
|
||||
sinon.stub(testObject2, "otherFunction");
|
||||
sinon.stub(testObject3, "thirdFunction");
|
||||
testMethod();
|
||||
});
|
||||
afterEach(function() {
|
||||
testObject1.someFunction.restore();
|
||||
testObject2.otherFunction.restore();
|
||||
testObject3.thirdFunction.restore();
|
||||
});
|
||||
|
||||
describe("given single array argument", function() {
|
||||
describe("when stubs were called in expected order", function() {
|
||||
it("returns true", function() {
|
||||
assert.isTrue(
|
||||
calledInOrder([
|
||||
testObject1.someFunction,
|
||||
testObject2.otherFunction
|
||||
])
|
||||
);
|
||||
assert.isTrue(
|
||||
calledInOrder([
|
||||
testObject1.someFunction,
|
||||
testObject2.otherFunction,
|
||||
testObject2.otherFunction,
|
||||
testObject3.thirdFunction
|
||||
])
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("when stubs were called in unexpected order", function() {
|
||||
it("returns false", function() {
|
||||
assert.isFalse(
|
||||
calledInOrder([
|
||||
testObject2.otherFunction,
|
||||
testObject1.someFunction
|
||||
])
|
||||
);
|
||||
assert.isFalse(
|
||||
calledInOrder([
|
||||
testObject2.otherFunction,
|
||||
testObject1.someFunction,
|
||||
testObject1.someFunction,
|
||||
testObject3.thirdFunction
|
||||
])
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("given multiple arguments", function() {
|
||||
describe("when stubs were called in expected order", function() {
|
||||
it("returns true", function() {
|
||||
assert.isTrue(
|
||||
calledInOrder(
|
||||
testObject1.someFunction,
|
||||
testObject2.otherFunction
|
||||
)
|
||||
);
|
||||
assert.isTrue(
|
||||
calledInOrder(
|
||||
testObject1.someFunction,
|
||||
testObject2.otherFunction,
|
||||
testObject3.thirdFunction
|
||||
)
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("when stubs were called in unexpected order", function() {
|
||||
it("returns false", function() {
|
||||
assert.isFalse(
|
||||
calledInOrder(
|
||||
testObject2.otherFunction,
|
||||
testObject1.someFunction
|
||||
)
|
||||
);
|
||||
assert.isFalse(
|
||||
calledInOrder(
|
||||
testObject2.otherFunction,
|
||||
testObject1.someFunction,
|
||||
testObject3.thirdFunction
|
||||
)
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
27
node_modules/@sinonjs/commons/lib/class-name.js
generated
vendored
27
node_modules/@sinonjs/commons/lib/class-name.js
generated
vendored
|
|
@ -1,27 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var functionName = require("./function-name");
|
||||
|
||||
/**
|
||||
* Returns a display name for a value from a constructor
|
||||
*
|
||||
* @param {object} value A value to examine
|
||||
* @returns {(string|null)} A string or null
|
||||
*/
|
||||
function className(value) {
|
||||
return (
|
||||
(value.constructor && value.constructor.name) ||
|
||||
// The next branch is for IE11 support only:
|
||||
// Because the name property is not set on the prototype
|
||||
// of the Function object, we finally try to grab the
|
||||
// name from its definition. This will never be reached
|
||||
// in node, so we are not able to test this properly.
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name
|
||||
(typeof value.constructor === "function" &&
|
||||
/* istanbul ignore next */
|
||||
functionName(value.constructor)) ||
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = className;
|
||||
37
node_modules/@sinonjs/commons/lib/class-name.test.js
generated
vendored
37
node_modules/@sinonjs/commons/lib/class-name.test.js
generated
vendored
|
|
@ -1,37 +0,0 @@
|
|||
"use strict";
|
||||
/* eslint-disable no-empty-function */
|
||||
|
||||
var assert = require("@sinonjs/referee").assert;
|
||||
var className = require("./class-name");
|
||||
|
||||
describe("className", function() {
|
||||
it("returns the class name of an instance", function() {
|
||||
// Because eslint-config-sinon disables es6, we can't
|
||||
// use a class definition here
|
||||
// https://github.com/sinonjs/eslint-config-sinon/blob/master/index.js
|
||||
// var instance = new (class TestClass {})();
|
||||
var instance = new (function TestClass() {})();
|
||||
var name = className(instance);
|
||||
assert.equals(name, "TestClass");
|
||||
});
|
||||
|
||||
it("returns 'Object' for {}", function() {
|
||||
var name = className({});
|
||||
assert.equals(name, "Object");
|
||||
});
|
||||
|
||||
it("returns null for an object that has no prototype", function() {
|
||||
var obj = Object.create(null);
|
||||
var name = className(obj);
|
||||
assert.equals(name, null);
|
||||
});
|
||||
|
||||
it("returns null for an object whose prototype was mangled", function() {
|
||||
// This is what Node v6 and v7 do for objects returned by querystring.parse()
|
||||
function MangledObject() {}
|
||||
MangledObject.prototype = Object.create(null);
|
||||
var obj = new MangledObject();
|
||||
var name = className(obj);
|
||||
assert.equals(name, null);
|
||||
});
|
||||
});
|
||||
58
node_modules/@sinonjs/commons/lib/deprecated.js
generated
vendored
58
node_modules/@sinonjs/commons/lib/deprecated.js
generated
vendored
|
|
@ -1,58 +0,0 @@
|
|||
/* eslint-disable no-console */
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Returns a function that will invoke the supplied function and print a
|
||||
* deprecation warning to the console each time it is called.
|
||||
*
|
||||
* @param {Function} func
|
||||
* @param {string} msg
|
||||
* @returns {Function}
|
||||
*/
|
||||
exports.wrap = function(func, msg) {
|
||||
var wrapped = function() {
|
||||
exports.printWarning(msg);
|
||||
return func.apply(this, arguments);
|
||||
};
|
||||
if (func.prototype) {
|
||||
wrapped.prototype = func.prototype;
|
||||
}
|
||||
return wrapped;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns a string which can be supplied to `wrap()` to notify the user that a
|
||||
* particular part of the sinon API has been deprecated.
|
||||
*
|
||||
* @param {string} packageName
|
||||
* @param {string} funcName
|
||||
* @returns {string}
|
||||
*/
|
||||
exports.defaultMsg = function(packageName, funcName) {
|
||||
return (
|
||||
packageName +
|
||||
"." +
|
||||
funcName +
|
||||
" is deprecated and will be removed from the public API in a future version of " +
|
||||
packageName +
|
||||
"."
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Prints a warning on the console, when it exists
|
||||
*
|
||||
* @param {string} msg
|
||||
* @returns {undefined}
|
||||
*/
|
||||
exports.printWarning = function(msg) {
|
||||
/* istanbul ignore next */
|
||||
if (typeof process === "object" && process.emitWarning) {
|
||||
// Emit Warnings in Node
|
||||
process.emitWarning(msg);
|
||||
} else if (console.info) {
|
||||
console.info(msg);
|
||||
} else {
|
||||
console.log(msg);
|
||||
}
|
||||
};
|
||||
100
node_modules/@sinonjs/commons/lib/deprecated.test.js
generated
vendored
100
node_modules/@sinonjs/commons/lib/deprecated.test.js
generated
vendored
|
|
@ -1,100 +0,0 @@
|
|||
/* eslint-disable no-console */
|
||||
"use strict";
|
||||
|
||||
var assert = require("@sinonjs/referee-sinon").assert;
|
||||
var sinon = require("@sinonjs/referee-sinon").sinon;
|
||||
|
||||
var deprecated = require("./deprecated");
|
||||
|
||||
var msg = "test";
|
||||
|
||||
describe("deprecated", function() {
|
||||
describe("defaultMsg", function() {
|
||||
it("should return a string", function() {
|
||||
assert.equals(
|
||||
deprecated.defaultMsg("sinon", "someFunc"),
|
||||
"sinon.someFunc is deprecated and will be removed from the public API in a future version of sinon."
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("printWarning", function() {
|
||||
beforeEach(function() {
|
||||
sinon.replace(process, "emitWarning", sinon.fake());
|
||||
});
|
||||
|
||||
afterEach(sinon.restore);
|
||||
|
||||
describe("when `process.emitWarning` is defined", function() {
|
||||
it("should call process.emitWarning with a msg", function() {
|
||||
deprecated.printWarning(msg);
|
||||
assert.calledOnceWith(process.emitWarning, msg);
|
||||
});
|
||||
});
|
||||
|
||||
describe("when `process.emitWarning` is undefined", function() {
|
||||
beforeEach(function() {
|
||||
sinon.replace(console, "info", sinon.fake());
|
||||
sinon.replace(console, "log", sinon.fake());
|
||||
process.emitWarning = undefined;
|
||||
});
|
||||
|
||||
afterEach(sinon.restore);
|
||||
|
||||
describe("when `console.info` is defined", function() {
|
||||
it("should call `console.info` with a message", function() {
|
||||
deprecated.printWarning(msg);
|
||||
assert.calledOnceWith(console.info, msg);
|
||||
});
|
||||
});
|
||||
|
||||
describe("when `console.info` is undefined", function() {
|
||||
it("should call `console.log` with a message", function() {
|
||||
console.info = undefined;
|
||||
deprecated.printWarning(msg);
|
||||
assert.calledOnceWith(console.log, msg);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("wrap", function() {
|
||||
var method = sinon.fake();
|
||||
var wrapped;
|
||||
|
||||
beforeEach(function() {
|
||||
wrapped = deprecated.wrap(method, msg);
|
||||
});
|
||||
|
||||
it("should return a wrapper function", function() {
|
||||
assert.match(wrapped, sinon.match.func);
|
||||
});
|
||||
|
||||
it("should assign the prototype of the passed method", function() {
|
||||
assert.equals(method.prototype, wrapped.prototype);
|
||||
});
|
||||
|
||||
context("when the passed method has falsy prototype", function() {
|
||||
it("should not be assigned to the wrapped method", function() {
|
||||
method.prototype = null;
|
||||
wrapped = deprecated.wrap(method, msg);
|
||||
assert.match(wrapped.prototype, sinon.match.object);
|
||||
});
|
||||
});
|
||||
|
||||
context("when invoking the wrapped function", function() {
|
||||
before(function() {
|
||||
sinon.replace(deprecated, "printWarning", sinon.fake());
|
||||
wrapped({});
|
||||
});
|
||||
|
||||
it("should call `printWarning` before invoking", function() {
|
||||
assert.calledOnceWith(deprecated.printWarning, msg);
|
||||
});
|
||||
|
||||
it("should invoke the passed method with the given arguments", function() {
|
||||
assert.calledOnceWith(method, {});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
27
node_modules/@sinonjs/commons/lib/every.js
generated
vendored
27
node_modules/@sinonjs/commons/lib/every.js
generated
vendored
|
|
@ -1,27 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
/**
|
||||
* Returns true when fn returns true for all members of obj.
|
||||
* This is an every implementation that works for all iterables
|
||||
*
|
||||
* @param {object} obj
|
||||
* @param {Function} fn
|
||||
* @returns {boolean}
|
||||
*/
|
||||
module.exports = function every(obj, fn) {
|
||||
var pass = true;
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods
|
||||
obj.forEach(function() {
|
||||
if (!fn.apply(this, arguments)) {
|
||||
// Throwing an error is the only way to break `forEach`
|
||||
throw new Error();
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
pass = false;
|
||||
}
|
||||
|
||||
return pass;
|
||||
};
|
||||
41
node_modules/@sinonjs/commons/lib/every.test.js
generated
vendored
41
node_modules/@sinonjs/commons/lib/every.test.js
generated
vendored
|
|
@ -1,41 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var assert = require("@sinonjs/referee-sinon").assert;
|
||||
var sinon = require("@sinonjs/referee-sinon").sinon;
|
||||
var every = require("./every");
|
||||
|
||||
describe("util/core/every", function() {
|
||||
it("returns true when the callback function returns true for every element in an iterable", function() {
|
||||
var obj = [true, true, true, true];
|
||||
var allTrue = every(obj, function(val) {
|
||||
return val;
|
||||
});
|
||||
|
||||
assert(allTrue);
|
||||
});
|
||||
|
||||
it("returns false when the callback function returns false for any element in an iterable", function() {
|
||||
var obj = [true, true, true, false];
|
||||
var result = every(obj, function(val) {
|
||||
return val;
|
||||
});
|
||||
|
||||
assert.isFalse(result);
|
||||
});
|
||||
|
||||
it("calls the given callback once for each item in an iterable until it returns false", function() {
|
||||
var iterableOne = [true, true, true, true];
|
||||
var iterableTwo = [true, true, false, true];
|
||||
var callback = sinon.spy(function(val) {
|
||||
return val;
|
||||
});
|
||||
|
||||
every(iterableOne, callback);
|
||||
assert.equals(callback.callCount, 4);
|
||||
|
||||
callback.resetHistory();
|
||||
|
||||
every(iterableTwo, callback);
|
||||
assert.equals(callback.callCount, 3);
|
||||
});
|
||||
});
|
||||
29
node_modules/@sinonjs/commons/lib/function-name.js
generated
vendored
29
node_modules/@sinonjs/commons/lib/function-name.js
generated
vendored
|
|
@ -1,29 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
/**
|
||||
* Returns a display name for a function
|
||||
*
|
||||
* @param {Function} func
|
||||
* @returns {string}
|
||||
*/
|
||||
module.exports = function functionName(func) {
|
||||
if (!func) {
|
||||
return "";
|
||||
}
|
||||
|
||||
try {
|
||||
return (
|
||||
func.displayName ||
|
||||
func.name ||
|
||||
// Use function decomposition as a last resort to get function
|
||||
// name. Does not rely on function decomposition to work - if it
|
||||
// doesn't debugging will be slightly less informative
|
||||
// (i.e. toString will say 'spy' rather than 'myFunc').
|
||||
(String(func).match(/function ([^\s(]+)/) || [])[1]
|
||||
);
|
||||
} catch (e) {
|
||||
// Stringify may fail and we might get an exception, as a last-last
|
||||
// resort fall back to empty string.
|
||||
return "";
|
||||
}
|
||||
};
|
||||
76
node_modules/@sinonjs/commons/lib/function-name.test.js
generated
vendored
76
node_modules/@sinonjs/commons/lib/function-name.test.js
generated
vendored
|
|
@ -1,76 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var jsc = require("jsverify");
|
||||
var refute = require("@sinonjs/referee-sinon").refute;
|
||||
|
||||
var functionName = require("./function-name");
|
||||
|
||||
describe("function-name", function() {
|
||||
it("should return empty string if func is falsy", function() {
|
||||
jsc.assertForall("falsy", function(fn) {
|
||||
return functionName(fn) === "";
|
||||
});
|
||||
});
|
||||
|
||||
it("should use displayName by default", function() {
|
||||
jsc.assertForall("nestring", function(displayName) {
|
||||
var fn = { displayName: displayName };
|
||||
|
||||
return functionName(fn) === fn.displayName;
|
||||
});
|
||||
});
|
||||
|
||||
it("should use name if displayName is not available", function() {
|
||||
jsc.assertForall("nestring", function(name) {
|
||||
var fn = { name: name };
|
||||
|
||||
return functionName(fn) === fn.name;
|
||||
});
|
||||
});
|
||||
|
||||
it("should fallback to string parsing", function() {
|
||||
jsc.assertForall("nat", function(naturalNumber) {
|
||||
var name = "fn" + naturalNumber;
|
||||
var fn = {
|
||||
toString: function() {
|
||||
return "\nfunction " + name;
|
||||
}
|
||||
};
|
||||
|
||||
return functionName(fn) === name;
|
||||
});
|
||||
});
|
||||
|
||||
it("should not fail when a name cannot be found", function() {
|
||||
refute.exception(function() {
|
||||
var fn = {
|
||||
toString: function() {
|
||||
return "\nfunction (";
|
||||
}
|
||||
};
|
||||
|
||||
functionName(fn);
|
||||
});
|
||||
});
|
||||
|
||||
it("should not fail when toString is undefined", function() {
|
||||
refute.exception(function() {
|
||||
functionName(Object.create(null));
|
||||
});
|
||||
});
|
||||
|
||||
it("should not fail when toString throws", function() {
|
||||
refute.exception(function() {
|
||||
var fn;
|
||||
try {
|
||||
// eslint-disable-next-line no-eval
|
||||
fn = eval("(function*() {})")().constructor;
|
||||
} catch (e) {
|
||||
// env doesn't support generators
|
||||
return;
|
||||
}
|
||||
|
||||
functionName(fn);
|
||||
});
|
||||
});
|
||||
});
|
||||
22
node_modules/@sinonjs/commons/lib/global.js
generated
vendored
22
node_modules/@sinonjs/commons/lib/global.js
generated
vendored
|
|
@ -1,22 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
/**
|
||||
* A reference to the global object
|
||||
*
|
||||
* @type {object} globalObject
|
||||
*/
|
||||
var globalObject;
|
||||
|
||||
/* istanbul ignore else */
|
||||
if (typeof global !== "undefined") {
|
||||
// Node
|
||||
globalObject = global;
|
||||
} else if (typeof window !== "undefined") {
|
||||
// Browser
|
||||
globalObject = window;
|
||||
} else {
|
||||
// WebWorker
|
||||
globalObject = self;
|
||||
}
|
||||
|
||||
module.exports = globalObject;
|
||||
16
node_modules/@sinonjs/commons/lib/global.test.js
generated
vendored
16
node_modules/@sinonjs/commons/lib/global.test.js
generated
vendored
|
|
@ -1,16 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var assert = require("@sinonjs/referee-sinon").assert;
|
||||
var globalObject = require("./global");
|
||||
|
||||
describe("global", function() {
|
||||
before(function() {
|
||||
if (typeof global === "undefined") {
|
||||
this.skip();
|
||||
}
|
||||
});
|
||||
|
||||
it("is same as global", function() {
|
||||
assert.same(globalObject, global);
|
||||
});
|
||||
});
|
||||
14
node_modules/@sinonjs/commons/lib/index.js
generated
vendored
14
node_modules/@sinonjs/commons/lib/index.js
generated
vendored
|
|
@ -1,14 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
global: require("./global"),
|
||||
calledInOrder: require("./called-in-order"),
|
||||
className: require("./class-name"),
|
||||
deprecated: require("./deprecated"),
|
||||
every: require("./every"),
|
||||
functionName: require("./function-name"),
|
||||
orderByFirstCall: require("./order-by-first-call"),
|
||||
prototypes: require("./prototypes"),
|
||||
typeOf: require("./type-of"),
|
||||
valueToString: require("./value-to-string")
|
||||
};
|
||||
29
node_modules/@sinonjs/commons/lib/index.test.js
generated
vendored
29
node_modules/@sinonjs/commons/lib/index.test.js
generated
vendored
|
|
@ -1,29 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var assert = require("@sinonjs/referee-sinon").assert;
|
||||
var index = require("./index");
|
||||
|
||||
var expectedMethods = [
|
||||
"calledInOrder",
|
||||
"className",
|
||||
"every",
|
||||
"functionName",
|
||||
"orderByFirstCall",
|
||||
"typeOf",
|
||||
"valueToString"
|
||||
];
|
||||
var expectedObjectProperties = ["deprecated", "prototypes"];
|
||||
|
||||
describe("package", function() {
|
||||
expectedMethods.forEach(function(name) {
|
||||
it("should export a method named " + name, function() {
|
||||
assert.isFunction(index[name]);
|
||||
});
|
||||
});
|
||||
|
||||
expectedObjectProperties.forEach(function(name) {
|
||||
it("should export an object property named " + name, function() {
|
||||
assert.isObject(index[name]);
|
||||
});
|
||||
});
|
||||
});
|
||||
36
node_modules/@sinonjs/commons/lib/order-by-first-call.js
generated
vendored
36
node_modules/@sinonjs/commons/lib/order-by-first-call.js
generated
vendored
|
|
@ -1,36 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var sort = require("./prototypes/array").sort;
|
||||
var slice = require("./prototypes/array").slice;
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
function comparator(a, b) {
|
||||
// uuid, won't ever be equal
|
||||
var aCall = a.getCall(0);
|
||||
var bCall = b.getCall(0);
|
||||
var aId = (aCall && aCall.callId) || -1;
|
||||
var bId = (bCall && bCall.callId) || -1;
|
||||
|
||||
return aId < bId ? -1 : 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Sinon proxy object (fake, spy, stub)
|
||||
*
|
||||
* @typedef {object} SinonProxy
|
||||
* @property {Function} getCall - A method that can return the first call
|
||||
*/
|
||||
|
||||
/**
|
||||
* Sorts an array of SinonProxy instances (fake, spy, stub) by their first call
|
||||
*
|
||||
* @param {SinonProxy[] | SinonProxy} spies
|
||||
* @returns {SinonProxy[]}
|
||||
*/
|
||||
function orderByFirstCall(spies) {
|
||||
return sort(slice(spies), comparator);
|
||||
}
|
||||
|
||||
module.exports = orderByFirstCall;
|
||||
52
node_modules/@sinonjs/commons/lib/order-by-first-call.test.js
generated
vendored
52
node_modules/@sinonjs/commons/lib/order-by-first-call.test.js
generated
vendored
|
|
@ -1,52 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var assert = require("@sinonjs/referee-sinon").assert;
|
||||
var knuthShuffle = require("knuth-shuffle").knuthShuffle;
|
||||
var sinon = require("@sinonjs/referee-sinon").sinon;
|
||||
var orderByFirstCall = require("./order-by-first-call");
|
||||
|
||||
describe("orderByFirstCall", function() {
|
||||
it("should order an Array of spies by the callId of the first call, ascending", function() {
|
||||
// create an array of spies
|
||||
var spies = [
|
||||
sinon.spy(),
|
||||
sinon.spy(),
|
||||
sinon.spy(),
|
||||
sinon.spy(),
|
||||
sinon.spy(),
|
||||
sinon.spy()
|
||||
];
|
||||
|
||||
// call all the spies
|
||||
spies.forEach(function(spy) {
|
||||
spy();
|
||||
});
|
||||
|
||||
// add a few uncalled spies
|
||||
spies.push(sinon.spy());
|
||||
spies.push(sinon.spy());
|
||||
|
||||
// randomise the order of the spies
|
||||
knuthShuffle(spies);
|
||||
|
||||
var sortedSpies = orderByFirstCall(spies);
|
||||
|
||||
assert.equals(sortedSpies.length, spies.length);
|
||||
|
||||
var orderedByFirstCall = sortedSpies.every(function(spy, index) {
|
||||
if (index + 1 === sortedSpies.length) {
|
||||
return true;
|
||||
}
|
||||
var nextSpy = sortedSpies[index + 1];
|
||||
|
||||
// uncalled spies should be ordered first
|
||||
if (!spy.called) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return spy.calledImmediatelyBefore(nextSpy);
|
||||
});
|
||||
|
||||
assert.isTrue(orderedByFirstCall);
|
||||
});
|
||||
});
|
||||
43
node_modules/@sinonjs/commons/lib/prototypes/README.md
generated
vendored
43
node_modules/@sinonjs/commons/lib/prototypes/README.md
generated
vendored
|
|
@ -1,43 +0,0 @@
|
|||
# Prototypes
|
||||
|
||||
The functions in this folder are to be use for keeping cached references to the built-in prototypes, so that people can't inadvertently break the library by making mistakes in userland.
|
||||
|
||||
See https://github.com/sinonjs/sinon/pull/1523
|
||||
|
||||
## Without cached references
|
||||
|
||||
```js
|
||||
// in userland, the library user needs to replace the filter method on
|
||||
// Array.prototype
|
||||
var array = [1, 2, 3];
|
||||
sinon.replace(array, "filter", sinon.fake.returns(2));
|
||||
|
||||
// in a sinon module, the library author needs to use the filter method
|
||||
var someArray = ["a", "b", 42, "c"];
|
||||
var answer = filter(someArray, function(v) {
|
||||
return v === 42;
|
||||
});
|
||||
|
||||
console.log(answer);
|
||||
// => 2
|
||||
```
|
||||
|
||||
## With cached references
|
||||
|
||||
```js
|
||||
// in userland, the library user needs to replace the filter method on
|
||||
// Array.prototype
|
||||
var array = [1, 2, 3];
|
||||
sinon.replace(array, "filter", sinon.fake.returns(2));
|
||||
|
||||
// in a sinon module, the library author needs to use the filter method
|
||||
// get a reference to the original Array.prototype.filter
|
||||
var filter = require("@sinonjs/commons").prototypes.array.filter;
|
||||
var someArray = ["a", "b", 42, "c"];
|
||||
var answer = filter(someArray, function(v) {
|
||||
return v === 42;
|
||||
});
|
||||
|
||||
console.log(answer);
|
||||
// => 42
|
||||
```
|
||||
5
node_modules/@sinonjs/commons/lib/prototypes/array.js
generated
vendored
5
node_modules/@sinonjs/commons/lib/prototypes/array.js
generated
vendored
|
|
@ -1,5 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var copyPrototype = require("./copy-prototype");
|
||||
|
||||
module.exports = copyPrototype(Array.prototype);
|
||||
21
node_modules/@sinonjs/commons/lib/prototypes/copy-prototype.js
generated
vendored
21
node_modules/@sinonjs/commons/lib/prototypes/copy-prototype.js
generated
vendored
|
|
@ -1,21 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var call = Function.call;
|
||||
|
||||
module.exports = function copyPrototypeMethods(prototype) {
|
||||
// eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods
|
||||
return Object.getOwnPropertyNames(prototype).reduce(function(result, name) {
|
||||
// ignore size because it throws from Map
|
||||
if (
|
||||
name !== "size" &&
|
||||
name !== "caller" &&
|
||||
name !== "callee" &&
|
||||
name !== "arguments" &&
|
||||
typeof prototype[name] === "function"
|
||||
) {
|
||||
result[name] = call.bind(prototype[name]);
|
||||
}
|
||||
|
||||
return result;
|
||||
}, Object.create(null));
|
||||
};
|
||||
5
node_modules/@sinonjs/commons/lib/prototypes/function.js
generated
vendored
5
node_modules/@sinonjs/commons/lib/prototypes/function.js
generated
vendored
|
|
@ -1,5 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var copyPrototype = require("./copy-prototype");
|
||||
|
||||
module.exports = copyPrototype(Function.prototype);
|
||||
10
node_modules/@sinonjs/commons/lib/prototypes/index.js
generated
vendored
10
node_modules/@sinonjs/commons/lib/prototypes/index.js
generated
vendored
|
|
@ -1,10 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
array: require("./array"),
|
||||
function: require("./function"),
|
||||
map: require("./map"),
|
||||
object: require("./object"),
|
||||
set: require("./set"),
|
||||
string: require("./string")
|
||||
};
|
||||
51
node_modules/@sinonjs/commons/lib/prototypes/index.test.js
generated
vendored
51
node_modules/@sinonjs/commons/lib/prototypes/index.test.js
generated
vendored
|
|
@ -1,51 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var assert = require("@sinonjs/referee-sinon").assert;
|
||||
|
||||
var arrayProto = require("./index").array;
|
||||
var functionProto = require("./index").function;
|
||||
var mapProto = require("./index").map;
|
||||
var objectProto = require("./index").object;
|
||||
var setProto = require("./index").set;
|
||||
var stringProto = require("./index").string;
|
||||
|
||||
describe("prototypes", function() {
|
||||
describe(".array", function() {
|
||||
verifyProperties(arrayProto, Array);
|
||||
});
|
||||
describe(".function", function() {
|
||||
verifyProperties(functionProto, Function);
|
||||
});
|
||||
describe(".map", function() {
|
||||
verifyProperties(mapProto, Map);
|
||||
});
|
||||
describe(".object", function() {
|
||||
verifyProperties(objectProto, Object);
|
||||
});
|
||||
describe(".set", function() {
|
||||
verifyProperties(setProto, Set);
|
||||
});
|
||||
describe(".string", function() {
|
||||
verifyProperties(stringProto, String);
|
||||
});
|
||||
});
|
||||
|
||||
function verifyProperties(p, origin) {
|
||||
it("should have all the methods of the origin prototype", function() {
|
||||
var methodNames = Object.getOwnPropertyNames(origin.prototype).filter(
|
||||
function(name) {
|
||||
return (
|
||||
name !== "size" &&
|
||||
name !== "caller" &&
|
||||
name !== "callee" &&
|
||||
name !== "arguments" &&
|
||||
typeof origin.prototype[name] === "function"
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
methodNames.forEach(function(name) {
|
||||
assert.isTrue(Object.prototype.hasOwnProperty.call(p, name), name);
|
||||
});
|
||||
});
|
||||
}
|
||||
5
node_modules/@sinonjs/commons/lib/prototypes/map.js
generated
vendored
5
node_modules/@sinonjs/commons/lib/prototypes/map.js
generated
vendored
|
|
@ -1,5 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var copyPrototype = require("./copy-prototype");
|
||||
|
||||
module.exports = copyPrototype(Map.prototype);
|
||||
5
node_modules/@sinonjs/commons/lib/prototypes/object.js
generated
vendored
5
node_modules/@sinonjs/commons/lib/prototypes/object.js
generated
vendored
|
|
@ -1,5 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var copyPrototype = require("./copy-prototype");
|
||||
|
||||
module.exports = copyPrototype(Object.prototype);
|
||||
5
node_modules/@sinonjs/commons/lib/prototypes/set.js
generated
vendored
5
node_modules/@sinonjs/commons/lib/prototypes/set.js
generated
vendored
|
|
@ -1,5 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var copyPrototype = require("./copy-prototype");
|
||||
|
||||
module.exports = copyPrototype(Set.prototype);
|
||||
5
node_modules/@sinonjs/commons/lib/prototypes/string.js
generated
vendored
5
node_modules/@sinonjs/commons/lib/prototypes/string.js
generated
vendored
|
|
@ -1,5 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var copyPrototype = require("./copy-prototype");
|
||||
|
||||
module.exports = copyPrototype(String.prototype);
|
||||
13
node_modules/@sinonjs/commons/lib/type-of.js
generated
vendored
13
node_modules/@sinonjs/commons/lib/type-of.js
generated
vendored
|
|
@ -1,13 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var type = require("type-detect");
|
||||
|
||||
/**
|
||||
* Returns the lower-case result of running type from type-detect on the value
|
||||
*
|
||||
* @param {*} value
|
||||
* @returns {string}
|
||||
*/
|
||||
module.exports = function typeOf(value) {
|
||||
return type(value).toLowerCase();
|
||||
};
|
||||
51
node_modules/@sinonjs/commons/lib/type-of.test.js
generated
vendored
51
node_modules/@sinonjs/commons/lib/type-of.test.js
generated
vendored
|
|
@ -1,51 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var assert = require("@sinonjs/referee-sinon").assert;
|
||||
var typeOf = require("./type-of");
|
||||
|
||||
describe("typeOf", function() {
|
||||
it("returns boolean", function() {
|
||||
assert.equals(typeOf(false), "boolean");
|
||||
});
|
||||
|
||||
it("returns string", function() {
|
||||
assert.equals(typeOf("Sinon.JS"), "string");
|
||||
});
|
||||
|
||||
it("returns number", function() {
|
||||
assert.equals(typeOf(123), "number");
|
||||
});
|
||||
|
||||
it("returns object", function() {
|
||||
assert.equals(typeOf({}), "object");
|
||||
});
|
||||
|
||||
it("returns function", function() {
|
||||
assert.equals(
|
||||
typeOf(function() {
|
||||
return undefined;
|
||||
}),
|
||||
"function"
|
||||
);
|
||||
});
|
||||
|
||||
it("returns undefined", function() {
|
||||
assert.equals(typeOf(undefined), "undefined");
|
||||
});
|
||||
|
||||
it("returns null", function() {
|
||||
assert.equals(typeOf(null), "null");
|
||||
});
|
||||
|
||||
it("returns array", function() {
|
||||
assert.equals(typeOf([]), "array");
|
||||
});
|
||||
|
||||
it("returns regexp", function() {
|
||||
assert.equals(typeOf(/.*/), "regexp");
|
||||
});
|
||||
|
||||
it("returns date", function() {
|
||||
assert.equals(typeOf(new Date()), "date");
|
||||
});
|
||||
});
|
||||
17
node_modules/@sinonjs/commons/lib/value-to-string.js
generated
vendored
17
node_modules/@sinonjs/commons/lib/value-to-string.js
generated
vendored
|
|
@ -1,17 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
/**
|
||||
* Returns a string representation of the value
|
||||
*
|
||||
* @param {*} value
|
||||
* @returns {string}
|
||||
*/
|
||||
function valueToString(value) {
|
||||
if (value && value.toString) {
|
||||
// eslint-disable-next-line @sinonjs/no-prototype-methods/no-prototype-methods
|
||||
return value.toString();
|
||||
}
|
||||
return String(value);
|
||||
}
|
||||
|
||||
module.exports = valueToString;
|
||||
20
node_modules/@sinonjs/commons/lib/value-to-string.test.js
generated
vendored
20
node_modules/@sinonjs/commons/lib/value-to-string.test.js
generated
vendored
|
|
@ -1,20 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
var assert = require("@sinonjs/referee-sinon").assert;
|
||||
var valueToString = require("./value-to-string");
|
||||
|
||||
describe("util/core/valueToString", function() {
|
||||
it("returns string representation of an object", function() {
|
||||
var obj = {};
|
||||
|
||||
assert.equals(valueToString(obj), obj.toString());
|
||||
});
|
||||
|
||||
it("returns 'null' for literal null'", function() {
|
||||
assert.equals(valueToString(null), "null");
|
||||
});
|
||||
|
||||
it("returns 'undefined' for literal undefined", function() {
|
||||
assert.equals(valueToString(undefined), "undefined");
|
||||
});
|
||||
});
|
||||
67
node_modules/@sinonjs/commons/package.json
generated
vendored
67
node_modules/@sinonjs/commons/package.json
generated
vendored
|
|
@ -1,67 +0,0 @@
|
|||
{
|
||||
"name": "@sinonjs/commons",
|
||||
"version": "1.8.3",
|
||||
"description": "Simple functions shared among the sinon end user libraries",
|
||||
"main": "lib/index.js",
|
||||
"types": "./types/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "rm -rf types && tsc",
|
||||
"lint": "eslint .",
|
||||
"precommit": "lint-staged",
|
||||
"test": "mocha --recursive -R dot \"lib/**/*.test.js\"",
|
||||
"test-check-coverage": "npm run test-coverage && nyc check-coverage --branches 100 --functions 100 --lines 100",
|
||||
"test-coverage": "nyc --reporter text --reporter html --reporter lcovonly npm run test",
|
||||
"prepublishOnly": "npm run build",
|
||||
"prettier:check": "prettier --check '**/*.{js,css,md}'",
|
||||
"prettier:write": "prettier --write '**/*.{js,css,md}'",
|
||||
"preversion": "npm run test-check-coverage",
|
||||
"version": "changes --commits --footer",
|
||||
"postversion": "git push --follow-tags && npm publish"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sinonjs/commons.git"
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
"types"
|
||||
],
|
||||
"author": "",
|
||||
"license": "BSD-3-Clause",
|
||||
"bugs": {
|
||||
"url": "https://github.com/sinonjs/commons/issues"
|
||||
},
|
||||
"homepage": "https://github.com/sinonjs/commons#readme",
|
||||
"lint-staged": {
|
||||
"*.{js,css,md}": "prettier --check",
|
||||
"*.js": "eslint"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sinonjs/eslint-plugin-no-prototype-methods": "^0.1.0",
|
||||
"@sinonjs/referee-sinon": "7.0.2",
|
||||
"@studio/changes": "^2.0.0",
|
||||
"eslint": "^6.1.0",
|
||||
"eslint-config-prettier": "^6.3.0",
|
||||
"eslint-config-sinon": "^4.0.0",
|
||||
"eslint-plugin-ie11": "^1.0.0",
|
||||
"eslint-plugin-jsdoc": "^22.1.0",
|
||||
"eslint-plugin-mocha": "^6.1.1",
|
||||
"eslint-plugin-prettier": "^3.0.0",
|
||||
"husky": "4.2.3",
|
||||
"jsverify": "0.8.4",
|
||||
"knuth-shuffle": "^1.0.8",
|
||||
"lint-staged": "10.1.1",
|
||||
"mocha": "7.1.0",
|
||||
"nyc": "15.0.0",
|
||||
"prettier": "^1.14.3",
|
||||
"typescript": "^4.1.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"type-detect": "4.0.8"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
}
|
||||
}
|
||||
36
node_modules/@sinonjs/commons/types/called-in-order.d.ts
generated
vendored
36
node_modules/@sinonjs/commons/types/called-in-order.d.ts
generated
vendored
|
|
@ -1,36 +0,0 @@
|
|||
export = calledInOrder;
|
||||
/**
|
||||
* A Sinon proxy object (fake, spy, stub)
|
||||
*
|
||||
* @typedef {object} SinonProxy
|
||||
* @property {Function} calledBefore - A method that determines if this proxy was called before another one
|
||||
* @property {string} id - Some id
|
||||
* @property {number} callCount - Number of times this proxy has been called
|
||||
*/
|
||||
/**
|
||||
* Returns true when the spies have been called in the order they were supplied in
|
||||
*
|
||||
* @param {SinonProxy[] | SinonProxy} spies An array of proxies, or several proxies as arguments
|
||||
* @returns {boolean} true when spies are called in order, false otherwise
|
||||
*/
|
||||
declare function calledInOrder(spies: SinonProxy[] | SinonProxy, ...args: any[]): boolean;
|
||||
declare namespace calledInOrder {
|
||||
export { SinonProxy };
|
||||
}
|
||||
/**
|
||||
* A Sinon proxy object (fake, spy, stub)
|
||||
*/
|
||||
type SinonProxy = {
|
||||
/**
|
||||
* - A method that determines if this proxy was called before another one
|
||||
*/
|
||||
calledBefore: Function;
|
||||
/**
|
||||
* - Some id
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* - Number of times this proxy has been called
|
||||
*/
|
||||
callCount: number;
|
||||
};
|
||||
8
node_modules/@sinonjs/commons/types/class-name.d.ts
generated
vendored
8
node_modules/@sinonjs/commons/types/class-name.d.ts
generated
vendored
|
|
@ -1,8 +0,0 @@
|
|||
export = className;
|
||||
/**
|
||||
* Returns a display name for a value from a constructor
|
||||
*
|
||||
* @param {object} value A value to examine
|
||||
* @returns {(string|null)} A string or null
|
||||
*/
|
||||
declare function className(value: object): (string | null);
|
||||
3
node_modules/@sinonjs/commons/types/deprecated.d.ts
generated
vendored
3
node_modules/@sinonjs/commons/types/deprecated.d.ts
generated
vendored
|
|
@ -1,3 +0,0 @@
|
|||
export function wrap(func: Function, msg: string): Function;
|
||||
export function defaultMsg(packageName: string, funcName: string): string;
|
||||
export function printWarning(msg: string): undefined;
|
||||
2
node_modules/@sinonjs/commons/types/every.d.ts
generated
vendored
2
node_modules/@sinonjs/commons/types/every.d.ts
generated
vendored
|
|
@ -1,2 +0,0 @@
|
|||
declare function _exports(obj: object, fn: Function): boolean;
|
||||
export = _exports;
|
||||
2
node_modules/@sinonjs/commons/types/function-name.d.ts
generated
vendored
2
node_modules/@sinonjs/commons/types/function-name.d.ts
generated
vendored
|
|
@ -1,2 +0,0 @@
|
|||
declare function _exports(func: Function): string;
|
||||
export = _exports;
|
||||
7
node_modules/@sinonjs/commons/types/global.d.ts
generated
vendored
7
node_modules/@sinonjs/commons/types/global.d.ts
generated
vendored
|
|
@ -1,7 +0,0 @@
|
|||
export = globalObject;
|
||||
/**
|
||||
* A reference to the global object
|
||||
*
|
||||
* @type {object} globalObject
|
||||
*/
|
||||
declare var globalObject: object;
|
||||
17
node_modules/@sinonjs/commons/types/index.d.ts
generated
vendored
17
node_modules/@sinonjs/commons/types/index.d.ts
generated
vendored
|
|
@ -1,17 +0,0 @@
|
|||
export const global: any;
|
||||
export const calledInOrder: typeof import("./called-in-order");
|
||||
export const className: typeof import("./class-name");
|
||||
export const deprecated: typeof import("./deprecated");
|
||||
export const every: (obj: any, fn: Function) => boolean;
|
||||
export const functionName: (func: Function) => string;
|
||||
export const orderByFirstCall: typeof import("./order-by-first-call");
|
||||
export const prototypes: {
|
||||
array: any;
|
||||
function: any;
|
||||
map: any;
|
||||
object: any;
|
||||
set: any;
|
||||
string: any;
|
||||
};
|
||||
export const typeOf: (value: any) => string;
|
||||
export const valueToString: typeof import("./value-to-string");
|
||||
26
node_modules/@sinonjs/commons/types/order-by-first-call.d.ts
generated
vendored
26
node_modules/@sinonjs/commons/types/order-by-first-call.d.ts
generated
vendored
|
|
@ -1,26 +0,0 @@
|
|||
export = orderByFirstCall;
|
||||
/**
|
||||
* A Sinon proxy object (fake, spy, stub)
|
||||
*
|
||||
* @typedef {object} SinonProxy
|
||||
* @property {Function} getCall - A method that can return the first call
|
||||
*/
|
||||
/**
|
||||
* Sorts an array of SinonProxy instances (fake, spy, stub) by their first call
|
||||
*
|
||||
* @param {SinonProxy[] | SinonProxy} spies
|
||||
* @returns {SinonProxy[]}
|
||||
*/
|
||||
declare function orderByFirstCall(spies: SinonProxy[] | SinonProxy): SinonProxy[];
|
||||
declare namespace orderByFirstCall {
|
||||
export { SinonProxy };
|
||||
}
|
||||
/**
|
||||
* A Sinon proxy object (fake, spy, stub)
|
||||
*/
|
||||
type SinonProxy = {
|
||||
/**
|
||||
* - A method that can return the first call
|
||||
*/
|
||||
getCall: Function;
|
||||
};
|
||||
2
node_modules/@sinonjs/commons/types/prototypes/array.d.ts
generated
vendored
2
node_modules/@sinonjs/commons/types/prototypes/array.d.ts
generated
vendored
|
|
@ -1,2 +0,0 @@
|
|||
declare const _exports: any;
|
||||
export = _exports;
|
||||
2
node_modules/@sinonjs/commons/types/prototypes/copy-prototype.d.ts
generated
vendored
2
node_modules/@sinonjs/commons/types/prototypes/copy-prototype.d.ts
generated
vendored
|
|
@ -1,2 +0,0 @@
|
|||
declare function _exports(prototype: any): any;
|
||||
export = _exports;
|
||||
2
node_modules/@sinonjs/commons/types/prototypes/function.d.ts
generated
vendored
2
node_modules/@sinonjs/commons/types/prototypes/function.d.ts
generated
vendored
|
|
@ -1,2 +0,0 @@
|
|||
declare const _exports: any;
|
||||
export = _exports;
|
||||
7
node_modules/@sinonjs/commons/types/prototypes/index.d.ts
generated
vendored
7
node_modules/@sinonjs/commons/types/prototypes/index.d.ts
generated
vendored
|
|
@ -1,7 +0,0 @@
|
|||
export declare const array: any;
|
||||
declare const _function: any;
|
||||
export { _function as function };
|
||||
export declare const map: any;
|
||||
export declare const object: any;
|
||||
export declare const set: any;
|
||||
export declare const string: any;
|
||||
2
node_modules/@sinonjs/commons/types/prototypes/map.d.ts
generated
vendored
2
node_modules/@sinonjs/commons/types/prototypes/map.d.ts
generated
vendored
|
|
@ -1,2 +0,0 @@
|
|||
declare const _exports: any;
|
||||
export = _exports;
|
||||
2
node_modules/@sinonjs/commons/types/prototypes/object.d.ts
generated
vendored
2
node_modules/@sinonjs/commons/types/prototypes/object.d.ts
generated
vendored
|
|
@ -1,2 +0,0 @@
|
|||
declare const _exports: any;
|
||||
export = _exports;
|
||||
2
node_modules/@sinonjs/commons/types/prototypes/set.d.ts
generated
vendored
2
node_modules/@sinonjs/commons/types/prototypes/set.d.ts
generated
vendored
|
|
@ -1,2 +0,0 @@
|
|||
declare const _exports: any;
|
||||
export = _exports;
|
||||
2
node_modules/@sinonjs/commons/types/prototypes/string.d.ts
generated
vendored
2
node_modules/@sinonjs/commons/types/prototypes/string.d.ts
generated
vendored
|
|
@ -1,2 +0,0 @@
|
|||
declare const _exports: any;
|
||||
export = _exports;
|
||||
2
node_modules/@sinonjs/commons/types/type-of.d.ts
generated
vendored
2
node_modules/@sinonjs/commons/types/type-of.d.ts
generated
vendored
|
|
@ -1,2 +0,0 @@
|
|||
declare function _exports(value: any): string;
|
||||
export = _exports;
|
||||
8
node_modules/@sinonjs/commons/types/value-to-string.d.ts
generated
vendored
8
node_modules/@sinonjs/commons/types/value-to-string.d.ts
generated
vendored
|
|
@ -1,8 +0,0 @@
|
|||
export = valueToString;
|
||||
/**
|
||||
* Returns a string representation of the value
|
||||
*
|
||||
* @param {*} value
|
||||
* @returns {string}
|
||||
*/
|
||||
declare function valueToString(value: any): string;
|
||||
422
node_modules/@sinonjs/fake-timers/CHANGELOG.md
generated
vendored
422
node_modules/@sinonjs/fake-timers/CHANGELOG.md
generated
vendored
|
|
@ -1,422 +0,0 @@
|
|||
|
||||
7.1.2 / 2021-05-28
|
||||
==================
|
||||
|
||||
* Fix #382 by making config fields optional (#383)
|
||||
* Fix #347 : Support util.promisify
|
||||
|
||||
7.1.1 / 2021-05-27
|
||||
==================
|
||||
|
||||
* Fix JSDoc for createClock
|
||||
|
||||
7.1.0 / 2021-05-20
|
||||
==================
|
||||
|
||||
* Remove Safari from Sauce Lab (ref #380)
|
||||
* Bump hosted-git-info from 2.6.0 to 2.8.9
|
||||
* Bump handlebars from 4.7.6 to 4.7.7
|
||||
* Bump lodash from 4.17.19 to 4.17.21
|
||||
* Add in latest Safari and evergreen Edge
|
||||
* Drop IE11 and Safari 9
|
||||
* chore: add type tests (#373)
|
||||
* remove constructor types
|
||||
* use globalThis to avoid conflicts
|
||||
* Update yargs-parser
|
||||
* Update mkdirp
|
||||
* Upgrade jsdom
|
||||
* Upgrade mochify to latest
|
||||
* Upgrade Mocha to latest
|
||||
* Bump y18n from 4.0.0 to 4.0.1
|
||||
* make config optional
|
||||
* add a bunch more types
|
||||
|
||||
7.0.5 / 2021-04-11
|
||||
==================
|
||||
|
||||
* Fix up some clock types in JSDoc (becomes `.d.ts`) (#370)
|
||||
* Fix refresh arguments forwarding (#369)
|
||||
|
||||
7.0.4 / 2021-04-08
|
||||
==================
|
||||
|
||||
* Fix usage with TypeScript
|
||||
|
||||
7.0.3 / 2021-03-02
|
||||
==================
|
||||
|
||||
* Removing the use of eval in Node.js (#331)
|
||||
* Drop Node 8
|
||||
* Add docs about typings (#357)
|
||||
|
||||
7.0.2 / 2021-01-18
|
||||
==================
|
||||
|
||||
* Make config options optional in TypeScript defs (#354)
|
||||
|
||||
7.0.1 / 2021-01-14
|
||||
==================
|
||||
|
||||
* Update README section about browser use
|
||||
|
||||
7.0.0 / 2021-01-12
|
||||
==================
|
||||
|
||||
* Remove bundle from package. If you're loading `fake-timers` via
|
||||
script tag, you'll now have to provide your own bundled version
|
||||
* Add .d.ts files to package
|
||||
* Revert "Add stack trace to code recursively scheduling timers" (#338)
|
||||
* Remove unnecessary durations and use globals
|
||||
* Support timeout.refresh in node environments
|
||||
* Fix #319: Error message changed to TypeError
|
||||
* Fix #319: The use of 'eval' has been removed
|
||||
* Fix #304: clearTimeout clears setInterval and clearInterval clears setTimeout
|
||||
* Remove config.target (#318)
|
||||
|
||||
|
||||
6.0.1 / 2020-03-24
|
||||
==================
|
||||
|
||||
* Support util.promisify in Node (#223)
|
||||
|
||||
6.0.0 / 2020-02-04
|
||||
==================
|
||||
|
||||
* Rename project to `@sinonjs/fake-timers`
|
||||
|
||||
5.1.2 / 2019-12-19
|
||||
==================
|
||||
|
||||
* Use global from `@sinonjs/commons`
|
||||
* Fix setSystemTime affects hrtime if its called multiple times.
|
||||
* Test coverage: use nyc
|
||||
|
||||
5.1.1 / 2019-10-21
|
||||
==================
|
||||
|
||||
* Fix global ReferenceError (#273)
|
||||
|
||||
5.1.0 / 2019-10-14
|
||||
==================
|
||||
|
||||
* Upgrade lolex with async versions of most calls
|
||||
|
||||
5.0.1 / 2019-10-10
|
||||
==================
|
||||
|
||||
* Upgrade eslint, add prettier
|
||||
* Use `--no-detect-globals` to bundle and test lolex (#270)
|
||||
|
||||
5.0.0 / 2019-10-07
|
||||
==================
|
||||
|
||||
* Avoid installing setImmediate in unsupported environments
|
||||
* fix #246: non-constructor Date() should return a string
|
||||
|
||||
4.2.0 / 2019-08-04
|
||||
==================
|
||||
|
||||
* Fix support for replacing the JSDOM performance field
|
||||
|
||||
4.1.0 / 2019-06-04
|
||||
==================
|
||||
|
||||
* Fix crash on Bash version 3 (macOS)
|
||||
* Support hrtime.bigint()
|
||||
* fix: count microtasks in countTimers
|
||||
* Return empty arrays for performance.getEntries, other relevant methods
|
||||
|
||||
4.0.1 / 2019-04-17
|
||||
==================
|
||||
|
||||
* Remove sinon: added by mistake
|
||||
|
||||
4.0.0 / 2019-04-17
|
||||
==================
|
||||
|
||||
* Drop support for IE9 and IE10: link to supported browsers in README
|
||||
* No more ExperimentalWarnings in Node environment for queueMicrotask() if it's not used in user's code
|
||||
|
||||
3.1.0 / 2019-02-11
|
||||
==================
|
||||
|
||||
* default timeout set to 50ms
|
||||
* first implementation of requestIdleCallback and cancelIdleCallback
|
||||
* fixed accidentally performance.now() -> x.now() replacement
|
||||
* added queueMicrotask
|
||||
|
||||
3.0.0 / 2018-10-08
|
||||
==================
|
||||
|
||||
* Add countTimers method
|
||||
* Disallow negative ticks (breaking API change!)
|
||||
* Avoid exposing hrNow
|
||||
* Fix #207 - round-off errors in `hrtime`
|
||||
* Truncate sub-nanosecond values for `hrtime`
|
||||
* Truncate sub-millisceond values for `Date.now()`
|
||||
|
||||
v2.7.5 / 2018-09-19
|
||||
==================
|
||||
|
||||
* fix: handle floating point in hrtime (#210)
|
||||
* fix: reset high resolution timer on clock.reset (#209)
|
||||
* Add an error when creating a clock with no Date object (#205)
|
||||
|
||||
v2.7.4 / 2018-09-05
|
||||
==================
|
||||
|
||||
* performance.mark related fixes for failing Safari, IE 10 and IE 11 tests
|
||||
|
||||
v2.7.3 / 2018-09-05
|
||||
==================
|
||||
|
||||
* Fix for #200: TypeError on performance.mark
|
||||
|
||||
v2.7.2 / 2018-09-04
|
||||
==================
|
||||
|
||||
* fix(setInterval): parse `timeout` arg to integer (#202)
|
||||
* Upgrade insecure dependencies with npm audit fix
|
||||
|
||||
v2.7.1 / 2018-07-06
|
||||
==================
|
||||
* Fix performance replacement on iOS 9.3
|
||||
|
||||
v2.7.0 / 2018-05-25
|
||||
==================
|
||||
|
||||
* reset clock to start
|
||||
* check Performance exists before touching it
|
||||
|
||||
v2.6.0 / 2018-05-16
|
||||
==================
|
||||
|
||||
* Fix `reset` and document it publicly Clear microtick jobs and set now to 0 in reset (#179)
|
||||
* Access Date on `_global` (#178)
|
||||
|
||||
v2.5.0 / 2018-05-13
|
||||
==================
|
||||
|
||||
* feat: respect loopLimit in runMicrotasks (#172)
|
||||
* assign performance as a property, not as a function
|
||||
|
||||
v2.4.2 / 2018-05-11
|
||||
===================
|
||||
* Upgrade Mochify to v5.6 (#162) fixed #170
|
||||
* Access `Performance` via `_global` (#168)
|
||||
|
||||
v2.4.1 / 2018-05-08
|
||||
==================
|
||||
|
||||
* fix: handle negative infinity timeout (#165)
|
||||
|
||||
v2.4.0 / 2018-05-08
|
||||
==================
|
||||
|
||||
* Add `withGlobal` export
|
||||
* expose runMicrotasks
|
||||
* Fix that performance.mark is undefined after timer install
|
||||
|
||||
v2.3.2 / 2018-01-29
|
||||
==================
|
||||
|
||||
* Add files section to package.json to avoid unnecessary package bloat #154
|
||||
* Add missing functions in default `toFake` #150
|
||||
|
||||
v2.3.1 / 2017-11-22
|
||||
==================
|
||||
|
||||
* bugfix for a setTimeout() or setSystemTime() within a nextTick() call. (#145)
|
||||
|
||||
v2.3.0 / 2017-11-08
|
||||
==================
|
||||
|
||||
* Stops leak of (request|cancel)AnimationFrame into global scope. (#143)
|
||||
* return timers on uninstall
|
||||
|
||||
v2.2.0 / 2017-11-07
|
||||
==================
|
||||
|
||||
* Add support for requestAnimationFrame
|
||||
* fix negative timeout bug
|
||||
|
||||
v2.1.3 / 2017-10-03
|
||||
==================
|
||||
|
||||
* add module entry point (#133)
|
||||
|
||||
v2.1.2 / 2017-07-25
|
||||
==================
|
||||
|
||||
* - does not fake process.nextTick by default - added .idea folder to .gitignore - fixed documentation - added clock teardowns in tests
|
||||
* overflowing the timer correctly (issue #67)
|
||||
|
||||
v2.1.1 / 2017-07-19
|
||||
==================
|
||||
|
||||
* support passing parameters in nextTick (fixes #122)
|
||||
|
||||
v2.1.0 / 2017-07-18
|
||||
==================
|
||||
|
||||
* Throw error on incorrect install use (#112)
|
||||
* Add support for process.nextTick
|
||||
* lolex can now attach itself to the system timers and automatically ad… (#102)
|
||||
* update hrtime when an interval ticks
|
||||
|
||||
v2.0.0 / 2017-07-13
|
||||
==================
|
||||
|
||||
* New install() signature
|
||||
* Add support for performance.now (#106)
|
||||
* Fix issue with tick(): setSystemClock then throw
|
||||
* Update old dependencies
|
||||
* Added support to automatically increment time (#85)
|
||||
* Changed internal uninstall method signature
|
||||
|
||||
v1.6.0 / 2017-02-25
|
||||
===================
|
||||
|
||||
* Use common Sinon.JS eslint config
|
||||
* Allow install to be called with date object
|
||||
* Remove wrapper function
|
||||
* Fixed typo in clock.runAll error
|
||||
|
||||
v1.5.2 / 2016-11-10
|
||||
===================
|
||||
|
||||
* Upgrade mocha to latest
|
||||
* Only overwrite globals when running in IE
|
||||
|
||||
1.5.1 / 2016-07-26
|
||||
==================
|
||||
|
||||
* Fix setInterval() behavior with string times
|
||||
* Incorporate test from PR #65
|
||||
* Fix issue #59: context object required 'process'
|
||||
* fixed a case where runAll was called and there are no timers (#70)
|
||||
* Correct the clear{Interval|Timeout|Immediate} error message when calling `set*` for a different type of timer.
|
||||
* Lots of minor changes to tooling and the build process
|
||||
|
||||
v1.5.0 / 2016-05-18
|
||||
===================
|
||||
|
||||
* 1.5.0
|
||||
* Check for existence of `process` before using it
|
||||
* Run to last existing timer
|
||||
* Add runAll method to run timers until empty
|
||||
* Turn off Sauce Labs tests for pull requests
|
||||
* Add tests demonstrating that a fake Date could be created with one argument as a String since this string is in a format recognized by the Date.parse() method.
|
||||
* Run test-cloud on Travis
|
||||
* Add process.hrtime()
|
||||
* Add bithound badge to Readme.md
|
||||
* Make Travis also run tests in node 4.2
|
||||
* Update jslint, referee, sinon, browserify, mocha, mochify
|
||||
* Rename src/lolex.js to src/lolex-src.js to avoid bithound ignoring it
|
||||
* Add .bithoundrc
|
||||
|
||||
v1.4.0 / 2015-12-11
|
||||
===================
|
||||
|
||||
* 1.4.0
|
||||
* Remove BASH syntax in lint script
|
||||
* correct test descriptions to match the tests
|
||||
* correct parseTime() error message so it matches behavior
|
||||
* don't run test-cloud as part of npm test
|
||||
* doc: full API reference
|
||||
* doc: update 'Running tests' section
|
||||
* doc: update 'Faking the native timers' section
|
||||
* doc: remove requestAnimationFrame
|
||||
* Implement clock.next()
|
||||
* Run lint in CI
|
||||
* Fix jslint errors
|
||||
|
||||
v1.3.2 / 2015-09-22
|
||||
===================
|
||||
|
||||
* 1.3.2
|
||||
* Fix for breaking shimmed setImmediate
|
||||
|
||||
v1.3.1 / 2015-08-20
|
||||
===================
|
||||
|
||||
* Remove error whos reason is no longer accurate
|
||||
|
||||
v1.3.0 / 2015-08-19
|
||||
===================
|
||||
|
||||
* 1.3.0
|
||||
* Throw exception on wrong use of clearXYZ()
|
||||
* Fix for Sinon.JS issue #808 :add setSystemTime() function
|
||||
* Fix for Sinon.JS issue #766: clearTimeout() no longer clears Immediate/Interval and vice versa
|
||||
* Update Readme.md to point to LICENSE file
|
||||
* Fix error in readme about running tests
|
||||
* Fix for warning about SPDX license format on npm install
|
||||
|
||||
v1.2.2 / 2015-07-22
|
||||
===================
|
||||
|
||||
* 1.2.2
|
||||
* Fixing lint mistake
|
||||
* Update travis to use node@0.12
|
||||
* Fix complaint about missing fake setImmediate
|
||||
* Use license in package.json
|
||||
|
||||
v1.2.1 / 2015-01-06
|
||||
===================
|
||||
|
||||
* New build
|
||||
* Dodge JSLint...
|
||||
* Up version
|
||||
* Proper fix for writable globals in IE
|
||||
* Make timers writable in old IEs
|
||||
|
||||
v1.2.0 / 2014-12-12
|
||||
===================
|
||||
|
||||
* 1.2.0
|
||||
* Fix Sinon.JS issue 624
|
||||
* Lint the test files also
|
||||
* Add .jslintrc
|
||||
* Delay setImmediate if it is during tick call
|
||||
* Add test case
|
||||
* Test behaviour of hasOwnProperty beforehand
|
||||
* Compare now() with delta
|
||||
* Use undefined for defined predicate
|
||||
* Put setImmediate in toFake list
|
||||
* Capture clock instance for uninstall
|
||||
* Restore commented out tests
|
||||
* Add JSLint verification to test
|
||||
* Configure Travis to run tests in node 0.10.x
|
||||
* Add .editorconfig
|
||||
* Fail when faking Date but not setTimeout/setInterval
|
||||
|
||||
v1.1.10 / 2014-11-14
|
||||
====================
|
||||
|
||||
* 1.1.0 Fixes setImmediate problems
|
||||
* Rely on `timer` initialization to null
|
||||
* Timer assembly occurs at addTimer callsites
|
||||
* Sort immediate timers before non-immediate
|
||||
* Add createdAt to timers
|
||||
* Sort timers by multiple criteria, not just callAt
|
||||
* Refactor firstTimerInRange
|
||||
* Rename `timeouts` property to `timers`
|
||||
* addTimer is options-driven
|
||||
|
||||
v1.0.0 / 2014-11-12
|
||||
===================
|
||||
|
||||
* Add built file for browsers
|
||||
* Fix URL
|
||||
* Don't run tests that require global.__proto__ on IE 9 and IE 10
|
||||
* Add "bundle" script to create standalone UMD bundle with browserify
|
||||
* Float with new test framework versions
|
||||
* Remove redundant module prefix
|
||||
* Let Browserify set "global" for us
|
||||
* Change test framework from Buster to Mocha and Mochify
|
||||
* Make timer functions independent on `this`
|
||||
* Change APIs according to Readme
|
||||
* Change clock-creating interface
|
||||
* Change Github paths
|
||||
* Basically working extraction from Sinon.JS
|
||||
11
node_modules/@sinonjs/fake-timers/LICENSE
generated
vendored
11
node_modules/@sinonjs/fake-timers/LICENSE
generated
vendored
|
|
@ -1,11 +0,0 @@
|
|||
Copyright (c) 2010-2014, Christian Johansen, christian@cjohansen.no. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
366
node_modules/@sinonjs/fake-timers/README.md
generated
vendored
366
node_modules/@sinonjs/fake-timers/README.md
generated
vendored
|
|
@ -1,366 +0,0 @@
|
|||
# `@sinonjs/fake-timers`
|
||||
|
||||
[](https://circleci.com/gh/sinonjs/fake-timers)
|
||||
[](https://codecov.io/gh/sinonjs/fake-timers)
|
||||
<a href="CODE_OF_CONDUCT.md"><img src="https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg" alt="Contributor Covenant" /></a>
|
||||
|
||||
JavaScript implementation of the timer APIs; `setTimeout`, `clearTimeout`, `setImmediate`, `clearImmediate`, `setInterval`, `clearInterval`, `requestAnimationFrame`, `cancelAnimationFrame`, `requestIdleCallback`, and `cancelIdleCallback`, along with a clock instance that controls the flow of time. FakeTimers also provides a `Date` implementation that gets its time from the clock.
|
||||
|
||||
In addition in browser environment `@sinonjs/fake-timers` provides a `performance` implementation that gets its time from the clock. In Node environments FakeTimers provides a `nextTick` implementation that is synchronized with the clock - and a `process.hrtime` shim that works with the clock.
|
||||
|
||||
`@sinonjs/fake-timers` can be used to simulate passing time in automated tests and other
|
||||
situations where you want the scheduling semantics, but don't want to actually
|
||||
wait.
|
||||
|
||||
`@sinonjs/fake-timers` is extracted from [Sinon.JS](https://github.com/sinonjs/sinon.js) and targets the [same runtimes](https://sinonjs.org/releases/latest/#supported-runtimes).
|
||||
|
||||
## Help us get our TypeScript definitions production ready!
|
||||
|
||||
In version 7 we introduced TypeScript definitions that are generated from our JSDoc. This makes importing types from [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/sinonjs__fake-timers/index.d.ts) superfluous, but we have just gotten started and we need your work for this to be up to the same quality. Until that happens typings from DefinitelyTyped still can be used:
|
||||
|
||||
```sh
|
||||
npm install -D @types/sinonjs__fake-timers
|
||||
```
|
||||
|
||||
Add this to tsconfig.json
|
||||
|
||||
```
|
||||
{
|
||||
"compilerOptions": {
|
||||
...
|
||||
"paths": {
|
||||
...
|
||||
"@sinonjs/fake-timers": ["node_modules/@types/sinonjs__fake-timers"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
`@sinonjs/fake-timers` can be used in both Node and browser environments. Installation is as easy as
|
||||
|
||||
```sh
|
||||
npm install @sinonjs/fake-timers
|
||||
```
|
||||
|
||||
If you want to use `@sinonjs/fake-timers` in a browser you can either build your own bundle or use [Skypack](https://www.skypack.dev).
|
||||
|
||||
## Usage
|
||||
|
||||
To use `@sinonjs/fake-timers`, create a new clock, schedule events on it using the timer
|
||||
functions and pass time using the `tick` method.
|
||||
|
||||
```js
|
||||
// In the browser distribution, a global `FakeTimers` is already available
|
||||
var FakeTimers = require("@sinonjs/fake-timers");
|
||||
var clock = FakeTimers.createClock();
|
||||
|
||||
clock.setTimeout(function () {
|
||||
console.log(
|
||||
"The poblano is a mild chili pepper originating in the state of Puebla, Mexico."
|
||||
);
|
||||
}, 15);
|
||||
|
||||
// ...
|
||||
|
||||
clock.tick(15);
|
||||
```
|
||||
|
||||
Upon executing the last line, an interesting fact about the
|
||||
[Poblano](https://en.wikipedia.org/wiki/Poblano) will be printed synchronously to
|
||||
the screen. If you want to simulate asynchronous behavior, you have to use your
|
||||
imagination when calling the various functions.
|
||||
|
||||
The `next`, `runAll`, `runToFrame`, and `runToLast` methods are available to advance the clock. See the
|
||||
API Reference for more details.
|
||||
|
||||
### Faking the native timers
|
||||
|
||||
When using `@sinonjs/fake-timers` to test timers, you will most likely want to replace the native
|
||||
timers such that calling `setTimeout` actually schedules a callback with your
|
||||
clock instance, not the browser's internals.
|
||||
|
||||
Calling `install` with no arguments achieves this. You can call `uninstall`
|
||||
later to restore things as they were again.
|
||||
|
||||
```js
|
||||
// In the browser distribution, a global `FakeTimers` is already available
|
||||
var FakeTimers = require("@sinonjs/fake-timers");
|
||||
|
||||
var clock = FakeTimers.install();
|
||||
// Equivalent to
|
||||
// var clock = FakeTimers.install(typeof global !== "undefined" ? global : window);
|
||||
|
||||
setTimeout(fn, 15); // Schedules with clock.setTimeout
|
||||
|
||||
clock.uninstall();
|
||||
// setTimeout is restored to the native implementation
|
||||
```
|
||||
|
||||
To hijack timers in another context pass it to the `install` method.
|
||||
|
||||
```js
|
||||
var FakeTimers = require("@sinonjs/fake-timers");
|
||||
var context = {
|
||||
setTimeout: setTimeout, // By default context.setTimeout uses the global setTimeout
|
||||
};
|
||||
var clock = FakeTimers.withGlobal(context).install();
|
||||
|
||||
context.setTimeout(fn, 15); // Schedules with clock.setTimeout
|
||||
|
||||
clock.uninstall();
|
||||
// context.setTimeout is restored to the original implementation
|
||||
```
|
||||
|
||||
Usually you want to install the timers onto the global object, so call `install`
|
||||
without arguments.
|
||||
|
||||
#### Automatically incrementing mocked time
|
||||
|
||||
FakeTimers supports the possibility to attach the faked timers to any change
|
||||
in the real system time. This means that there is no need to `tick()` the
|
||||
clock in a situation where you won't know **when** to call `tick()`.
|
||||
|
||||
Please note that this is achieved using the original setImmediate() API at a certain
|
||||
configurable interval `config.advanceTimeDelta` (default: 20ms). Meaning time would
|
||||
be incremented every 20ms, not in real time.
|
||||
|
||||
An example would be:
|
||||
|
||||
```js
|
||||
var FakeTimers = require("@sinonjs/fake-timers");
|
||||
var clock = FakeTimers.install({
|
||||
shouldAdvanceTime: true,
|
||||
advanceTimeDelta: 40,
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
console.log("this just timed out"); //executed after 40ms
|
||||
}, 30);
|
||||
|
||||
setImmediate(() => {
|
||||
console.log("not so immediate"); //executed after 40ms
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
console.log("this timed out after"); //executed after 80ms
|
||||
clock.uninstall();
|
||||
}, 50);
|
||||
```
|
||||
|
||||
## API Reference
|
||||
|
||||
### `var clock = FakeTimers.createClock([now[, loopLimit]])`
|
||||
|
||||
Creates a clock. The default
|
||||
[epoch](https://en.wikipedia.org/wiki/Epoch_%28reference_date%29) is `0`.
|
||||
|
||||
The `now` argument may be a number (in milliseconds) or a Date object.
|
||||
|
||||
The `loopLimit` argument sets the maximum number of timers that will be run when calling `runAll()` before assuming that we have an infinite loop and throwing an error. The default is `1000`.
|
||||
|
||||
### `var clock = FakeTimers.install([config])`
|
||||
|
||||
Installs FakeTimers using the specified config (otherwise with epoch `0` on the global scope). The following configuration options are available
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
| -------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `config.now` | Number/Date | 0 | installs FakeTimers with the specified unix epoch |
|
||||
| `config.toFake` | String[] | ["setTimeout", "clearTimeout", "setImmediate", "clearImmediate","setInterval", "clearInterval", "Date", "requestAnimationFrame", "cancelAnimationFrame", "requestIdleCallback", "cancelIdleCallback", "hrtime"] | an array with explicit function names to hijack. _When not set, FakeTimers will automatically fake all methods **except** `nextTick`_ e.g., `FakeTimers.install({ toFake: ["setTimeout","nextTick"]})` will fake only `setTimeout` and `nextTick` |
|
||||
| `config.loopLimit` | Number | 1000 | the maximum number of timers that will be run when calling runAll() |
|
||||
| `config.shouldAdvanceTime` | Boolean | false | tells FakeTimers to increment mocked time automatically based on the real system time shift (e.g. the mocked time will be incremented by 20ms for every 20ms change in the real system time) |
|
||||
| `config.advanceTimeDelta` | Number | 20 | relevant only when using with `shouldAdvanceTime: true`. increment mocked time by `advanceTimeDelta` ms every `advanceTimeDelta` ms change in the real system time. |
|
||||
|
||||
### `var id = clock.setTimeout(callback, timeout)`
|
||||
|
||||
Schedules the callback to be fired once `timeout` milliseconds have ticked by.
|
||||
|
||||
In Node.js `setTimeout` returns a timer object. FakeTimers will do the same, however
|
||||
its `ref()` and `unref()` methods have no effect.
|
||||
|
||||
In browsers a timer ID is returned.
|
||||
|
||||
### `clock.clearTimeout(id)`
|
||||
|
||||
Clears the timer given the ID or timer object, as long as it was created using
|
||||
`setTimeout`.
|
||||
|
||||
### `var id = clock.setInterval(callback, timeout)`
|
||||
|
||||
Schedules the callback to be fired every time `timeout` milliseconds have ticked
|
||||
by.
|
||||
|
||||
In Node.js `setInterval` returns a timer object. FakeTimers will do the same, however
|
||||
its `ref()` and `unref()` methods have no effect.
|
||||
|
||||
In browsers a timer ID is returned.
|
||||
|
||||
### `clock.clearInterval(id)`
|
||||
|
||||
Clears the timer given the ID or timer object, as long as it was created using
|
||||
`setInterval`.
|
||||
|
||||
### `var id = clock.setImmediate(callback)`
|
||||
|
||||
Schedules the callback to be fired once `0` milliseconds have ticked by. Note
|
||||
that you'll still have to call `clock.tick()` for the callback to fire. If
|
||||
called during a tick the callback won't fire until `1` millisecond has ticked
|
||||
by.
|
||||
|
||||
In Node.js `setImmediate` returns a timer object. FakeTimers will do the same,
|
||||
however its `ref()` and `unref()` methods have no effect.
|
||||
|
||||
In browsers a timer ID is returned.
|
||||
|
||||
### `clock.clearImmediate(id)`
|
||||
|
||||
Clears the timer given the ID or timer object, as long as it was created using
|
||||
`setImmediate`.
|
||||
|
||||
### `clock.requestAnimationFrame(callback)`
|
||||
|
||||
Schedules the callback to be fired on the next animation frame, which runs every
|
||||
16 ticks. Returns an `id` which can be used to cancel the callback. This is
|
||||
available in both browser & node environments.
|
||||
|
||||
### `clock.cancelAnimationFrame(id)`
|
||||
|
||||
Cancels the callback scheduled by the provided id.
|
||||
|
||||
### `clock.requestIdleCallback(callback[, timeout])`
|
||||
|
||||
Queued the callback to be fired during idle periods to perform background and low priority work on the main event loop. Callbacks which have a timeout option will be fired no later than time in milliseconds. Returns an `id` which can be used to cancel the callback.
|
||||
|
||||
### `clock.cancelIdleCallback(id)`
|
||||
|
||||
Cancels the callback scheduled by the provided id.
|
||||
|
||||
### `clock.countTimers()`
|
||||
|
||||
Returns the number of waiting timers. This can be used to assert that a test
|
||||
finishes without leaking any timers.
|
||||
|
||||
### `clock.hrtime(prevTime?)`
|
||||
|
||||
Only available in Node.js, mimicks process.hrtime().
|
||||
|
||||
### `clock.nextTick(callback)`
|
||||
|
||||
Only available in Node.js, mimics `process.nextTick` to enable completely synchronous testing flows.
|
||||
|
||||
### `clock.performance.now()`
|
||||
|
||||
Only available in browser environments, mimicks performance.now().
|
||||
|
||||
### `clock.tick(time)` / `await clock.tickAsync(time)`
|
||||
|
||||
Advance the clock, firing callbacks if necessary. `time` may be the number of
|
||||
milliseconds to advance the clock by or a human-readable string. Valid string
|
||||
formats are `"08"` for eight seconds, `"01:00"` for one minute and `"02:34:10"`
|
||||
for two hours, 34 minutes and ten seconds.
|
||||
|
||||
The `tickAsync()` will also break the event loop, allowing any scheduled promise
|
||||
callbacks to execute _before_ running the timers.
|
||||
|
||||
### `clock.next()` / `await clock.nextAsync()`
|
||||
|
||||
Advances the clock to the the moment of the first scheduled timer, firing it.
|
||||
|
||||
The `nextAsync()` will also break the event loop, allowing any scheduled promise
|
||||
callbacks to execute _before_ running the timers.
|
||||
|
||||
### `clock.reset()`
|
||||
|
||||
Removes all timers and ticks without firing them, and sets `now` to `config.now`
|
||||
that was provided to `FakeTimers.install` or to `0` if `config.now` was not provided.
|
||||
Useful to reset the state of the clock without having to `uninstall` and `install` it.
|
||||
|
||||
### `clock.runAll()` / `await clock.runAllAsync()`
|
||||
|
||||
This runs all pending timers until there are none remaining. If new timers are added while it is executing they will be run as well.
|
||||
|
||||
This makes it easier to run asynchronous tests to completion without worrying about the number of timers they use, or the delays in those timers.
|
||||
|
||||
It runs a maximum of `loopLimit` times after which it assumes there is an infinite loop of timers and throws an error.
|
||||
|
||||
The `runAllAsync()` will also break the event loop, allowing any scheduled promise
|
||||
callbacks to execute _before_ running the timers.
|
||||
|
||||
### `clock.runMicrotasks()`
|
||||
|
||||
This runs all pending microtasks scheduled with `nextTick` but none of the timers and is mostly useful for libraries using FakeTimers underneath and for running `nextTick` items without any timers.
|
||||
|
||||
### `clock.runToFrame()`
|
||||
|
||||
Advances the clock to the next frame, firing all scheduled animation frame callbacks,
|
||||
if any, for that frame as well as any other timers scheduled along the way.
|
||||
|
||||
### `clock.runToLast()` / `await clock.runToLastAsync()`
|
||||
|
||||
This takes note of the last scheduled timer when it is run, and advances the
|
||||
clock to that time firing callbacks as necessary.
|
||||
|
||||
If new timers are added while it is executing they will be run only if they
|
||||
would occur before this time.
|
||||
|
||||
This is useful when you want to run a test to completion, but the test recursively
|
||||
sets timers that would cause `runAll` to trigger an infinite loop warning.
|
||||
|
||||
The `runToLastAsync()` will also break the event loop, allowing any scheduled promise
|
||||
callbacks to execute _before_ running the timers.
|
||||
|
||||
### `clock.setSystemTime([now])`
|
||||
|
||||
This simulates a user changing the system clock while your program is running.
|
||||
It affects the current time but it does not in itself cause e.g. timers to fire;
|
||||
they will fire exactly as they would have done without the call to
|
||||
setSystemTime().
|
||||
|
||||
### `clock.uninstall()`
|
||||
|
||||
Restores the original methods of the native timers or the methods on the object
|
||||
that was passed to `FakeTimers.withGlobal`
|
||||
|
||||
### `Date`
|
||||
|
||||
Implements the `Date` object but using the clock to provide the correct time.
|
||||
|
||||
### `Performance`
|
||||
|
||||
Implements the `now` method of the [`Performance`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now) object but using the clock to provide the correct time. Only available in environments that support the Performance object (browsers mostly).
|
||||
|
||||
### `FakeTimers.withGlobal`
|
||||
|
||||
In order to support creating clocks based on separate or sandboxed environments (such as JSDOM), FakeTimers exports a factory method which takes single argument `global`, which it inspects to figure out what to mock and what features to support. When invoking this function with a global, you will get back an object with `timers`, `createClock` and `install` - same as the regular FakeTimers exports only based on the passed in global instead of the global environment.
|
||||
|
||||
## Running tests
|
||||
|
||||
FakeTimers has a comprehensive test suite. If you're thinking of contributing bug
|
||||
fixes or suggesting new features, you need to make sure you have not broken any
|
||||
tests. You are also expected to add tests for any new behavior.
|
||||
|
||||
### On node:
|
||||
|
||||
```sh
|
||||
npm test
|
||||
```
|
||||
|
||||
Or, if you prefer more verbose output:
|
||||
|
||||
```
|
||||
$(npm bin)/mocha ./test/fake-timers-test.js
|
||||
```
|
||||
|
||||
### In the browser
|
||||
|
||||
[Mochify](https://github.com/mantoni/mochify.js) is used to run the tests in
|
||||
PhantomJS. Make sure you have `phantomjs` installed. Then:
|
||||
|
||||
```sh
|
||||
npm test-headless
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
BSD 3-clause "New" or "Revised" License (see LICENSE file)
|
||||
84
node_modules/@sinonjs/fake-timers/package.json
generated
vendored
84
node_modules/@sinonjs/fake-timers/package.json
generated
vendored
|
|
@ -1,84 +0,0 @@
|
|||
{
|
||||
"name": "@sinonjs/fake-timers",
|
||||
"description": "Fake JavaScript timers",
|
||||
"version": "7.1.2",
|
||||
"homepage": "https://github.com/sinonjs/fake-timers",
|
||||
"author": "Christian Johansen",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sinonjs/fake-timers.git"
|
||||
},
|
||||
"bugs": {
|
||||
"mail": "christian@cjohansen.no",
|
||||
"url": "https://github.com/sinonjs/fake-timers/issues"
|
||||
},
|
||||
"license": "BSD-3-Clause",
|
||||
"scripts": {
|
||||
"build": "rm -rf types && tsc",
|
||||
"lint": "eslint .",
|
||||
"test-node": "mocha test/ integration-test/ -R dot --check-leaks",
|
||||
"test-headless": "mochify --no-detect-globals --timeout=10000",
|
||||
"test-check-coverage": "npm run test-coverage && nyc check-coverage",
|
||||
"test-cloud": "mochify --wd --no-detect-globals --timeout=10000",
|
||||
"test-coverage": "nyc --all --reporter text --reporter html --reporter lcovonly npm run test-node",
|
||||
"test-types": "tsd && tsc --noEmit test/check-types.ts",
|
||||
"test": "npm run test-node && npm run test-headless",
|
||||
"prettier:check": "prettier --check '**/*.{js,css,md,ts}'",
|
||||
"prettier:write": "prettier --write '**/*.{js,css,md,ts}'",
|
||||
"prepublishOnly": "npm run build",
|
||||
"preversion": "./scripts/preversion.sh",
|
||||
"version": "./scripts/version.sh",
|
||||
"postversion": "./scripts/postversion.sh"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,css,md}": "prettier --check",
|
||||
"*.js": "eslint"
|
||||
},
|
||||
"files": [
|
||||
"src/",
|
||||
"types"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@sinonjs/referee-sinon": "6.0.1",
|
||||
"eslint": "6.8.0",
|
||||
"eslint-config-prettier": "6.10.0",
|
||||
"eslint-config-sinon": "3.0.1",
|
||||
"eslint-plugin-ie11": "1.0.0",
|
||||
"eslint-plugin-mocha": "6.2.2",
|
||||
"eslint-plugin-prettier": "3.1.1",
|
||||
"husky": "4.2.1",
|
||||
"jsdom": "16.5.2",
|
||||
"lint-staged": "10.0.7",
|
||||
"mocha": "8.3.2",
|
||||
"mochify": "7.0.0",
|
||||
"nyc": "14.1.1",
|
||||
"prettier": "2.2.1",
|
||||
"tsd": "0.14.0",
|
||||
"typescript": "4.1.3"
|
||||
},
|
||||
"main": "./src/fake-timers-src.js",
|
||||
"types": "./types/fake-timers-src.d.ts",
|
||||
"dependencies": {
|
||||
"@sinonjs/commons": "^1.7.0"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "npm run lint"
|
||||
}
|
||||
},
|
||||
"nyc": {
|
||||
"branches": 85,
|
||||
"lines": 92,
|
||||
"functions": 92,
|
||||
"statements": 92,
|
||||
"exclude": [
|
||||
"**/*-test.js",
|
||||
"coverage/**",
|
||||
"types/**",
|
||||
"fake-timers.js"
|
||||
]
|
||||
},
|
||||
"tsd": {
|
||||
"directory": "test"
|
||||
}
|
||||
}
|
||||
1409
node_modules/@sinonjs/fake-timers/src/fake-timers-src.js
generated
vendored
1409
node_modules/@sinonjs/fake-timers/src/fake-timers-src.js
generated
vendored
File diff suppressed because it is too large
Load diff
187
node_modules/@sinonjs/fake-timers/types/fake-timers-src.d.ts
generated
vendored
187
node_modules/@sinonjs/fake-timers/types/fake-timers-src.d.ts
generated
vendored
|
|
@ -1,187 +0,0 @@
|
|||
export type Clock = {
|
||||
now: number;
|
||||
timeouts: any;
|
||||
Date: typeof globalThis.Date;
|
||||
loopLimit: number;
|
||||
requestIdleCallback: (func: Function, timeout: number) => number;
|
||||
cancelIdleCallback: (timerId: number) => void;
|
||||
setTimeout: typeof setTimeout;
|
||||
clearTimeout: typeof clearTimeout;
|
||||
nextTick: (func: Function, ...args: any[]) => void;
|
||||
queueMicrotask: typeof queueMicrotask;
|
||||
setInterval: typeof setInterval;
|
||||
clearInterval: typeof clearInterval;
|
||||
setImmediate: (func: (...args: any[]) => void, ...args: any[]) => NodeTimer;
|
||||
clearImmediate: (timerId: NodeTimer) => void;
|
||||
countTimers: () => number;
|
||||
requestAnimationFrame: (func: (timer: number) => void) => number;
|
||||
cancelAnimationFrame: (timerId: number) => void;
|
||||
runMicrotasks: () => void;
|
||||
tick: (tickValue: string | number) => number;
|
||||
tickAsync: (tickValue: string | number) => Promise<number>;
|
||||
next: () => number;
|
||||
nextAsync: () => Promise<number>;
|
||||
runAll: () => number;
|
||||
runToFrame: () => number;
|
||||
runAllAsync: () => Promise<number>;
|
||||
runToLast: () => number;
|
||||
runToLastAsync: () => Promise<number>;
|
||||
reset: () => void;
|
||||
setSystemTime: (systemTime: number | Date) => void;
|
||||
performance: ({
|
||||
now(): number;
|
||||
});
|
||||
hrTime: (prev: any) => number[];
|
||||
/**
|
||||
* Uninstall the clock.
|
||||
*/
|
||||
uninstall: () => void;
|
||||
methods: any;
|
||||
};
|
||||
/**
|
||||
* Configuration object for the `install` method.
|
||||
*/
|
||||
export type Config = {
|
||||
/**
|
||||
* a number (in milliseconds) or a Date object (default epoch)
|
||||
*/
|
||||
now?: number | Date;
|
||||
/**
|
||||
* names of the methods that should be faked.
|
||||
*/
|
||||
toFake?: string[];
|
||||
/**
|
||||
* the maximum number of timers that will be run when calling runAll()
|
||||
*/
|
||||
loopLimit?: number;
|
||||
/**
|
||||
* tells FakeTimers to increment mocked time automatically (default false)
|
||||
*/
|
||||
shouldAdvanceTime?: boolean;
|
||||
/**
|
||||
* increment mocked time every <<advanceTimeDelta>> ms (default: 20ms)
|
||||
*/
|
||||
advanceTimeDelta?: number;
|
||||
};
|
||||
export type NodeTimer = {
|
||||
hasRef: () => boolean;
|
||||
ref: () => any;
|
||||
unref: () => any;
|
||||
};
|
||||
export namespace timers {
|
||||
const setTimeout_1: typeof globalThis.setTimeout;
|
||||
export { setTimeout_1 as setTimeout };
|
||||
const clearTimeout_1: typeof globalThis.clearTimeout;
|
||||
export { clearTimeout_1 as clearTimeout };
|
||||
const setInterval_1: typeof globalThis.setInterval;
|
||||
export { setInterval_1 as setInterval };
|
||||
const clearInterval_1: typeof globalThis.clearInterval;
|
||||
export { clearInterval_1 as clearInterval };
|
||||
const Date_1: typeof globalThis.Date;
|
||||
export { Date_1 as Date };
|
||||
export const setImmediate: (fn: (...args: any[]) => void, ...args: any[]) => NodeTimer;
|
||||
export const clearImmediate: (id: NodeTimer) => void;
|
||||
export const hrtime: (time?: [number, number]) => [number, number];
|
||||
export const nextTick: (fn: Function, ...args: any[]) => void;
|
||||
export const performance: ({
|
||||
now(): number;
|
||||
}) | undefined;
|
||||
export const requestAnimationFrame: (fn: (timer: number) => void) => number;
|
||||
const queueMicrotask_1: boolean | undefined;
|
||||
export { queueMicrotask_1 as queueMicrotask };
|
||||
export const cancelAnimationFrame: (id: number) => void;
|
||||
export const requestIdleCallback: (fn: (deadline: any) => void, options?: any) => number;
|
||||
export const cancelIdleCallback: (id: number) => void;
|
||||
}
|
||||
/**
|
||||
* @param {Date|number} [start] the system time - non-integer values are floored
|
||||
* @param {number} [loopLimit] maximum number of timers that will be run when calling runAll()
|
||||
* @returns {Clock}
|
||||
*/
|
||||
export function createClock(start?: Date | number, loopLimit?: number): Clock;
|
||||
/**
|
||||
* @param {Config=} [config] Optional config
|
||||
* @returns {Clock}
|
||||
*/
|
||||
export function install(config?: Config | undefined, ...args: any[]): Clock;
|
||||
/**
|
||||
* @typedef {object} Clock
|
||||
* @property {number} now
|
||||
* @property {any} timeouts
|
||||
* @property {typeof globalThis.Date} Date
|
||||
* @property {number} loopLimit
|
||||
* @property {(func: Function, timeout: number) => number} requestIdleCallback
|
||||
* @property {(timerId: number) => void} cancelIdleCallback
|
||||
* @property {setTimeout} setTimeout
|
||||
* @property {clearTimeout} clearTimeout
|
||||
* @property {(func: Function, ...args: any[]) => void} nextTick
|
||||
* @property {queueMicrotask} queueMicrotask
|
||||
* @property {setInterval} setInterval
|
||||
* @property {clearInterval} clearInterval
|
||||
* @property {(func: (...args: any[]) => void, ...args: any[]) => NodeTimer} setImmediate
|
||||
* @property {(timerId: NodeTimer) => void} clearImmediate
|
||||
* @property {() => number} countTimers
|
||||
* @property {(func: (timer: number) => void) => number} requestAnimationFrame
|
||||
* @property {(timerId: number) => void} cancelAnimationFrame
|
||||
* @property {() => void} runMicrotasks
|
||||
* @property {(tickValue: string | number) => number} tick
|
||||
* @property {(tickValue: string | number) => Promise<number>} tickAsync
|
||||
* @property {() => number} next
|
||||
* @property {() => Promise<number>} nextAsync
|
||||
* @property {() => number} runAll
|
||||
* @property {() => number} runToFrame
|
||||
* @property {() => Promise<number>} runAllAsync
|
||||
* @property {() => number} runToLast
|
||||
* @property {() => Promise<number>} runToLastAsync
|
||||
* @property {() => void} reset
|
||||
* @property {(systemTime: number | Date) => void} setSystemTime
|
||||
* @property {({now(): number})} performance
|
||||
* @property {(prev: any) => number[]} hrTime
|
||||
* @property {() => void} uninstall Uninstall the clock.
|
||||
* @property {any} methods
|
||||
*/
|
||||
/**
|
||||
* Configuration object for the `install` method.
|
||||
*
|
||||
* @typedef {object} Config
|
||||
* @property {number|Date} [now] a number (in milliseconds) or a Date object (default epoch)
|
||||
* @property {string[]} [toFake] names of the methods that should be faked.
|
||||
* @property {number} [loopLimit] the maximum number of timers that will be run when calling runAll()
|
||||
* @property {boolean} [shouldAdvanceTime] tells FakeTimers to increment mocked time automatically (default false)
|
||||
* @property {number} [advanceTimeDelta] increment mocked time every <<advanceTimeDelta>> ms (default: 20ms)
|
||||
*/
|
||||
/**
|
||||
* @typedef {object} NodeTimer
|
||||
* @property {() => boolean} hasRef
|
||||
* @property {() => any} ref
|
||||
* @property {() => any} unref
|
||||
*/
|
||||
/**
|
||||
* Mocks available features in the specified global namespace.
|
||||
*
|
||||
* @param {*} _global Namespace to mock (e.g. `window`)
|
||||
*/
|
||||
export function withGlobal(_global: any): {
|
||||
timers: {
|
||||
setTimeout: typeof setTimeout;
|
||||
clearTimeout: typeof clearTimeout;
|
||||
setInterval: typeof setInterval;
|
||||
clearInterval: typeof clearInterval;
|
||||
Date: typeof globalThis.Date;
|
||||
setImmediate?: (fn: (...args: any[]) => void, ...args: any[]) => NodeTimer;
|
||||
clearImmediate?: (id: NodeTimer) => void;
|
||||
hrtime?: (time?: [number, number]) => [number, number];
|
||||
nextTick?: (fn: Function, ...args: any[]) => void;
|
||||
performance?: ({
|
||||
now(): number;
|
||||
}) | undefined;
|
||||
requestAnimationFrame?: (fn: (timer: number) => void) => number;
|
||||
queueMicrotask?: boolean | undefined;
|
||||
cancelAnimationFrame?: (id: number) => void;
|
||||
requestIdleCallback?: (fn: (deadline: any) => void, options?: any) => number;
|
||||
cancelIdleCallback?: (id: number) => void;
|
||||
};
|
||||
createClock: (start?: Date | number, loopLimit?: number) => Clock;
|
||||
install: (config?: Config | undefined, ...args: any[]) => Clock;
|
||||
withGlobal: typeof withGlobal;
|
||||
};
|
||||
4
node_modules/@types/sinon/README.md
generated
vendored
4
node_modules/@types/sinon/README.md
generated
vendored
|
|
@ -8,9 +8,9 @@ This package contains type definitions for Sinon (https://sinonjs.org).
|
|||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sinon.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Wed, 02 Jun 2021 06:01:28 GMT
|
||||
* Last updated: Sun, 14 May 2023 04:32:51 GMT
|
||||
* Dependencies: [@types/sinonjs__fake-timers](https://npmjs.com/package/@types/sinonjs__fake-timers)
|
||||
* Global values: `sinon`
|
||||
|
||||
# Credits
|
||||
These definitions were written by [William Sears](https://github.com/mrbigdog2u), [Lukas Spieß](https://github.com/lumaxis), [Nico Jansen](https://github.com/nicojs), [James Garbutt](https://github.com/43081j), [Josh Goldberg](https://github.com/joshuakgoldberg), [Greg Jednaszewski](https://github.com/gjednaszewski), [John Wood](https://github.com/johnjesse), [Alec Flett](https://github.com/alecf), and [Simon Schick](https://github.com/SimonSchick).
|
||||
These definitions were written by [William Sears](https://github.com/mrbigdog2u), [Nico Jansen](https://github.com/nicojs), [James Garbutt](https://github.com/43081j), [Greg Jednaszewski](https://github.com/gjednaszewski), [John Wood](https://github.com/johnjesse), [Alec Flett](https://github.com/alecf), [Simon Schick](https://github.com/SimonSchick), and [Mathias Schreck](https://github.com/lo1tuma).
|
||||
|
|
|
|||
150
node_modules/@types/sinon/index.d.ts
generated
vendored
150
node_modules/@types/sinon/index.d.ts
generated
vendored
|
|
@ -1,17 +1,16 @@
|
|||
// Type definitions for Sinon 10.0
|
||||
// Project: https://sinonjs.org
|
||||
// Definitions by: William Sears <https://github.com/mrbigdog2u>
|
||||
// Lukas Spieß <https://github.com/lumaxis>
|
||||
// Nico Jansen <https://github.com/nicojs>
|
||||
// James Garbutt <https://github.com/43081j>
|
||||
// Josh Goldberg <https://github.com/joshuakgoldberg>
|
||||
// Greg Jednaszewski <https://github.com/gjednaszewski>
|
||||
// John Wood <https://github.com/johnjesse>
|
||||
// Alec Flett <https://github.com/alecf>
|
||||
// Simon Schick <https://github.com/SimonSchick>
|
||||
// Mathias Schreck <https://github.com/lo1tuma>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import * as FakeTimers from "@sinonjs/fake-timers";
|
||||
import * as FakeTimers from '@sinonjs/fake-timers';
|
||||
|
||||
// sinon uses DOM dependencies which are absent in browser-less environment like node.js
|
||||
// to avoid compiler errors this monkey patch is used
|
||||
|
|
@ -20,11 +19,19 @@ interface Event {} // tslint:disable-line no-empty-interface
|
|||
interface Document {} // tslint:disable-line no-empty-interface
|
||||
|
||||
declare namespace Sinon {
|
||||
type MatchArguments<T> = {
|
||||
[K in keyof T]: SinonMatcher | (T[K] extends object ? MatchArguments<T[K]> : never) | T[K];
|
||||
type MatchPartialArguments<T> = {
|
||||
[K in keyof T]?: SinonMatcher | (T[K] extends object ? MatchPartialArguments<T[K]> : T[K]);
|
||||
};
|
||||
// TODO: Alias for backward compatibility, remove on next major release
|
||||
type DeepPartialOrMatcher<T> = MatchPartialArguments<T>;
|
||||
|
||||
interface SinonSpyCallApi<TArgs extends any[] = any[], TReturnValue = any> {
|
||||
type MatchExactArguments<T> = {
|
||||
[K in keyof T]: SinonMatcher | (T[K] extends object ? MatchExactArguments<T[K]> : T[K]);
|
||||
};
|
||||
// TODO: Alias for backward compatibility, remove on next major release
|
||||
type MatchArguments<T> = MatchExactArguments<T>;
|
||||
|
||||
interface SinonSpyCallApi<TArgs extends readonly any[] = any[], TReturnValue = any> {
|
||||
// Properties
|
||||
/**
|
||||
* Array of received arguments.
|
||||
|
|
@ -44,11 +51,11 @@ declare namespace Sinon {
|
|||
* so a call that received the provided arguments (in the same spots) and possibly others as well will return true.
|
||||
* @param args
|
||||
*/
|
||||
calledWith(...args: Partial<MatchArguments<TArgs>>): boolean;
|
||||
calledWith(...args: MatchPartialArguments<TArgs>): boolean;
|
||||
/**
|
||||
* Returns true if spy was called at least once with the provided arguments and no others.
|
||||
*/
|
||||
calledWithExactly(...args: MatchArguments<TArgs>): boolean;
|
||||
calledWithExactly(...args: MatchExactArguments<TArgs>): boolean;
|
||||
/**
|
||||
* Returns true if spy/stub was called the new operator.
|
||||
* Beware that this is inferred based on the value of the this object and the spy function’s prototype,
|
||||
|
|
@ -59,25 +66,25 @@ declare namespace Sinon {
|
|||
* Returns true if spy was called at exactly once with the provided arguments.
|
||||
* @param args
|
||||
*/
|
||||
calledOnceWith(...args: MatchArguments<TArgs>): boolean;
|
||||
calledOnceWithExactly(...args: MatchArguments<TArgs>): boolean;
|
||||
calledOnceWith(...args: MatchPartialArguments<TArgs>): boolean;
|
||||
calledOnceWithExactly(...args: MatchExactArguments<TArgs>): boolean;
|
||||
/**
|
||||
* Returns true if spy was called with matching arguments (and possibly others).
|
||||
* This behaves the same as spy.calledWith(sinon.match(arg1), sinon.match(arg2), ...).
|
||||
* @param args
|
||||
*/
|
||||
calledWithMatch(...args: TArgs): boolean;
|
||||
calledWithMatch(...args: MatchPartialArguments<TArgs>): boolean;
|
||||
/**
|
||||
* Returns true if call did not receive provided arguments.
|
||||
* @param args
|
||||
*/
|
||||
notCalledWith(...args: MatchArguments<TArgs>): boolean;
|
||||
notCalledWith(...args: MatchExactArguments<TArgs>): boolean;
|
||||
/**
|
||||
* Returns true if call did not receive matching arguments.
|
||||
* This behaves the same as spyCall.notCalledWith(sinon.match(arg1), sinon.match(arg2), ...).
|
||||
* @param args
|
||||
*/
|
||||
notCalledWithMatch(...args: TArgs): boolean;
|
||||
notCalledWithMatch(...args: MatchPartialArguments<TArgs>): boolean;
|
||||
/**
|
||||
* Returns true if spy returned the provided value at least once.
|
||||
* Uses deep comparison for objects and arrays. Use spy.returned(sinon.match.same(obj)) for strict comparison (see matchers).
|
||||
|
|
@ -101,30 +108,30 @@ declare namespace Sinon {
|
|||
* Useful if a function is called with more than one callback, and simply calling the first callback is not desired.
|
||||
* @param pos
|
||||
*/
|
||||
callArg(pos: number): void;
|
||||
callArgOn(pos: number, obj: any, ...args: any[]): void;
|
||||
callArg(pos: number): unknown[];
|
||||
callArgOn(pos: number, obj: any, ...args: any[]): unknown[];
|
||||
/**
|
||||
* Like callArg, but with arguments.
|
||||
*/
|
||||
callArgWith(pos: number, ...args: any[]): void;
|
||||
callArgOnWith(pos: number, obj: any, ...args: any[]): void;
|
||||
callArgWith(pos: number, ...args: any[]): unknown[];
|
||||
callArgOnWith(pos: number, obj: any, ...args: any[]): unknown[];
|
||||
/**
|
||||
* Invoke callbacks passed to the stub with the given arguments.
|
||||
* If the stub was never called with a function argument, yield throws an error.
|
||||
* Returns an Array with all callbacks return values in the order they were called, if no error is thrown.
|
||||
* Also aliased as invokeCallback.
|
||||
*/
|
||||
yield(...args: any[]): void;
|
||||
yieldOn(obj: any, ...args: any[]): void;
|
||||
yield(...args: any[]): unknown[];
|
||||
yieldOn(obj: any, ...args: any[]): unknown[];
|
||||
/**
|
||||
* Invokes callbacks passed as a property of an object to the stub.
|
||||
* Like yield, yieldTo grabs the first matching argument, finds the callback and calls it with the (optional) arguments.
|
||||
*/
|
||||
yieldTo(property: string, ...args: any[]): void;
|
||||
yieldToOn(property: string, obj: any, ...args: any[]): void;
|
||||
yieldTo(property: string, ...args: any[]): unknown[];
|
||||
yieldToOn(property: string, obj: any, ...args: any[]): unknown[];
|
||||
}
|
||||
|
||||
interface SinonSpyCall<TArgs extends any[] = any[], TReturnValue = any>
|
||||
interface SinonSpyCall<TArgs extends readonly any[] = any[], TReturnValue = any>
|
||||
extends SinonSpyCallApi<TArgs, TReturnValue> {
|
||||
/**
|
||||
* The call’s this value.
|
||||
|
|
@ -167,10 +174,10 @@ declare namespace Sinon {
|
|||
calledAfter(call: SinonSpyCall<any>): boolean;
|
||||
}
|
||||
|
||||
interface SinonSpy<TArgs extends any[] = any[], TReturnValue = any>
|
||||
interface SinonSpy<TArgs extends readonly any[] = any[], TReturnValue = any>
|
||||
extends Pick<
|
||||
SinonSpyCallApi<TArgs, TReturnValue>,
|
||||
Exclude<keyof SinonSpyCallApi<TArgs, TReturnValue>, "args">
|
||||
Exclude<keyof SinonSpyCallApi<TArgs, TReturnValue>, 'args'>
|
||||
> {
|
||||
// Properties
|
||||
/**
|
||||
|
|
@ -266,7 +273,7 @@ declare namespace Sinon {
|
|||
* This is useful to be more expressive in your assertions, where you can access the spy with the same call.
|
||||
* @param args Expected args
|
||||
*/
|
||||
withArgs(...args: MatchArguments<TArgs>): SinonSpy<TArgs, TReturnValue>;
|
||||
withArgs(...args: MatchPartialArguments<TArgs>): SinonSpy<TArgs, TReturnValue>;
|
||||
/**
|
||||
* Returns true if the spy was always called with @param obj as this.
|
||||
* @param obj
|
||||
|
|
@ -275,12 +282,12 @@ declare namespace Sinon {
|
|||
/**
|
||||
* Returns true if spy was always called with the provided arguments (and possibly others).
|
||||
*/
|
||||
alwaysCalledWith(...args: MatchArguments<TArgs>): boolean;
|
||||
alwaysCalledWith(...args: MatchExactArguments<TArgs>): boolean;
|
||||
/**
|
||||
* Returns true if spy was always called with the exact provided arguments.
|
||||
* @param args
|
||||
*/
|
||||
alwaysCalledWithExactly(...args: MatchArguments<TArgs>): boolean;
|
||||
alwaysCalledWithExactly(...args: MatchExactArguments<TArgs>): boolean;
|
||||
/**
|
||||
* Returns true if spy was always called with matching arguments (and possibly others).
|
||||
* This behaves the same as spy.alwaysCalledWith(sinon.match(arg1), sinon.match(arg2), ...).
|
||||
|
|
@ -291,7 +298,7 @@ declare namespace Sinon {
|
|||
* Returns true if the spy/stub was never called with the provided arguments.
|
||||
* @param args
|
||||
*/
|
||||
neverCalledWith(...args: MatchArguments<TArgs>): boolean;
|
||||
neverCalledWith(...args: MatchExactArguments<TArgs>): boolean;
|
||||
/**
|
||||
* Returns true if the spy/stub was never called with matching arguments.
|
||||
* This behaves the same as spy.neverCalledWith(sinon.match(arg1), sinon.match(arg2), ...).
|
||||
|
|
@ -329,7 +336,7 @@ declare namespace Sinon {
|
|||
/**
|
||||
* Returns the nth call.
|
||||
* Accessing individual calls helps with more detailed behavior verification when the spy is called more than once.
|
||||
* @param n Zero based index of the spy call.
|
||||
* @param n Zero-based index of the spy call.
|
||||
*/
|
||||
getCall(n: number): SinonSpyCall<TArgs, TReturnValue>;
|
||||
/**
|
||||
|
|
@ -383,7 +390,7 @@ declare namespace Sinon {
|
|||
? SinonSpy<TArgs, TReturnValue>
|
||||
: SinonSpy;
|
||||
|
||||
<T, K extends keyof T>(obj: T, method: K, types: Array<"get" | "set">): PropertyDescriptor & {
|
||||
<T, K extends keyof T>(obj: T, method: K, types: Array<'get' | 'set'>): PropertyDescriptor & {
|
||||
get: SinonSpy<[], T[K]>;
|
||||
set: SinonSpy<[T[K]], void>;
|
||||
};
|
||||
|
|
@ -397,7 +404,8 @@ declare namespace Sinon {
|
|||
? SinonSpy<TArgs, TReturnValue>
|
||||
: T;
|
||||
|
||||
interface SinonStub<TArgs extends any[] = any[], TReturnValue = any> extends SinonSpy<TArgs, TReturnValue> {
|
||||
interface SinonStub<TArgs extends readonly any[] = any[], TReturnValue = any>
|
||||
extends SinonSpy<TArgs, TReturnValue> {
|
||||
/**
|
||||
* Resets the stub’s behaviour to the default behaviour
|
||||
* You can reset behaviour of all stubs using sinon.resetBehavior()
|
||||
|
|
@ -566,7 +574,7 @@ declare namespace Sinon {
|
|||
* Defines the behavior of the stub on the @param n call. Useful for testing sequential interactions.
|
||||
* There are methods onFirstCall, onSecondCall,onThirdCall to make stub definitions read more naturally.
|
||||
* onCall can be combined with all of the behavior defining methods in this section. In particular, it can be used together with withArgs.
|
||||
* @param n
|
||||
* @param n Zero-based index of the spy call.
|
||||
*/
|
||||
onCall(n: number): SinonStub<TArgs, TReturnValue>;
|
||||
/**
|
||||
|
|
@ -651,7 +659,7 @@ declare namespace Sinon {
|
|||
* It is also useful to create a stub that can act differently in response to different arguments.
|
||||
* @param args
|
||||
*/
|
||||
withArgs(...args: MatchArguments<TArgs>): SinonStub<TArgs, TReturnValue>;
|
||||
withArgs(...args: MatchPartialArguments<TArgs>): SinonStub<TArgs, TReturnValue>;
|
||||
}
|
||||
|
||||
interface SinonStubStatic {
|
||||
|
|
@ -660,7 +668,7 @@ declare namespace Sinon {
|
|||
/**
|
||||
* Creates an anonymous stub function
|
||||
*/
|
||||
<TArgs extends any[] = any[], R = any>(): SinonStub<TArgs, R>;
|
||||
<TArgs extends readonly any[] = any[], R = any>(): SinonStub<TArgs, R>;
|
||||
|
||||
/* tslint:enable:no-unnecessary-generics */
|
||||
|
||||
|
|
@ -783,12 +791,6 @@ declare namespace Sinon {
|
|||
restore(): void;
|
||||
};
|
||||
|
||||
interface SinonFakeTimersConfig {
|
||||
now: number | Date;
|
||||
toFake: string[];
|
||||
shouldAdvanceTime: boolean;
|
||||
}
|
||||
|
||||
interface SinonFakeUploadProgress {
|
||||
eventListeners: {
|
||||
progress: any[];
|
||||
|
|
@ -1117,20 +1119,20 @@ declare namespace Sinon {
|
|||
*/
|
||||
calledWith<TArgs extends any[]>(
|
||||
spyOrSpyCall: SinonSpy<TArgs> | SinonSpyCall<TArgs>,
|
||||
...args: Partial<MatchArguments<TArgs>>
|
||||
...args: MatchPartialArguments<TArgs>
|
||||
): void;
|
||||
/**
|
||||
* Passes if spy was always called with the provided arguments.
|
||||
* @param spy
|
||||
* @param args
|
||||
*/
|
||||
alwaysCalledWith<TArgs extends any[]>(spy: SinonSpy<TArgs>, ...args: Partial<MatchArguments<TArgs>>): void;
|
||||
alwaysCalledWith<TArgs extends any[]>(spy: SinonSpy<TArgs>, ...args: MatchPartialArguments<TArgs>): void;
|
||||
/**
|
||||
* Passes if spy was never called with the provided arguments.
|
||||
* @param spy
|
||||
* @param args
|
||||
*/
|
||||
neverCalledWith<TArgs extends any[]>(spy: SinonSpy<TArgs>, ...args: Partial<MatchArguments<TArgs>>): void;
|
||||
neverCalledWith<TArgs extends any[]>(spy: SinonSpy<TArgs>, ...args: MatchPartialArguments<TArgs>): void;
|
||||
/**
|
||||
* Passes if spy was called with the provided arguments and no others.
|
||||
* It’s possible to assert on a dedicated spy call: sinon.assert.calledWithExactly(spy.getCall(1), arg1, arg2, ...);.
|
||||
|
|
@ -1139,7 +1141,7 @@ declare namespace Sinon {
|
|||
*/
|
||||
calledWithExactly<TArgs extends any[]>(
|
||||
spyOrSpyCall: SinonSpy<TArgs> | SinonSpyCall<TArgs>,
|
||||
...args: MatchArguments<TArgs>
|
||||
...args: MatchExactArguments<TArgs>
|
||||
): void;
|
||||
/**
|
||||
* Passes if spy was called at exactly once with the provided arguments and no others.
|
||||
|
|
@ -1148,18 +1150,21 @@ declare namespace Sinon {
|
|||
*/
|
||||
calledOnceWithExactly<TArgs extends any[]>(
|
||||
spyOrSpyCall: SinonSpy<TArgs> | SinonSpyCall<TArgs>,
|
||||
...args: MatchArguments<TArgs>
|
||||
...args: MatchExactArguments<TArgs>
|
||||
): void;
|
||||
/**
|
||||
* Passes if spy was always called with the provided arguments and no others.
|
||||
*/
|
||||
alwaysCalledWithExactly<TArgs extends any[]>(spy: SinonSpy<TArgs>, ...args: MatchArguments<TArgs>): void;
|
||||
alwaysCalledWithExactly<TArgs extends any[]>(spy: SinonSpy<TArgs>, ...args: MatchExactArguments<TArgs>): void;
|
||||
/**
|
||||
* Passes if spy was called with matching arguments.
|
||||
* This behaves the same way as sinon.assert.calledWith(spy, sinon.match(arg1), sinon.match(arg2), ...).
|
||||
* It's possible to assert on a dedicated spy call: sinon.assert.calledWithMatch(spy.secondCall, arg1, arg2, ...);.
|
||||
*/
|
||||
calledWithMatch<TArgs extends any[]>(spyOrSpyCall: SinonSpy<TArgs> | SinonSpyCall<TArgs>, ...args: TArgs): void;
|
||||
calledWithMatch<TArgs extends any[]>(
|
||||
spyOrSpyCall: SinonSpy<TArgs> | SinonSpyCall<TArgs>,
|
||||
...args: MatchPartialArguments<TArgs>
|
||||
): void;
|
||||
/**
|
||||
* Passes if spy was called once with matching arguments.
|
||||
* This behaves the same way as calling both sinon.assert.calledOnce(spy) and
|
||||
|
|
@ -1173,14 +1178,14 @@ declare namespace Sinon {
|
|||
* Passes if spy was always called with matching arguments.
|
||||
* This behaves the same way as sinon.assert.alwaysCalledWith(spy, sinon.match(arg1), sinon.match(arg2), ...).
|
||||
*/
|
||||
alwaysCalledWithMatch<TArgs extends any[]>(spy: SinonSpy<TArgs>, ...args: TArgs): void;
|
||||
alwaysCalledWithMatch<TArgs extends any[]>(spy: SinonSpy<TArgs>, ...args: MatchPartialArguments<TArgs>): void;
|
||||
/**
|
||||
* Passes if spy was never called with matching arguments.
|
||||
* This behaves the same way as sinon.assert.neverCalledWith(spy, sinon.match(arg1), sinon.match(arg2), ...).
|
||||
* @param spy
|
||||
* @param args
|
||||
*/
|
||||
neverCalledWithMatch<TArgs extends any[]>(spy: SinonSpy<TArgs>, ...args: TArgs): void;
|
||||
neverCalledWithMatch<TArgs extends any[]>(spy: SinonSpy<TArgs>, ...args: MatchPartialArguments<TArgs>): void;
|
||||
/**
|
||||
* Passes if spy was called with the new operator.
|
||||
* It’s possible to assert on a dedicated spy call: sinon.assert.calledWithNew(spy.secondCall, arg1, arg2, ...);.
|
||||
|
|
@ -1444,7 +1449,7 @@ declare namespace Sinon {
|
|||
* If set to true, the sandbox will have a clock property.
|
||||
* You can optionally pass in a configuration object that follows the specification for fake timers, such as { toFake: ["setTimeout", "setInterval"] }.
|
||||
*/
|
||||
useFakeTimers: boolean | Partial<SinonFakeTimersConfig>;
|
||||
useFakeTimers: boolean | Partial<FakeTimers.FakeTimerInstallOpts>;
|
||||
/**
|
||||
* If true, server and requests properties are added to the sandbox. Can also be an object to use for fake server.
|
||||
* The default one is sinon.fakeServer, but if you’re using jQuery 1.3.x or some other library that does not set the XHR’s onreadystatechange handler,
|
||||
|
|
@ -1465,7 +1470,7 @@ declare namespace Sinon {
|
|||
*
|
||||
* @template TType Object type being stubbed.
|
||||
*/
|
||||
type SinonStubbedInstance<TType> = {
|
||||
type SinonStubbedInstance<TType> = TType & {
|
||||
[P in keyof TType]: SinonStubbedMember<TType[P]>;
|
||||
};
|
||||
|
||||
|
|
@ -1480,43 +1485,54 @@ declare namespace Sinon {
|
|||
/**
|
||||
* Creates a basic fake, with no behavior
|
||||
*/
|
||||
(): SinonSpy;
|
||||
<TArgs extends readonly any[] = any[], TReturnValue = any>(): SinonSpy<TArgs, TReturnValue>;
|
||||
/**
|
||||
* Wraps an existing Function to record all interactions, while leaving it up to the func to provide the behavior.
|
||||
* This is useful when complex behavior not covered by the sinon.fake.* methods is required or when wrapping an existing function or method.
|
||||
*/
|
||||
(fn: Function): SinonSpy;
|
||||
<TArgs extends readonly any[] = any[], TReturnValue = any>(fn: (...args: TArgs) => TReturnValue): SinonSpy<
|
||||
TArgs,
|
||||
TReturnValue
|
||||
>;
|
||||
/**
|
||||
* Creates a fake that returns the val argument
|
||||
* @param val Returned value
|
||||
*/
|
||||
returns(val: any): SinonSpy;
|
||||
returns<TArgs extends readonly any[] = any[], TReturnValue = any>(
|
||||
val: TReturnValue,
|
||||
): SinonSpy<TArgs, TReturnValue>;
|
||||
/**
|
||||
* Creates a fake that throws an Error with the provided value as the message property.
|
||||
* If an Error is passed as the val argument, then that will be the thrown value. If any other value is passed, then that will be used for the message property of the thrown Error.
|
||||
* @param val Returned value or throw value if an Error
|
||||
*/
|
||||
throws(val: Error | string): SinonSpy;
|
||||
throws<TArgs extends readonly any[] = any[], TReturnValue = any>(
|
||||
val: Error | string,
|
||||
): SinonSpy<TArgs, TReturnValue>;
|
||||
/**
|
||||
* Creates a fake that returns a resolved Promise for the passed value.
|
||||
* @param val Resolved promise
|
||||
*/
|
||||
resolves(val: any): SinonSpy;
|
||||
resolves<TArgs extends readonly any[] = any[], TReturnValue = any>(
|
||||
val: TReturnValue extends PromiseLike<infer TResolveValue> ? TResolveValue : any,
|
||||
): SinonSpy<TArgs, TReturnValue>;
|
||||
/**
|
||||
* Creates a fake that returns a rejected Promise for the passed value.
|
||||
* If an Error is passed as the value argument, then that will be the value of the promise.
|
||||
* If any other value is passed, then that will be used for the message property of the Error returned by the promise.
|
||||
* @param val Rejected promise
|
||||
*/
|
||||
rejects(val: any): SinonSpy;
|
||||
rejects<TArgs extends readonly any[] = any[], TReturnValue = any>(val: any): SinonSpy<TArgs, TReturnValue>;
|
||||
/**
|
||||
* fake expects the last argument to be a callback and will invoke it with the given arguments.
|
||||
*/
|
||||
yields(...args: any[]): SinonSpy;
|
||||
yields<TArgs extends readonly any[] = any[], TReturnValue = any>(...args: any[]): SinonSpy<TArgs, TReturnValue>;
|
||||
/**
|
||||
* fake expects the last argument to be a callback and will invoke it asynchronously with the given arguments.
|
||||
*/
|
||||
yieldsAsync(...args: any[]): SinonSpy;
|
||||
yieldsAsync<TArgs extends readonly any[] = any[], TReturnValue = any>(
|
||||
...args: any[]
|
||||
): SinonSpy<TArgs, TReturnValue>;
|
||||
}
|
||||
|
||||
interface SinonSandbox {
|
||||
|
|
@ -1561,7 +1577,7 @@ declare namespace Sinon {
|
|||
* You would have to call either clock.next(), clock.tick(), clock.runAll() or clock.runToLast() (see example below). Please refer to the lolex documentation for more information.
|
||||
* @param config
|
||||
*/
|
||||
useFakeTimers(config?: number | Date | Partial<SinonFakeTimersConfig>): SinonFakeTimers;
|
||||
useFakeTimers(config?: number | Date | Partial<FakeTimers.FakeTimerInstallOpts>): SinonFakeTimers;
|
||||
/**
|
||||
* Causes Sinon to replace the native XMLHttpRequest object in browsers that support it with a custom implementation which does not send actual requests.
|
||||
* In browsers that support ActiveXObject, this constructor is replaced, and fake objects are returned for XMLHTTP progIds.
|
||||
|
|
@ -1612,7 +1628,7 @@ declare namespace Sinon {
|
|||
* replacement can be any value, including spies, stubs and fakes.
|
||||
* This method only works on non-accessor properties, for replacing accessors, use sandbox.replaceGetter() and sandbox.replaceSetter().
|
||||
*/
|
||||
replace<T, TKey extends keyof T>(obj: T, prop: TKey, replacement: T[TKey]): T[TKey];
|
||||
replace<T, TKey extends keyof T, R extends T[TKey] = T[TKey]>(obj: T, prop: TKey, replacement: R): R;
|
||||
/**
|
||||
* Replaces getter for property on object with replacement argument. Attempts to replace an already replaced getter cause an exception.
|
||||
* replacement must be a Function, and can be instances of spies, stubs and fakes.
|
||||
|
|
@ -1653,6 +1669,14 @@ declare namespace Sinon {
|
|||
): SinonStubbedInstance<TType>;
|
||||
}
|
||||
|
||||
type SinonPromise<T> = Promise<T> & {
|
||||
status: 'pending' | 'resolved' | 'rejected';
|
||||
resolve(val: unknown): Promise<T>;
|
||||
reject(reason: unknown): Promise<void>;
|
||||
resolvedValue?: T;
|
||||
rejectedValue?: unknown;
|
||||
};
|
||||
|
||||
interface SinonApi {
|
||||
expectation: SinonExpectationStatic;
|
||||
|
||||
|
|
@ -1687,6 +1711,10 @@ declare namespace Sinon {
|
|||
* on a format of your choosing, such as "{ id: 42 }"
|
||||
*/
|
||||
setFormatter: (customFormatter: (...args: any[]) => string) => void;
|
||||
|
||||
promise<T = unknown>(
|
||||
executor?: (resolve: (value: T) => void, reject: (reason?: unknown) => void) => void,
|
||||
): SinonPromise<T>;
|
||||
}
|
||||
|
||||
type SinonStatic = SinonSandbox & SinonApi;
|
||||
|
|
|
|||
23
node_modules/@types/sinon/package.json
generated
vendored
23
node_modules/@types/sinon/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@types/sinon",
|
||||
"version": "10.0.2",
|
||||
"version": "10.0.15",
|
||||
"description": "TypeScript definitions for Sinon",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sinon",
|
||||
"license": "MIT",
|
||||
|
|
@ -10,11 +10,6 @@
|
|||
"url": "https://github.com/mrbigdog2u",
|
||||
"githubUsername": "mrbigdog2u"
|
||||
},
|
||||
{
|
||||
"name": "Lukas Spieß",
|
||||
"url": "https://github.com/lumaxis",
|
||||
"githubUsername": "lumaxis"
|
||||
},
|
||||
{
|
||||
"name": "Nico Jansen",
|
||||
"url": "https://github.com/nicojs",
|
||||
|
|
@ -25,11 +20,6 @@
|
|||
"url": "https://github.com/43081j",
|
||||
"githubUsername": "43081j"
|
||||
},
|
||||
{
|
||||
"name": "Josh Goldberg",
|
||||
"url": "https://github.com/joshuakgoldberg",
|
||||
"githubUsername": "joshuakgoldberg"
|
||||
},
|
||||
{
|
||||
"name": "Greg Jednaszewski",
|
||||
"url": "https://github.com/gjednaszewski",
|
||||
|
|
@ -49,6 +39,11 @@
|
|||
"name": "Simon Schick",
|
||||
"url": "https://github.com/SimonSchick",
|
||||
"githubUsername": "SimonSchick"
|
||||
},
|
||||
{
|
||||
"name": "Mathias Schreck",
|
||||
"url": "https://github.com/lo1tuma",
|
||||
"githubUsername": "lo1tuma"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
|
|
@ -60,8 +55,8 @@
|
|||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@sinonjs/fake-timers": "^7.1.0"
|
||||
"@types/sinonjs__fake-timers": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "d9f02a4574f6f32057808563b4551e558075d0c93c5739b604521c743c4bb712",
|
||||
"typeScriptVersion": "3.6"
|
||||
"typesPublisherContentHash": "c87e5ef382887bbdb8c25d070fd87c515977fd4e28b3d8cf4293c673f5e33f2e",
|
||||
"typeScriptVersion": "4.3"
|
||||
}
|
||||
21
node_modules/@types/sinonjs__fake-timers/LICENSE
generated
vendored
Executable file
21
node_modules/@types/sinonjs__fake-timers/LICENSE
generated
vendored
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
16
node_modules/@types/sinonjs__fake-timers/README.md
generated
vendored
Executable file
16
node_modules/@types/sinonjs__fake-timers/README.md
generated
vendored
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
# Installation
|
||||
> `npm install --save @types/sinonjs__fake-timers`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for @sinonjs/fake-timers (https://github.com/sinonjs/fake-timers).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sinonjs__fake-timers.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Wed, 23 Mar 2022 18:01:46 GMT
|
||||
* Dependencies: none
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Wim Looman](https://github.com/Nemo157), [Rogier Schouten](https://github.com/rogierschouten), [Yishai Zehavi](https://github.com/zyishai), [Remco Haszing](https://github.com/remcohaszing), and [Jaden Simon](https://github.com/JadenSimon).
|
||||
392
node_modules/@types/sinonjs__fake-timers/index.d.ts
generated
vendored
Executable file
392
node_modules/@types/sinonjs__fake-timers/index.d.ts
generated
vendored
Executable file
|
|
@ -0,0 +1,392 @@
|
|||
// Type definitions for @sinonjs/fake-timers 8.1
|
||||
// Project: https://github.com/sinonjs/fake-timers
|
||||
// Definitions by: Wim Looman <https://github.com/Nemo157>
|
||||
// Rogier Schouten <https://github.com/rogierschouten>
|
||||
// Yishai Zehavi <https://github.com/zyishai>
|
||||
// Remco Haszing <https://github.com/remcohaszing>
|
||||
// Jaden Simon <https://github.com/JadenSimon>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/**
|
||||
* Names of clock methods that may be faked by install.
|
||||
*/
|
||||
export type FakeMethod =
|
||||
| 'setTimeout'
|
||||
| 'clearTimeout'
|
||||
| 'setImmediate'
|
||||
| 'clearImmediate'
|
||||
| 'setInterval'
|
||||
| 'clearInterval'
|
||||
| 'Date'
|
||||
| 'nextTick'
|
||||
| 'hrtime'
|
||||
| 'requestAnimationFrame'
|
||||
| 'cancelAnimationFrame'
|
||||
| 'requestIdleCallback'
|
||||
| 'cancelIdleCallback'
|
||||
| 'performance'
|
||||
| 'queueMicrotask';
|
||||
|
||||
/**
|
||||
* Global methods available to every clock and also as standalone methods (inside `timers` global object).
|
||||
*/
|
||||
export interface GlobalTimers<TTimerId extends TimerId> {
|
||||
/**
|
||||
* Schedules a callback to be fired once timeout milliseconds have ticked by.
|
||||
*
|
||||
* @param callback Callback to be fired.
|
||||
* @param timeout How many ticks to wait to run the callback.
|
||||
* @param args Any extra arguments to pass to the callback.
|
||||
* @returns Time identifier for cancellation.
|
||||
*/
|
||||
setTimeout: (callback: (...args: any[]) => void, timeout: number, ...args: any[]) => TTimerId;
|
||||
|
||||
/**
|
||||
* Clears a timer, as long as it was created using setTimeout.
|
||||
*
|
||||
* @param id Timer ID or object.
|
||||
*/
|
||||
clearTimeout: (id: TTimerId) => void;
|
||||
|
||||
/**
|
||||
* Schedules a callback to be fired every time timeout milliseconds have ticked by.
|
||||
*
|
||||
* @param callback Callback to be fired.
|
||||
* @param timeout How many ticks to wait between callbacks.
|
||||
* @param args Any extra arguments to pass to the callback.
|
||||
* @returns Time identifier for cancellation.
|
||||
*/
|
||||
setInterval: (callback: (...args: any[]) => void, timeout: number, ...args: any[]) => TTimerId;
|
||||
|
||||
/**
|
||||
* Clears a timer, as long as it was created using setInterval.
|
||||
*
|
||||
* @param id Timer ID or object.
|
||||
*/
|
||||
clearInterval: (id: TTimerId) => void;
|
||||
|
||||
/**
|
||||
* Schedules the callback to be fired once 0 milliseconds have ticked by.
|
||||
*
|
||||
* @param callback Callback to be fired.
|
||||
* @param args Any extra arguments to pass to the callback.
|
||||
* @remarks You'll still have to call clock.tick() for the callback to fire.
|
||||
* @remarks If called during a tick the callback won't fire until 1 millisecond has ticked by.
|
||||
*/
|
||||
setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => TTimerId;
|
||||
|
||||
/**
|
||||
* Clears a timer, as long as it was created using setImmediate.
|
||||
*
|
||||
* @param id Timer ID or object.
|
||||
*/
|
||||
clearImmediate: (id: TTimerId) => void;
|
||||
|
||||
/**
|
||||
* Implements the Date object but using this clock to provide the correct time.
|
||||
*/
|
||||
Date: typeof Date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Timer object used in node.
|
||||
*/
|
||||
export interface NodeTimer {
|
||||
/**
|
||||
* Stub method call. Does nothing.
|
||||
*/
|
||||
ref(): NodeTimer;
|
||||
|
||||
/**
|
||||
* Stub method call. Does nothing.
|
||||
*/
|
||||
unref(): NodeTimer;
|
||||
|
||||
/**
|
||||
* Refreshes the timer.
|
||||
*/
|
||||
refresh(): NodeTimer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Timer identifier for clock scheduling.
|
||||
*/
|
||||
export type TimerId = number | NodeTimer;
|
||||
|
||||
/**
|
||||
* Controls the flow of time.
|
||||
*/
|
||||
export interface FakeClock<TTimerId extends TimerId> extends GlobalTimers<TTimerId> {
|
||||
/**
|
||||
* Current clock time.
|
||||
*/
|
||||
now: number;
|
||||
|
||||
/**
|
||||
* Mimics performance.now().
|
||||
*/
|
||||
performance: {
|
||||
now: () => number;
|
||||
};
|
||||
|
||||
/**
|
||||
* Don't know what this prop is for, but it was included in the clocks that `createClock` or
|
||||
* `install` return (it is never used in the code, for now).
|
||||
*/
|
||||
timeouts: {};
|
||||
|
||||
/**
|
||||
* Maximum number of timers that will be run when calling runAll().
|
||||
*/
|
||||
loopLimit: number;
|
||||
|
||||
/**
|
||||
* Schedule callback to run in the next animation frame.
|
||||
*
|
||||
* @param callback Callback to be fired.
|
||||
* @returns Request id.
|
||||
*/
|
||||
requestAnimationFrame: (callback: (time: number) => void) => TTimerId;
|
||||
|
||||
/**
|
||||
* Cancel animation frame request.
|
||||
*
|
||||
* @param id The id returned from requestAnimationFrame method.
|
||||
*/
|
||||
cancelAnimationFrame: (id: TTimerId) => void;
|
||||
|
||||
/**
|
||||
* Queues the callback to be fired during idle periods to perform background and low priority work on the main event loop.
|
||||
*
|
||||
* @param callback Callback to be fired.
|
||||
* @param timeout The maximum number of ticks before the callback must be fired.
|
||||
* @remarks Callbacks which have a timeout option will be fired no later than time in milliseconds.
|
||||
*/
|
||||
requestIdleCallback: (callback: () => void, timeout?: number) => TTimerId;
|
||||
|
||||
/**
|
||||
* Clears a timer, as long as it was created using requestIdleCallback.
|
||||
*
|
||||
* @param id Timer ID or object.
|
||||
*/
|
||||
cancelIdleCallback: (id: TTimerId) => void;
|
||||
|
||||
/**
|
||||
* Get the number of waiting timers.
|
||||
*
|
||||
* @returns number of waiting timers.
|
||||
*/
|
||||
countTimers: () => number;
|
||||
|
||||
/**
|
||||
* Advances the clock to the the moment of the first scheduled timer, firing it.
|
||||
* @returns Fake milliseconds since the unix epoch.
|
||||
*/
|
||||
next: () => number;
|
||||
|
||||
/**
|
||||
* Advances the clock to the the moment of the first scheduled timer, firing it.
|
||||
*
|
||||
* Also breaks the event loop, allowing any scheduled promise callbacks to execute _before_ running the timers.
|
||||
* @returns Fake milliseconds since the unix epoch.
|
||||
*/
|
||||
nextAsync: () => Promise<number>;
|
||||
|
||||
/**
|
||||
* Advance the clock, firing callbacks if necessary.
|
||||
*
|
||||
* @param time How many ticks to advance by.
|
||||
* @returns Fake milliseconds since the unix epoch.
|
||||
*/
|
||||
tick: (time: number | string) => number;
|
||||
|
||||
/**
|
||||
* Advance the clock, firing callbacks if necessary.
|
||||
*
|
||||
* Also breaks the event loop, allowing any scheduled promise callbacks to execute _before_ running the timers.
|
||||
*
|
||||
* @param time How many ticks to advance by.
|
||||
* @returns Fake milliseconds since the unix epoch.
|
||||
*/
|
||||
tickAsync: (time: number | string) => Promise<number>;
|
||||
|
||||
/**
|
||||
* Removes all timers and tick without firing them and restore now to its original value.
|
||||
*/
|
||||
reset: () => void;
|
||||
|
||||
/**
|
||||
* Runs all pending timers until there are none remaining.
|
||||
*
|
||||
* @remarks If new timers are added while it is executing they will be run as well.
|
||||
* @returns Fake milliseconds since the unix epoch.
|
||||
*/
|
||||
runAll: () => number;
|
||||
|
||||
/**
|
||||
* Runs all pending timers until there are none remaining.
|
||||
*
|
||||
* Also breaks the event loop, allowing any scheduled promise callbacks to execute _before_ running the timers.
|
||||
*
|
||||
* @remarks If new timers are added while it is executing they will be run as well.
|
||||
* @returns Fake milliseconds since the unix epoch.
|
||||
*/
|
||||
runAllAsync: () => Promise<number>;
|
||||
|
||||
/**
|
||||
* Advanced the clock to the next animation frame while firing all scheduled callbacks.
|
||||
* @returns Fake milliseconds since the unix epoch.
|
||||
*/
|
||||
runToFrame: () => number;
|
||||
|
||||
/**
|
||||
* Takes note of the last scheduled timer when it is run, and advances the clock to
|
||||
* that time firing callbacks as necessary.
|
||||
* @returns Fake milliseconds since the unix epoch.
|
||||
*/
|
||||
runToLast: () => number;
|
||||
|
||||
/**
|
||||
* Takes note of the last scheduled timer when it is run, and advances the clock to
|
||||
* that time firing callbacks as necessary.
|
||||
*
|
||||
* Also breaks the event loop, allowing any scheduled promise callbacks to execute _before_ running the timers.
|
||||
* @returns Fake milliseconds since the unix epoch.
|
||||
*/
|
||||
runToLastAsync: () => Promise<number>;
|
||||
|
||||
/**
|
||||
* Simulates a user changing the system clock.
|
||||
*
|
||||
* @param now New system time.
|
||||
* @remarks This affects the current time but it does not in itself cause timers to fire.
|
||||
*/
|
||||
setSystemTime: (now?: number | Date) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake clock for a browser environment.
|
||||
*/
|
||||
export type BrowserClock = FakeClock<number>;
|
||||
|
||||
/**
|
||||
* Fake clock for a Node environment.
|
||||
*/
|
||||
export type NodeClock = FakeClock<NodeTimer> & {
|
||||
/**
|
||||
* Mimics process.hrtime().
|
||||
*
|
||||
* @param prevTime Previous system time to calculate time elapsed.
|
||||
* @returns High resolution real time as [seconds, nanoseconds].
|
||||
*/
|
||||
hrtime(prevTime?: [number, number]): [number, number];
|
||||
|
||||
/**
|
||||
* Mimics process.nextTick() explicitly dropping additional arguments.
|
||||
*/
|
||||
queueMicrotask: (callback: () => void) => void;
|
||||
|
||||
/**
|
||||
* Simulates process.nextTick().
|
||||
*/
|
||||
nextTick: (callback: (...args: any[]) => void, ...args: any[]) => void;
|
||||
|
||||
/**
|
||||
* Run all pending microtasks scheduled with nextTick.
|
||||
*/
|
||||
runMicrotasks: () => void;
|
||||
};
|
||||
|
||||
/**
|
||||
* Clock object created by @sinonjs/fake-timers.
|
||||
*/
|
||||
export type Clock = BrowserClock | NodeClock;
|
||||
|
||||
/**
|
||||
* Additional methods that installed clock have.
|
||||
*/
|
||||
export interface InstalledMethods {
|
||||
/**
|
||||
* Restores the original methods on the context that was passed to FakeTimers.install,
|
||||
* or the native timers if no context was given.
|
||||
*/
|
||||
uninstall: () => void;
|
||||
|
||||
methods: FakeMethod[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Clock object created by calling `install();`.
|
||||
*/
|
||||
export type InstalledClock = Clock & InstalledMethods;
|
||||
|
||||
/**
|
||||
* Creates a clock.
|
||||
*
|
||||
* @param now Current time for the clock.
|
||||
* @param loopLimit Maximum number of timers that will be run when calling runAll()
|
||||
* before assuming that we have an infinite loop and throwing an error
|
||||
* (by default, 1000).
|
||||
* @remarks The default epoch is 0.
|
||||
*/
|
||||
export function createClock(now?: number | Date, loopLimit?: number): Clock;
|
||||
|
||||
export interface FakeTimerInstallOpts {
|
||||
/**
|
||||
* Installs fake timers with the specified unix epoch (default: 0)
|
||||
*/
|
||||
now?: number | Date | undefined;
|
||||
|
||||
/**
|
||||
* An array with names of global methods and APIs to fake. By default, `@sinonjs/fake-timers` does not replace `nextTick()` and `queueMicrotask()`.
|
||||
* For instance, `FakeTimers.install({ toFake: ['setTimeout', 'nextTick'] })` will fake only `setTimeout()` and `nextTick()`
|
||||
*/
|
||||
toFake?: FakeMethod[] | undefined;
|
||||
|
||||
/**
|
||||
* The maximum number of timers that will be run when calling runAll() (default: 1000)
|
||||
*/
|
||||
loopLimit?: number | undefined;
|
||||
|
||||
/**
|
||||
* Tells @sinonjs/fake-timers to increment mocked time automatically based on the real system time shift (e.g. the mocked time will be incremented by
|
||||
* 20ms for every 20ms change in the real system time) (default: false)
|
||||
*/
|
||||
shouldAdvanceTime?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Relevant only when using with shouldAdvanceTime: true. increment mocked time by advanceTimeDelta ms every advanceTimeDelta ms change
|
||||
* in the real system time (default: 20)
|
||||
*/
|
||||
advanceTimeDelta?: number | undefined;
|
||||
|
||||
/**
|
||||
* Tells FakeTimers to clear 'native' (i.e. not fake) timers by delegating to their respective handlers. These are not cleared by
|
||||
* default, leading to potentially unexpected behavior if timers existed prior to installing FakeTimers. (default: false)
|
||||
*/
|
||||
shouldClearNativeTimers?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a clock and installs it globally.
|
||||
*
|
||||
* @param [opts] Options for the fake timer.
|
||||
*/
|
||||
export function install(opts?: FakeTimerInstallOpts): InstalledClock;
|
||||
|
||||
export interface FakeTimerWithContext {
|
||||
timers: GlobalTimers<TimerId>;
|
||||
createClock: (now?: number | Date, loopLimit?: number) => Clock;
|
||||
install: (opts?: FakeTimerInstallOpts) => InstalledClock;
|
||||
withGlobal: (global: object) => FakeTimerWithContext;
|
||||
}
|
||||
|
||||
/**
|
||||
* Apply new context to fake timers.
|
||||
*
|
||||
* @param global New context to apply like `window` (in browsers) or `global` (in node).
|
||||
*/
|
||||
export function withGlobal(global: object): FakeTimerWithContext;
|
||||
|
||||
export const timers: GlobalTimers<TimerId>;
|
||||
45
node_modules/@types/sinonjs__fake-timers/package.json
generated
vendored
Executable file
45
node_modules/@types/sinonjs__fake-timers/package.json
generated
vendored
Executable file
|
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
"name": "@types/sinonjs__fake-timers",
|
||||
"version": "8.1.2",
|
||||
"description": "TypeScript definitions for @sinonjs/fake-timers",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/sinonjs__fake-timers",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Wim Looman",
|
||||
"url": "https://github.com/Nemo157",
|
||||
"githubUsername": "Nemo157"
|
||||
},
|
||||
{
|
||||
"name": "Rogier Schouten",
|
||||
"url": "https://github.com/rogierschouten",
|
||||
"githubUsername": "rogierschouten"
|
||||
},
|
||||
{
|
||||
"name": "Yishai Zehavi",
|
||||
"url": "https://github.com/zyishai",
|
||||
"githubUsername": "zyishai"
|
||||
},
|
||||
{
|
||||
"name": "Remco Haszing",
|
||||
"url": "https://github.com/remcohaszing",
|
||||
"githubUsername": "remcohaszing"
|
||||
},
|
||||
{
|
||||
"name": "Jaden Simon",
|
||||
"url": "https://github.com/JadenSimon",
|
||||
"githubUsername": "JadenSimon"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/sinonjs__fake-timers"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "452fe64e05b9936a8b0868109cdd45c3e241020b1658d8cf534cb04b6cae7c4e",
|
||||
"typeScriptVersion": "3.9"
|
||||
}
|
||||
4
node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-dangle.js
generated
vendored
4
node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-dangle.js
generated
vendored
|
|
@ -107,7 +107,9 @@ exports.default = util.createRule({
|
|||
'always-multiline': forceCommaIfMultiline,
|
||||
'only-multiline': allowCommaIfMultiline,
|
||||
never: forbidComma,
|
||||
ignore: undefined,
|
||||
// https://github.com/typescript-eslint/typescript-eslint/issues/7220
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/no-empty-function
|
||||
ignore: () => { },
|
||||
};
|
||||
function last(nodes) {
|
||||
return nodes[nodes.length - 1] ?? null;
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-dangle.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/comma-dangle.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"comma-dangle.js","sourceRoot":"","sources":["../../src/rules/comma-dangle.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,oDAA0D;AAE1D,8CAAgC;AAChC,iEAA8D;AAE9D,MAAM,QAAQ,GAAG,IAAA,qCAAiB,EAAC,cAAc,CAAC,CAAC;AAUnD,MAAM,mBAAmB,GAAG;IAC1B,kBAAkB;IAClB,QAAQ;IACR,OAAO;IACP,gBAAgB;CACjB,CAAC;AAEF,MAAM,oBAAoB,GAAG,OAAO,CAAC;AAErC,SAAS,gBAAgB,CAAC,OAAe;IACvC,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,OAAO;YACL,KAAK,EAAE,OAAO;YACd,QAAQ,EAAE,OAAO;YACjB,MAAM,EAAE,OAAO;SAChB,CAAC;KACH;IACD,OAAO;QACL,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,oBAAoB;QAC5C,QAAQ,EAAE,OAAO,CAAC,QAAQ,IAAI,oBAAoB;QAClD,MAAM,EAAE,O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;QACH,CAAC;QAED,OAAO;YACL,GAAG,KAAK;YACR,iBAAiB,EAAE,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC;YACrD,0BAA0B,EAAE,SAAS,CAAC,iBAAiB,CAAC,QAAQ,CAAC;YACjE,WAAW,EAAE,SAAS,CAAC,iBAAiB,CAAC,MAAM,CAAC;SACjD,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
||||
122
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js
generated
vendored
122
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js
generated
vendored
|
|
@ -28,6 +28,10 @@ const tsutils = __importStar(require("ts-api-utils"));
|
|||
const ts = __importStar(require("typescript"));
|
||||
const util = __importStar(require("../util"));
|
||||
const util_1 = require("../util");
|
||||
const messageBase = 'Promises must be awaited, end with a call to .catch, or end with a call to .then with a rejection handler.';
|
||||
const messageBaseVoid = 'Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler' +
|
||||
' or be explicitly marked as ignored with the `void` operator.';
|
||||
const messageRejectionHandler = 'A rejection handler that is not a function will be ignored.';
|
||||
exports.default = util.createRule({
|
||||
name: 'no-floating-promises',
|
||||
meta: {
|
||||
|
|
@ -38,11 +42,12 @@ exports.default = util.createRule({
|
|||
},
|
||||
hasSuggestions: true,
|
||||
messages: {
|
||||
floating: 'Promises must be awaited, end with a call to .catch, or end with a call to .then with a rejection handler.',
|
||||
floating: messageBase,
|
||||
floatingFixAwait: 'Add await operator.',
|
||||
floatingVoid: 'Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler' +
|
||||
' or be explicitly marked as ignored with the `void` operator.',
|
||||
floatingVoid: messageBaseVoid,
|
||||
floatingFixVoid: 'Add void operator to ignore.',
|
||||
floatingUselessRejectionHandler: messageBase + ' ' + messageRejectionHandler,
|
||||
floatingUselessRejectionHandlerVoid: messageBaseVoid + ' ' + messageRejectionHandler,
|
||||
},
|
||||
schema: [
|
||||
{
|
||||
|
|
@ -53,7 +58,7 @@ exports.default = util.createRule({
|
|||
type: 'boolean',
|
||||
},
|
||||
ignoreIIFE: {
|
||||
description: 'Whether to ignore async IIFEs (Immediately Invocated Function Expressions).',
|
||||
description: 'Whether to ignore async IIFEs (Immediately Invoked Function Expressions).',
|
||||
type: 'boolean',
|
||||
},
|
||||
},
|
||||
|
|
@ -80,11 +85,14 @@ exports.default = util.createRule({
|
|||
if (expression.type === utils_1.AST_NODE_TYPES.ChainExpression) {
|
||||
expression = expression.expression;
|
||||
}
|
||||
if (isUnhandledPromise(checker, expression)) {
|
||||
const { isUnhandled, nonFunctionHandler } = isUnhandledPromise(checker, expression);
|
||||
if (isUnhandled) {
|
||||
if (options.ignoreVoid) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: 'floatingVoid',
|
||||
messageId: nonFunctionHandler
|
||||
? 'floatingUselessRejectionHandlerVoid'
|
||||
: 'floatingVoid',
|
||||
suggest: [
|
||||
{
|
||||
messageId: 'floatingFixVoid',
|
||||
|
|
@ -107,7 +115,9 @@ exports.default = util.createRule({
|
|||
else {
|
||||
context.report({
|
||||
node,
|
||||
messageId: 'floating',
|
||||
messageId: nonFunctionHandler
|
||||
? 'floatingUselessRejectionHandler'
|
||||
: 'floating',
|
||||
suggest: [
|
||||
{
|
||||
messageId: 'floatingFixAwait',
|
||||
|
|
@ -150,13 +160,21 @@ exports.default = util.createRule({
|
|||
utils_1.AST_NODE_TYPES.ArrowFunctionExpression ||
|
||||
node.expression.callee.type === utils_1.AST_NODE_TYPES.FunctionExpression));
|
||||
}
|
||||
function isValidRejectionHandler(rejectionHandler) {
|
||||
return (services.program
|
||||
.getTypeChecker()
|
||||
.getTypeAtLocation(services.esTreeNodeToTSNodeMap.get(rejectionHandler))
|
||||
.getCallSignatures().length > 0);
|
||||
}
|
||||
function isUnhandledPromise(checker, node) {
|
||||
// First, check expressions whose resulting types may not be promise-like
|
||||
if (node.type === utils_1.AST_NODE_TYPES.SequenceExpression) {
|
||||
// Any child in a comma expression could return a potentially unhandled
|
||||
// promise, so we check them all regardless of whether the final returned
|
||||
// value is promise-like.
|
||||
return node.expressions.some(item => isUnhandledPromise(checker, item));
|
||||
return (node.expressions
|
||||
.map(item => isUnhandledPromise(checker, item))
|
||||
.find(result => result.isUnhandled) ?? { isUnhandled: false });
|
||||
}
|
||||
if (!options.ignoreVoid &&
|
||||
node.type === utils_1.AST_NODE_TYPES.UnaryExpression &&
|
||||
|
|
@ -167,20 +185,48 @@ exports.default = util.createRule({
|
|||
}
|
||||
// Check the type. At this point it can't be unhandled if it isn't a promise
|
||||
if (!isPromiseLike(checker, services.esTreeNodeToTSNodeMap.get(node))) {
|
||||
return false;
|
||||
return { isUnhandled: false };
|
||||
}
|
||||
if (node.type === utils_1.AST_NODE_TYPES.CallExpression) {
|
||||
// If the outer expression is a call, it must be either a `.then()` or
|
||||
// `.catch()` that handles the promise.
|
||||
return (!isPromiseCatchCallWithHandler(node) &&
|
||||
!isPromiseThenCallWithRejectionHandler(node) &&
|
||||
!isPromiseFinallyCallWithHandler(node));
|
||||
// If the outer expression is a call, a `.catch()` or `.then()` with
|
||||
// rejection handler handles the promise.
|
||||
const catchRejectionHandler = getRejectionHandlerFromCatchCall(node);
|
||||
if (catchRejectionHandler) {
|
||||
if (isValidRejectionHandler(catchRejectionHandler)) {
|
||||
return { isUnhandled: false };
|
||||
}
|
||||
else {
|
||||
return { isUnhandled: true, nonFunctionHandler: true };
|
||||
}
|
||||
}
|
||||
const thenRejectionHandler = getRejectionHandlerFromThenCall(node);
|
||||
if (thenRejectionHandler) {
|
||||
if (isValidRejectionHandler(thenRejectionHandler)) {
|
||||
return { isUnhandled: false };
|
||||
}
|
||||
else {
|
||||
return { isUnhandled: true, nonFunctionHandler: true };
|
||||
}
|
||||
}
|
||||
// `x.finally()` is transparent to resolution of the promise, so check `x`.
|
||||
// ("object" in this context is the `x` in `x.finally()`)
|
||||
const promiseFinallyObject = getObjectFromFinallyCall(node);
|
||||
if (promiseFinallyObject) {
|
||||
return isUnhandledPromise(checker, promiseFinallyObject);
|
||||
}
|
||||
// All other cases are unhandled.
|
||||
return { isUnhandled: true };
|
||||
}
|
||||
else if (node.type === utils_1.AST_NODE_TYPES.ConditionalExpression) {
|
||||
// We must be getting the promise-like value from one of the branches of the
|
||||
// ternary. Check them directly.
|
||||
return (isUnhandledPromise(checker, node.alternate) ||
|
||||
isUnhandledPromise(checker, node.consequent));
|
||||
const alternateResult = isUnhandledPromise(checker, node.alternate);
|
||||
if (alternateResult.isUnhandled) {
|
||||
return alternateResult;
|
||||
}
|
||||
else {
|
||||
return isUnhandledPromise(checker, node.consequent);
|
||||
}
|
||||
}
|
||||
else if (node.type === utils_1.AST_NODE_TYPES.MemberExpression ||
|
||||
node.type === utils_1.AST_NODE_TYPES.Identifier ||
|
||||
|
|
@ -188,16 +234,21 @@ exports.default = util.createRule({
|
|||
// If it is just a property access chain or a `new` call (e.g. `foo.bar` or
|
||||
// `new Promise()`), the promise is not handled because it doesn't have the
|
||||
// necessary then/catch call at the end of the chain.
|
||||
return true;
|
||||
return { isUnhandled: true };
|
||||
}
|
||||
else if (node.type === utils_1.AST_NODE_TYPES.LogicalExpression) {
|
||||
return (isUnhandledPromise(checker, node.left) ||
|
||||
isUnhandledPromise(checker, node.right));
|
||||
const leftResult = isUnhandledPromise(checker, node.left);
|
||||
if (leftResult.isUnhandled) {
|
||||
return leftResult;
|
||||
}
|
||||
else {
|
||||
return isUnhandledPromise(checker, node.right);
|
||||
}
|
||||
}
|
||||
// We conservatively return false for all other types of expressions because
|
||||
// we don't want to accidentally fail if the promise is handled internally but
|
||||
// we just can't tell.
|
||||
return false;
|
||||
return { isUnhandled: false };
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
@ -238,22 +289,33 @@ function isFunctionParam(checker, param, node) {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
function isPromiseCatchCallWithHandler(expression) {
|
||||
return (expression.callee.type === utils_1.AST_NODE_TYPES.MemberExpression &&
|
||||
function getRejectionHandlerFromCatchCall(expression) {
|
||||
if (expression.callee.type === utils_1.AST_NODE_TYPES.MemberExpression &&
|
||||
expression.callee.property.type === utils_1.AST_NODE_TYPES.Identifier &&
|
||||
expression.callee.property.name === 'catch' &&
|
||||
expression.arguments.length >= 1);
|
||||
expression.arguments.length >= 1) {
|
||||
return expression.arguments[0];
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
function isPromiseThenCallWithRejectionHandler(expression) {
|
||||
return (expression.callee.type === utils_1.AST_NODE_TYPES.MemberExpression &&
|
||||
function getRejectionHandlerFromThenCall(expression) {
|
||||
if (expression.callee.type === utils_1.AST_NODE_TYPES.MemberExpression &&
|
||||
expression.callee.property.type === utils_1.AST_NODE_TYPES.Identifier &&
|
||||
expression.callee.property.name === 'then' &&
|
||||
expression.arguments.length >= 2);
|
||||
expression.arguments.length >= 2) {
|
||||
return expression.arguments[1];
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
function isPromiseFinallyCallWithHandler(expression) {
|
||||
return (expression.callee.type === utils_1.AST_NODE_TYPES.MemberExpression &&
|
||||
function getObjectFromFinallyCall(expression) {
|
||||
return expression.callee.type === utils_1.AST_NODE_TYPES.MemberExpression &&
|
||||
expression.callee.property.type === utils_1.AST_NODE_TYPES.Identifier &&
|
||||
expression.callee.property.name === 'finally' &&
|
||||
expression.arguments.length >= 1);
|
||||
expression.callee.property.name === 'finally'
|
||||
? expression.callee.object
|
||||
: undefined;
|
||||
}
|
||||
//# sourceMappingURL=no-floating-promises.js.map
|
||||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-floating-promises.js.map
generated
vendored
File diff suppressed because one or more lines are too long
119
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.js
generated
vendored
119
node_modules/@typescript-eslint/eslint-plugin/dist/rules/no-restricted-imports.js
generated
vendored
|
|
@ -7,6 +7,24 @@ const ignore_1 = __importDefault(require("ignore"));
|
|||
const util_1 = require("../util");
|
||||
const getESLintCoreRule_1 = require("../util/getESLintCoreRule");
|
||||
const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-restricted-imports');
|
||||
// In some versions of eslint, the base rule has a completely incompatible schema
|
||||
// This helper function is to safely try to get parts of the schema. If it's not
|
||||
// possible, we'll fallback to less strict checks.
|
||||
const tryAccess = (getter, fallback) => {
|
||||
try {
|
||||
return getter();
|
||||
}
|
||||
catch {
|
||||
return fallback;
|
||||
}
|
||||
};
|
||||
const baseSchema = baseRule.meta.schema;
|
||||
const allowTypeImportsOptionSchema = {
|
||||
allowTypeImports: {
|
||||
type: 'boolean',
|
||||
description: 'Disallow value imports, but allow type-only imports.',
|
||||
},
|
||||
};
|
||||
const arrayOfStringsOrObjects = {
|
||||
type: 'array',
|
||||
items: {
|
||||
|
|
@ -14,25 +32,14 @@ const arrayOfStringsOrObjects = {
|
|||
{ type: 'string' },
|
||||
{
|
||||
type: 'object',
|
||||
properties: {
|
||||
name: { type: 'string' },
|
||||
message: {
|
||||
type: 'string',
|
||||
minLength: 1,
|
||||
},
|
||||
importNames: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
allowTypeImports: {
|
||||
type: 'boolean',
|
||||
description: 'Disallow value imports, but allow type-only imports.',
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
required: ['name'],
|
||||
properties: {
|
||||
...tryAccess(() => baseSchema.anyOf[1].items[0].properties.paths.items.anyOf[1]
|
||||
.properties, undefined),
|
||||
...allowTypeImportsOptionSchema,
|
||||
},
|
||||
required: tryAccess(() => baseSchema.anyOf[1].items[0].properties.paths.items.anyOf[1]
|
||||
.required, undefined),
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
@ -51,42 +58,38 @@ const arrayOfStringsOrObjectPatterns = {
|
|||
type: 'array',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
importNames: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
minItems: 1,
|
||||
uniqueItems: true,
|
||||
},
|
||||
group: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
minItems: 1,
|
||||
uniqueItems: true,
|
||||
},
|
||||
message: {
|
||||
type: 'string',
|
||||
minLength: 1,
|
||||
},
|
||||
caseSensitive: {
|
||||
type: 'boolean',
|
||||
},
|
||||
allowTypeImports: {
|
||||
type: 'boolean',
|
||||
description: 'Disallow value imports, but allow type-only imports.',
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
required: ['group'],
|
||||
properties: {
|
||||
...tryAccess(() => baseSchema.anyOf[1].items[0].properties.patterns.anyOf[1].items
|
||||
.properties, undefined),
|
||||
...allowTypeImportsOptionSchema,
|
||||
},
|
||||
required: tryAccess(() => baseSchema.anyOf[1].items[0].properties.patterns.anyOf[1].items
|
||||
.required, []),
|
||||
},
|
||||
uniqueItems: true,
|
||||
},
|
||||
],
|
||||
};
|
||||
const schema = {
|
||||
anyOf: [
|
||||
arrayOfStringsOrObjects,
|
||||
{
|
||||
type: 'array',
|
||||
items: [
|
||||
{
|
||||
type: 'object',
|
||||
properties: {
|
||||
paths: arrayOfStringsOrObjects,
|
||||
patterns: arrayOfStringsOrObjectPatterns,
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
additionalItems: false,
|
||||
},
|
||||
],
|
||||
};
|
||||
function isObjectOfPaths(obj) {
|
||||
return Object.prototype.hasOwnProperty.call(obj, 'paths');
|
||||
}
|
||||
|
|
@ -127,25 +130,7 @@ exports.default = (0, util_1.createRule)({
|
|||
},
|
||||
messages: baseRule.meta.messages,
|
||||
fixable: baseRule.meta.fixable,
|
||||
schema: {
|
||||
anyOf: [
|
||||
arrayOfStringsOrObjects,
|
||||
{
|
||||
type: 'array',
|
||||
items: [
|
||||
{
|
||||
type: 'object',
|
||||
properties: {
|
||||
paths: arrayOfStringsOrObjects,
|
||||
patterns: arrayOfStringsOrObjectPatterns,
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
additionalItems: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
schema,
|
||||
},
|
||||
defaultOptions: [],
|
||||
create(context) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -24,6 +24,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const utils_1 = require("@typescript-eslint/utils");
|
||||
const path_1 = require("path");
|
||||
const ts = __importStar(require("typescript"));
|
||||
const util = __importStar(require("../util"));
|
||||
exports.default = util.createRule({
|
||||
name: 'no-unnecessary-type-constraint',
|
||||
|
|
@ -49,12 +51,23 @@ exports.default = util.createRule({
|
|||
[utils_1.AST_NODE_TYPES.TSAnyKeyword, 'any'],
|
||||
[utils_1.AST_NODE_TYPES.TSUnknownKeyword, 'unknown'],
|
||||
]);
|
||||
const inJsx = context.getFilename().toLowerCase().endsWith('tsx');
|
||||
function checkRequiresGenericDeclarationDisambiguation(filename) {
|
||||
const pathExt = (0, path_1.extname)(filename).toLocaleLowerCase();
|
||||
switch (pathExt) {
|
||||
case ts.Extension.Cts:
|
||||
case ts.Extension.Mts:
|
||||
case ts.Extension.Tsx:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
const requiresGenericDeclarationDisambiguation = checkRequiresGenericDeclarationDisambiguation(context.getFilename());
|
||||
const source = context.getSourceCode();
|
||||
const checkNode = (node, inArrowFunction) => {
|
||||
const constraint = unnecessaryConstraints.get(node.constraint.type);
|
||||
function shouldAddTrailingComma() {
|
||||
if (!inArrowFunction || !inJsx) {
|
||||
if (!inArrowFunction || !requiresGenericDeclarationDisambiguation) {
|
||||
return false;
|
||||
}
|
||||
// Only <T>() => {} would need trailing comma
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"no-unnecessary-type-constraint.js","sourceRoot":"","sources":["../../src/rules/no-unnecessary-type-constraint.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,oDAA0D;AAE1D,8CAAgC;AAUhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,gCAAgC;IACtC,IAAI,EAAE;QACJ,IAAI,EAAE;YACJ,WAAW,EAAE,mDAAmD;YAChE,WAAW,EAAE,aAAa;SAC3B;QACD,cAAc,EAAE,IAAI;QACpB,QAAQ,EAAE;YACR,qBAAqB,EACnB,+FAA+F;YACjG,2BAA2B,EACzB,qDAAqD;SACxD;QACD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,YAAY;KACnB;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,CAAC,OAAO;QACZ,iFAAiF;QACjF,sFAAsF;QACtF,yFAAyF;QACzF,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;YACrC,CAAC,sBAAc,CAAC,YAAY,EAAE,KAAK,CAAC;YACpC,CAAC,sBAAc,CAAC,gBAAgB,EAAE,SAAS,CAAC;SAC7C,CAAC,CAAC;QAEH,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClE,MAAM,MAAM,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;QAEvC,MAAM,SAAS,GAAG,CAChB,IAAiC,EACjC,eAAwB,EAClB,EAAE;YACR,MAAM,UAAU,GAAG,sBAAsB,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YACpE,SAAS,sBAAsB;gBAC7B,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK,EAAE;oBAC9B,OAAO,KAAK,CAAC;iBACd;gBACD,6CAA6C;gBAC7C,OAAO,CACJ,IAAI,CAAC,MAA8C,CAAC,MAAM,CAAC,MAAM;oBAChE,CAAC;oBACH,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,GAAG;oBAC5C,CAAC,IAAI,CAAC,OAAO,CACd,CAAC;YACJ,CAAC;YAED,IAAI,UAAU,EAAE;gBACd,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI,EAAE;wBACJ,UAAU;wBACV,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;qBACrB;oBACD,OAAO,EAAE;wBACP;4BACE,SAAS,EAAE,6BAA6B;4BACxC,IAAI,EAAE;gCACJ,UAAU;6BACX;4BACD,GAAG,CAAC,KAAK;gCACP,OAAO,KAAK,CAAC,gBAAgB,CAC3B,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC9C,sBAAsB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CACpC,CAAC;4BACJ,CAAC;yBACF;qBACF;oBACD,SAAS,EAAE,uBAAuB;oBAClC,IAAI;iBACL,CAAC,CAAC;aACJ;QACH,CAAC,CAAC;QAEF,OAAO;YACL,0FAA0F,CACxF,IAAiC;gBAEjC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACzB,CAAC;YACD,oFAAoF,CAClF,IAAiC;gBAEjC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACxB,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
||||
{"version":3,"file":"no-unnecessary-type-constraint.js","sourceRoot":"","sources":["../../src/rules/no-unnecessary-type-constraint.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,oDAA0D;AAC1D,+BAA+B;AAC/B,+CAAiC;AAEjC,8CAAgC;AAUhC,kBAAe,IAAI,CAAC,UAAU,CAAC;IAC7B,IAAI,EAAE,gCAAgC;IACtC,IAAI,EAAE;Q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d;gBACD,6CAA6C;gBAC7C,OAAO,CACJ,IAAI,CAAC,MAA8C,CAAC,MAAM,CAAC,MAAM;oBAChE,CAAC;oBACH,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,GAAG;oBAC5C,CAAC,IAAI,CAAC,OAAO,CACd,CAAC;YACJ,CAAC;YAED,IAAI,UAAU,EAAE;gBACd,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI,EAAE;wBACJ,UAAU;wBACV,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;qBACrB;oBACD,OAAO,EAAE;wBACP;4BACE,SAAS,EAAE,6BAA6B;4BACxC,IAAI,EAAE;gCACJ,UAAU;6BACX;4BACD,GAAG,CAAC,KAAK;gCACP,OAAO,KAAK,CAAC,gBAAgB,CAC3B,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAC9C,sBAAsB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CACpC,CAAC;4BACJ,CAAC;yBACF;qBACF;oBACD,SAAS,EAAE,uBAAuB;oBAClC,IAAI;iBACL,CAAC,CAAC;aACJ;QACH,CAAC,CAAC;QAEF,OAAO;YACL,0FAA0F,CACxF,IAAiC;gBAEjC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;YACzB,CAAC;YACD,oFAAoF,CAClF,IAAiC;gBAEjC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACxB,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
||||
1
node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js
generated
vendored
1
node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js
generated
vendored
|
|
@ -59,7 +59,6 @@ exports.default = util.createRule({
|
|||
items: {
|
||||
$ref: '#/items/0/$defs/modifier',
|
||||
},
|
||||
minItems: 1,
|
||||
},
|
||||
prefer: {
|
||||
type: 'string',
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js.map
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/dist/rules/parameter-properties.js.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"parameter-properties.js","sourceRoot":"","sources":["../../src/rules/parameter-properties.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,oDAA0D;AAE1D,8CAAgC;AAsBhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,gEAAgE;SACnE;QACD,QAAQ,EAAE;YACR,mBAAmB,EACjB,gEAAgE;YAClE,uBAAuB,EACrB,oEAAoE;SACvE;QACD,MAAM,EAAE;YACN;gBACE,KAAK,EAAE;oBACL,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE;4BACJ,UAAU;4BACV,SAAS;4BACT,WAAW;4BACX,QAAQ;4BACR,kBAAkB;4BAClB,oBAAoB;4BACpB,iBAAiB;yBAClB;qBACF;iBACF;gBACD,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,KAAK,EAAE;wBACL,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE;4BACL,IAAI,EAAE,0BAA0B;yBACjC;wBACD,QAAQ,EAAE,CAAC;qBACZ;oBACD,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,gBAAgB,EAAE,oBAAoB,CAAC;qBAC/C;iBACF;gBACD,oBAAoB,EAAE,KAAK;aAC5B;SACF;KACF;IACD,cAAc,EAAE;QACd;YACE,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,gBAAgB;SACzB;KACF;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;wBAC/B,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI;4BACrC,sBAAc,CAAC,UAAU;wBAC3B,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,sBAAc,CAAC,UAAU,EAC7D;wBACA,MAAM;qBACP;oBAED,cAAc,CACZ,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAChC,CAAC,qBAAqB,GAAG,SAAS,CAAC,UAAU,CAAC;iBAChD;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
||||
{"version":3,"file":"parameter-properties.js","sourceRoot":"","sources":["../../src/rules/parameter-properties.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,oDAA0D;AAE1D,8CAAgC;AAsBhC,kBAAe,IAAI,CAAC,UAAU,CAAsB;IAClD,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,gEAAgE;SACnE;QACD,QAAQ,EAAE;YACR,mBAAmB,EACjB,gEAAgE;YAClE,uBAAuB,EACrB,oEAAoE;SACvE;QACD,MAAM,EAAE;YACN;gBACE,KAAK,EAAE;oBACL,QAAQ,EAAE;wBACR,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE;4BACJ,UAAU;4BACV,SAAS;4BACT,WAAW;4BACX,QAAQ;4BACR,kBAAkB;4BAClB,oBAAoB;4BACpB,iBAAiB;yBAClB;qBACF;iBACF;gBACD,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,KAAK,EAAE;wBACL,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE;4BACL,IAAI,EAAE,0BAA0B;yBACjC;qBACF;oBACD,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,gBAAgB,EAAE,oBAAoB,CAAC;qBAC/C;iBACF;gBACD,oBAAoB,EAAE,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c,CAAC,gBAAgB;wBACjC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;4BACnC,sBAAc,CAAC,cAAc;wBAC/B,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI;4BACrC,sBAAc,CAAC,UAAU;wBAC3B,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,sBAAc,CAAC,UAAU,EAC7D;wBACA,MAAM;qBACP;oBAED,cAAc,CACZ,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAChC,CAAC,qBAAqB,GAAG,SAAS,CAAC,UAAU,CAAC;iBAChD;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
||||
6
node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.js
generated
vendored
6
node_modules/@typescript-eslint/eslint-plugin/dist/util/collectUnusedVariables.js
generated
vendored
|
|
@ -309,8 +309,7 @@ function isMergableExported(variable) {
|
|||
* @returns True if the variable is exported, false if not.
|
||||
*/
|
||||
function isExported(variable) {
|
||||
const definition = variable.defs[0];
|
||||
if (definition) {
|
||||
return variable.defs.some(definition => {
|
||||
let node = definition.node;
|
||||
if (node.type === utils_1.AST_NODE_TYPES.VariableDeclarator) {
|
||||
node = node.parent;
|
||||
|
|
@ -319,8 +318,7 @@ function isExported(variable) {
|
|||
return false;
|
||||
}
|
||||
return node.parent.type.indexOf('Export') === 0;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Determines if the variable is used.
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/camelcase.md
generated
vendored
|
|
@ -5,6 +5,6 @@ This rule has been deprecated in favour of the [`naming-convention`](./naming-co
|
|||
:::
|
||||
|
||||
<!--
|
||||
This doc file has been left on purpose because `camelcase` is a core eslint rule.
|
||||
This doc file has been left on purpose because `camelcase` is a core ESLint rule.
|
||||
This exists to help direct people to the replacement rule.
|
||||
-->
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ description: 'Require explicit accessibility modifiers on class properties and m
|
|||
> See **https://typescript-eslint.io/rules/explicit-member-accessibility** for documentation.
|
||||
|
||||
TypeScript allows placing explicit `public`, `protected`, and `private` accessibility modifiers in front of class members.
|
||||
The modifiers exist solely in the type system and just server to describe who is allowed to access those members.
|
||||
The modifiers exist solely in the type system and just serve to describe who is allowed to access those members.
|
||||
|
||||
Leaving off accessibility modifiers makes for less code to read and write.
|
||||
Members are `public` by default.
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md
generated
vendored
2
node_modules/@typescript-eslint/eslint-plugin/docs/rules/no-floating-promises.md
generated
vendored
|
|
@ -83,7 +83,7 @@ With this option set to `true`, and if you are using `no-void`, you should turn
|
|||
|
||||
### `ignoreIIFE`
|
||||
|
||||
This allows you to skip checking of async IIFEs (Immediately Invocated function Expressions).
|
||||
This allows you to skip checking of async IIFEs (Immediately Invoked function Expressions).
|
||||
|
||||
Examples of **correct** code for this rule with `{ ignoreIIFE: true }`:
|
||||
|
||||
|
|
|
|||
27
node_modules/@typescript-eslint/eslint-plugin/package.json
generated
vendored
27
node_modules/@typescript-eslint/eslint-plugin/package.json
generated
vendored
|
|
@ -1,11 +1,12 @@
|
|||
{
|
||||
"name": "@typescript-eslint/eslint-plugin",
|
||||
"version": "6.0.0",
|
||||
"version": "6.1.0",
|
||||
"description": "TypeScript plugin for ESLint",
|
||||
"files": [
|
||||
"dist",
|
||||
"docs",
|
||||
"index.d.ts",
|
||||
"rules.d.ts",
|
||||
"package.json",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
|
|
@ -55,18 +56,17 @@
|
|||
"typecheck": "tsc -p tsconfig.json --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.5.0",
|
||||
"@typescript-eslint/scope-manager": "6.0.0",
|
||||
"@typescript-eslint/type-utils": "6.0.0",
|
||||
"@typescript-eslint/utils": "6.0.0",
|
||||
"@typescript-eslint/visitor-keys": "6.0.0",
|
||||
"@eslint-community/regexpp": "^4.5.1",
|
||||
"@typescript-eslint/scope-manager": "6.1.0",
|
||||
"@typescript-eslint/type-utils": "6.1.0",
|
||||
"@typescript-eslint/utils": "6.1.0",
|
||||
"@typescript-eslint/visitor-keys": "6.1.0",
|
||||
"debug": "^4.3.4",
|
||||
"grapheme-splitter": "^1.0.4",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.2.4",
|
||||
"natural-compare": "^1.4.0",
|
||||
"natural-compare-lite": "^1.4.0",
|
||||
"semver": "^7.5.0",
|
||||
"semver": "^7.5.4",
|
||||
"ts-api-utils": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
@ -74,14 +74,15 @@
|
|||
"@types/marked": "*",
|
||||
"@types/natural-compare": "*",
|
||||
"@types/prettier": "*",
|
||||
"@typescript-eslint/rule-schema-to-typescript-types": "6.0.0",
|
||||
"@typescript-eslint/rule-tester": "6.0.0",
|
||||
"chalk": "^5.0.1",
|
||||
"@typescript-eslint/rule-schema-to-typescript-types": "6.1.0",
|
||||
"@typescript-eslint/rule-tester": "6.1.0",
|
||||
"ajv": "^6.12.6",
|
||||
"chalk": "^5.3.0",
|
||||
"cross-fetch": "*",
|
||||
"jest-specific-snapshot": "*",
|
||||
"json-schema": "*",
|
||||
"markdown-table": "^3.0.3",
|
||||
"marked": "^4.3.0",
|
||||
"marked": "^5.1.1",
|
||||
"prettier": "*",
|
||||
"title-case": "^3.0.3",
|
||||
"typescript": "*"
|
||||
|
|
@ -99,5 +100,5 @@
|
|||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"gitHead": "6ae1fa74b18af8a2d4baa0d3d4b43997cf9a9781"
|
||||
"gitHead": "d98f1e811a6a06128a86f10824b6005984dc8265"
|
||||
}
|
||||
|
|
|
|||
44
node_modules/@typescript-eslint/eslint-plugin/rules.d.ts
generated
vendored
Normal file
44
node_modules/@typescript-eslint/eslint-plugin/rules.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
We purposely don't generate types for our plugin because TL;DR:
|
||||
1) there's no real reason that anyone should do a typed import of our rules,
|
||||
2) it would require us to change our code so there aren't as many inferred types
|
||||
|
||||
This type declaration exists as a hacky way to add a type to the export for our
|
||||
internal packages that require it.
|
||||
|
||||
*** Long reason ***
|
||||
|
||||
When you turn on declaration files, TS requires all types to be "fully resolvable"
|
||||
without changes to the code.
|
||||
All of our lint rules `export default createRule(...)`, which means they all
|
||||
implicitly reference the `TSESLint.Rule` type for the export.
|
||||
|
||||
TS wants to transpile each rule file to this `.d.ts` file:
|
||||
|
||||
```ts
|
||||
import type { TSESLint } from '@typescript-eslint/utils';
|
||||
declare const _default: TSESLint.RuleModule<TMessageIds, TOptions, TSESLint.RuleListener>;
|
||||
export default _default;
|
||||
```
|
||||
|
||||
Because we don't import `TSESLint` in most files, it means that TS would have to
|
||||
insert a new import during the declaration emit to make this work.
|
||||
However TS wants to avoid adding new imports to the file because a new module
|
||||
could have type side-effects (like global augmentation) which could cause weird
|
||||
type side-effects in the decl file that wouldn't exist in source TS file.
|
||||
|
||||
So TS errors on most of our rules with the following error:
|
||||
```
|
||||
The inferred type of 'default' cannot be named without a reference to
|
||||
'../../../../node_modules/@typescript-eslint/utils/src/ts-eslint/Rule'.
|
||||
This is likely not portable. A type annotation is necessary. ts(2742)
|
||||
```
|
||||
*/
|
||||
|
||||
import type { RuleModule } from '@typescript-eslint/utils/ts-eslint';
|
||||
|
||||
export interface TypeScriptESLintRules {
|
||||
[ruleName: string]: RuleModule<string, unknown[]>;
|
||||
}
|
||||
declare const rules: TypeScriptESLintRules;
|
||||
export = rules;
|
||||
12
node_modules/@typescript-eslint/parser/package.json
generated
vendored
12
node_modules/@typescript-eslint/parser/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/parser",
|
||||
"version": "6.0.0",
|
||||
"version": "6.1.0",
|
||||
"description": "An ESLint custom parser which leverages TypeScript ESTree",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -51,10 +51,10 @@
|
|||
"eslint": "^7.0.0 || ^8.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "6.0.0",
|
||||
"@typescript-eslint/types": "6.0.0",
|
||||
"@typescript-eslint/typescript-estree": "6.0.0",
|
||||
"@typescript-eslint/visitor-keys": "6.0.0",
|
||||
"@typescript-eslint/scope-manager": "6.1.0",
|
||||
"@typescript-eslint/types": "6.1.0",
|
||||
"@typescript-eslint/typescript-estree": "6.1.0",
|
||||
"@typescript-eslint/visitor-keys": "6.1.0",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
@ -77,5 +77,5 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"gitHead": "6ae1fa74b18af8a2d4baa0d3d4b43997cf9a9781"
|
||||
"gitHead": "d98f1e811a6a06128a86f10824b6005984dc8265"
|
||||
}
|
||||
|
|
|
|||
10
node_modules/@typescript-eslint/scope-manager/package.json
generated
vendored
10
node_modules/@typescript-eslint/scope-manager/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/scope-manager",
|
||||
"version": "6.0.0",
|
||||
"version": "6.1.0",
|
||||
"description": "TypeScript scope analyser for ESLint",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -44,12 +44,12 @@
|
|||
"typecheck": "nx typecheck"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.0.0",
|
||||
"@typescript-eslint/visitor-keys": "6.0.0"
|
||||
"@typescript-eslint/types": "6.1.0",
|
||||
"@typescript-eslint/visitor-keys": "6.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/glob": "*",
|
||||
"@typescript-eslint/typescript-estree": "6.0.0",
|
||||
"@typescript-eslint/typescript-estree": "6.1.0",
|
||||
"glob": "*",
|
||||
"jest-specific-snapshot": "*",
|
||||
"make-dir": "*",
|
||||
|
|
@ -69,5 +69,5 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"gitHead": "6ae1fa74b18af8a2d4baa0d3d4b43997cf9a9781"
|
||||
"gitHead": "d98f1e811a6a06128a86f10824b6005984dc8265"
|
||||
}
|
||||
|
|
|
|||
10
node_modules/@typescript-eslint/type-utils/package.json
generated
vendored
10
node_modules/@typescript-eslint/type-utils/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/type-utils",
|
||||
"version": "6.0.0",
|
||||
"version": "6.1.0",
|
||||
"description": "Type utilities for working with TypeScript + ESLint together",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -45,13 +45,13 @@
|
|||
"typecheck": "tsc -p tsconfig.json --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@typescript-eslint/typescript-estree": "6.0.0",
|
||||
"@typescript-eslint/utils": "6.0.0",
|
||||
"@typescript-eslint/typescript-estree": "6.1.0",
|
||||
"@typescript-eslint/utils": "6.1.0",
|
||||
"debug": "^4.3.4",
|
||||
"ts-api-utils": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@typescript-eslint/parser": "6.0.0",
|
||||
"@typescript-eslint/parser": "6.1.0",
|
||||
"ajv": "^8.12.0",
|
||||
"typescript": "*"
|
||||
},
|
||||
|
|
@ -74,5 +74,5 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"gitHead": "6ae1fa74b18af8a2d4baa0d3d4b43997cf9a9781"
|
||||
"gitHead": "d98f1e811a6a06128a86f10824b6005984dc8265"
|
||||
}
|
||||
|
|
|
|||
1819
node_modules/@typescript-eslint/types/_ts4.3/dist/generated/ast-spec.d.ts
generated
vendored
1819
node_modules/@typescript-eslint/types/_ts4.3/dist/generated/ast-spec.d.ts
generated
vendored
File diff suppressed because it is too large
Load diff
5
node_modules/@typescript-eslint/types/_ts4.3/dist/index.d.ts
generated
vendored
5
node_modules/@typescript-eslint/types/_ts4.3/dist/index.d.ts
generated
vendored
|
|
@ -1,5 +0,0 @@
|
|||
export { AST_NODE_TYPES, AST_TOKEN_TYPES } from './generated/ast-spec';
|
||||
export * from './lib';
|
||||
export * from './parser-options';
|
||||
export * from './ts-estree';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
3
node_modules/@typescript-eslint/types/_ts4.3/dist/lib.d.ts
generated
vendored
3
node_modules/@typescript-eslint/types/_ts4.3/dist/lib.d.ts
generated
vendored
|
|
@ -1,3 +0,0 @@
|
|||
type Lib = 'decorators.legacy' | 'decorators' | 'dom.iterable' | 'dom' | 'es5' | 'es6' | 'es7' | 'es2015.collection' | 'es2015.core' | 'es2015.generator' | 'es2015.iterable' | 'es2015.promise' | 'es2015.proxy' | 'es2015.reflect' | 'es2015.symbol.wellknown' | 'es2015.symbol' | 'es2015' | 'es2016.array.include' | 'es2016.full' | 'es2016' | 'es2017.full' | 'es2017.intl' | 'es2017.object' | 'es2017.sharedmemory' | 'es2017.string' | 'es2017.typedarrays' | 'es2017' | 'es2018.asyncgenerator' | 'es2018.asynciterable' | 'es2018.full' | 'es2018.intl' | 'es2018.promise' | 'es2018.regexp' | 'es2018' | 'es2019.array' | 'es2019.full' | 'es2019.intl' | 'es2019.object' | 'es2019.string' | 'es2019.symbol' | 'es2019' | 'es2020.bigint' | 'es2020.date' | 'es2020.full' | 'es2020.intl' | 'es2020.number' | 'es2020.promise' | 'es2020.sharedmemory' | 'es2020.string' | 'es2020.symbol.wellknown' | 'es2020' | 'es2021.full' | 'es2021.intl' | 'es2021.promise' | 'es2021.string' | 'es2021.weakref' | 'es2021' | 'es2022.array' | 'es2022.error' | 'es2022.full' | 'es2022.intl' | 'es2022.object' | 'es2022.regexp' | 'es2022.sharedmemory' | 'es2022.string' | 'es2022' | 'es2023.array' | 'es2023.full' | 'es2023' | 'esnext.array' | 'esnext.asynciterable' | 'esnext.bigint' | 'esnext.full' | 'esnext.intl' | 'esnext.promise' | 'esnext.string' | 'esnext.symbol' | 'esnext.weakref' | 'esnext' | 'lib' | 'scripthost' | 'webworker.importscripts' | 'webworker.iterable' | 'webworker';
|
||||
export { Lib };
|
||||
//# sourceMappingURL=lib.d.ts.map
|
||||
39
node_modules/@typescript-eslint/types/_ts4.3/dist/parser-options.d.ts
generated
vendored
39
node_modules/@typescript-eslint/types/_ts4.3/dist/parser-options.d.ts
generated
vendored
|
|
@ -1,39 +0,0 @@
|
|||
import type { Program } from 'typescript';
|
||||
import type { Lib } from './lib';
|
||||
type DebugLevel = ('eslint' | 'typescript-eslint' | 'typescript')[] | boolean;
|
||||
type CacheDurationSeconds = number | 'Infinity';
|
||||
type EcmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022;
|
||||
type SourceType = 'module' | 'script';
|
||||
interface ParserOptions {
|
||||
ecmaFeatures?: {
|
||||
globalReturn?: boolean;
|
||||
jsx?: boolean;
|
||||
};
|
||||
ecmaVersion?: EcmaVersion | 'latest';
|
||||
jsxPragma?: string | null;
|
||||
jsxFragmentName?: string | null;
|
||||
lib?: Lib[];
|
||||
emitDecoratorMetadata?: boolean;
|
||||
comment?: boolean;
|
||||
debugLevel?: DebugLevel;
|
||||
errorOnTypeScriptSyntacticAndSemanticIssues?: boolean;
|
||||
errorOnUnknownASTType?: boolean;
|
||||
EXPERIMENTAL_useSourceOfProjectReferenceRedirect?: boolean;
|
||||
extraFileExtensions?: string[];
|
||||
filePath?: string;
|
||||
loc?: boolean;
|
||||
program?: Program | null;
|
||||
project?: string[] | string | true | null;
|
||||
projectFolderIgnoreList?: (RegExp | string)[];
|
||||
range?: boolean;
|
||||
sourceType?: SourceType;
|
||||
tokens?: boolean;
|
||||
tsconfigRootDir?: string;
|
||||
warnOnUnsupportedTypeScriptVersion?: boolean;
|
||||
cacheLifetime?: {
|
||||
glob?: CacheDurationSeconds;
|
||||
};
|
||||
[additionalProperties: string]: unknown;
|
||||
}
|
||||
export { CacheDurationSeconds, DebugLevel, EcmaVersion, ParserOptions, SourceType, };
|
||||
//# sourceMappingURL=parser-options.d.ts.map
|
||||
14
node_modules/@typescript-eslint/types/_ts4.3/dist/ts-estree.d.ts
generated
vendored
14
node_modules/@typescript-eslint/types/_ts4.3/dist/ts-estree.d.ts
generated
vendored
|
|
@ -1,14 +0,0 @@
|
|||
import type * as TSESTree from './generated/ast-spec';
|
||||
declare module './generated/ast-spec' {
|
||||
interface BaseNode {
|
||||
parent: TSESTree.Node;
|
||||
}
|
||||
interface Program {
|
||||
/**
|
||||
* @remarks This never-used property exists only as a convenience for code that tries to access node parents repeatedly.
|
||||
*/
|
||||
parent?: never;
|
||||
}
|
||||
}
|
||||
export * as TSESTree from './generated/ast-spec';
|
||||
//# sourceMappingURL=ts-estree.d.ts.map
|
||||
1
node_modules/@typescript-eslint/types/dist/parser-options.d.ts
generated
vendored
1
node_modules/@typescript-eslint/types/dist/parser-options.d.ts
generated
vendored
|
|
@ -18,6 +18,7 @@ interface ParserOptions {
|
|||
debugLevel?: DebugLevel;
|
||||
errorOnTypeScriptSyntacticAndSemanticIssues?: boolean;
|
||||
errorOnUnknownASTType?: boolean;
|
||||
EXPERIMENTAL_useProjectService?: boolean;
|
||||
EXPERIMENTAL_useSourceOfProjectReferenceRedirect?: boolean;
|
||||
extraFileExtensions?: string[];
|
||||
filePath?: string;
|
||||
|
|
|
|||
2
node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map
generated
vendored
2
node_modules/@typescript-eslint/types/dist/parser-options.d.ts.map
generated
vendored
|
|
@ -1 +1 @@
|
|||
{"version":3,"file":"parser-options.d.ts","sourceRoot":"","sources":["../src/parser-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EA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slint/types/package.json
generated
vendored
4
node_modules/@typescript-eslint/types/package.json
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@typescript-eslint/types",
|
||||
"version": "6.0.0",
|
||||
"version": "6.1.0",
|
||||
"description": "Types for the TypeScript-ESTree AST spec",
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
@ -86,5 +86,5 @@
|
|||
]
|
||||
}
|
||||
},
|
||||
"gitHead": "6ae1fa74b18af8a2d4baa0d3d4b43997cf9a9781"
|
||||
"gitHead": "d98f1e811a6a06128a86f10824b6005984dc8265"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
import * as ts from 'typescript';
|
||||
import type { ParseSettings } from '../parseSettings';
|
||||
import type { ASTAndDefiniteProgram } from './shared';
|
||||
/**
|
||||
* @param parseSettings Internal settings for parsing the file
|
||||
* @returns If found, the source file corresponding to the code and the containing program
|
||||
*/
|
||||
declare function createProjectProgram(parseSettings: ParseSettings): ASTAndDefiniteProgram | undefined;
|
||||
declare function createProjectProgram(parseSettings: ParseSettings, programsForProjects: readonly ts.Program[]): ASTAndDefiniteProgram | undefined;
|
||||
export { createProjectProgram };
|
||||
//# sourceMappingURL=createProjectProgram.d.ts.map
|
||||
|
|
|
|||
4
node_modules/@typescript-eslint/typescript-estree/_ts4.3/dist/create-program/createProjectService.d.ts
generated
vendored
Normal file
4
node_modules/@typescript-eslint/typescript-estree/_ts4.3/dist/create-program/createProjectService.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
import type * as ts from 'typescript/lib/tsserverlibrary';
|
||||
export type TypeScriptProjectService = ts.server.ProjectService;
|
||||
export declare function createProjectService(): TypeScriptProjectService;
|
||||
//# sourceMappingURL=createProjectService.d.ts.map
|
||||
|
|
@ -21,7 +21,7 @@ type CanonicalPath = string & {
|
|||
declare function getCanonicalFileName(filePath: string): CanonicalPath;
|
||||
declare function ensureAbsolutePath(p: string, tsconfigRootDir: string): string;
|
||||
declare function canonicalDirname(p: CanonicalPath): CanonicalPath;
|
||||
declare function getAstFromProgram(currentProgram: Program, parseSettings: ParseSettings): ASTAndDefiniteProgram | undefined;
|
||||
declare function getAstFromProgram(currentProgram: Program, filePath: string): ASTAndDefiniteProgram | undefined;
|
||||
/**
|
||||
* Hash content for compare content.
|
||||
* @param content hashed contend
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
import * as ts from 'typescript';
|
||||
import type { ParseSettings } from '../parseSettings';
|
||||
import type { ASTAndDefiniteProgram } from './shared';
|
||||
declare function useProvidedPrograms(programInstances: Iterable<ts.Program>, parseSettings: ParseSettings): ASTAndDefiniteProgram | undefined;
|
||||
export interface ProvidedProgramsSettings {
|
||||
filePath: string;
|
||||
tsconfigRootDir: string;
|
||||
}
|
||||
declare function useProvidedPrograms(programInstances: Iterable<ts.Program>, { filePath, tsconfigRootDir }: ProvidedProgramsSettings): ASTAndDefiniteProgram | undefined;
|
||||
/**
|
||||
* Utility offered by parser to help consumers construct their own program instance.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -3,4 +3,5 @@ import type { TSESTreeOptions } from '../parser-options';
|
|||
import type { MutableParseSettings } from './index';
|
||||
export declare function createParseSettings(code: ts.SourceFile | string, options?: Partial<TSESTreeOptions>): MutableParseSettings;
|
||||
export declare function clearTSConfigMatchCache(): void;
|
||||
export declare function clearTSServerProjectService(): void;
|
||||
//# sourceMappingURL=createParseSettings.d.ts.map
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type * as ts from 'typescript';
|
||||
import type * as tsserverlibrary from 'typescript/lib/tsserverlibrary';
|
||||
import type { CanonicalPath } from '../create-program/shared';
|
||||
import type { TSESTree } from '../ts-estree';
|
||||
import type { CacheLike } from './ExpiringCache';
|
||||
|
|
@ -45,6 +46,10 @@ export interface MutableParseSettings {
|
|||
* Whether to error if an unknown AST node type is encountered.
|
||||
*/
|
||||
errorOnUnknownASTType: boolean;
|
||||
/**
|
||||
* Experimental: TypeScript server to power program creation.
|
||||
*/
|
||||
EXPERIMENTAL_projectService: tsserverlibrary.server.ProjectService | undefined;
|
||||
/**
|
||||
* Whether TS should use the source files for referenced projects instead of the compiled .d.ts files.
|
||||
*
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue