mirror of
https://github.com/stCarolas/setup-maven.git
synced 2024-12-19 19:49:04 +00:00
Merge pull request #24 from celiogafesi/update-dependencies
chore: update dependencies
This commit is contained in:
commit
e792f67033
166
node_modules/.package-lock.json
generated
vendored
166
node_modules/.package-lock.json
generated
vendored
@ -31,14 +31,6 @@
|
||||
"tunnel": "0.0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/http-client/node_modules/tunnel": {
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
|
||||
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
|
||||
"engines": {
|
||||
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@actions/io": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.1.tgz",
|
||||
@ -225,6 +217,18 @@
|
||||
"resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz",
|
||||
"integrity": "sha1-M3dm2hWAEhD92VbCLpxokaudAzc="
|
||||
},
|
||||
"node_modules/call-bind": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
|
||||
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.1",
|
||||
"get-intrinsic": "^1.0.2"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/caller-callsite": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/caller-callsite/-/caller-callsite-2.0.0.tgz",
|
||||
@ -413,6 +417,24 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/function-bind": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz",
|
||||
"integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.1",
|
||||
"has": "^1.0.3",
|
||||
"has-symbols": "^1.0.3"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/get-stdin": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz",
|
||||
@ -433,6 +455,17 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/has": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
|
||||
"integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/has-flag": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
||||
@ -442,10 +475,21 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/has-symbols": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
|
||||
"integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/hosted-git-info": {
|
||||
"version": "2.8.5",
|
||||
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz",
|
||||
"integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==",
|
||||
"version": "2.8.9",
|
||||
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
|
||||
"integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/husky": {
|
||||
@ -617,11 +661,22 @@
|
||||
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ=="
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.6.0",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==",
|
||||
"version": "2.6.7",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"encoding": "^0.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"encoding": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/normalize-package-data": {
|
||||
@ -656,6 +711,14 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.12.2",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz",
|
||||
"integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/octokit-pagination-methods": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz",
|
||||
@ -753,9 +816,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/path-parse": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
|
||||
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
|
||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/pkg-dir": {
|
||||
@ -846,6 +909,20 @@
|
||||
"once": "^1.3.1"
|
||||
}
|
||||
},
|
||||
"node_modules/qs": {
|
||||
"version": "6.11.0",
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
|
||||
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
|
||||
"dependencies": {
|
||||
"side-channel": "^1.0.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/read-pkg": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz",
|
||||
@ -939,6 +1016,19 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/side-channel": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
|
||||
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.0",
|
||||
"get-intrinsic": "^1.0.2",
|
||||
"object-inspect": "^1.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/signal-exit": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
||||
@ -1011,10 +1101,15 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="
|
||||
},
|
||||
"node_modules/tunnel": {
|
||||
"version": "0.0.4",
|
||||
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.4.tgz",
|
||||
"integrity": "sha1-LTeFoVjBdMmhbcLARuxfxfF0IhM=",
|
||||
"version": "0.0.6",
|
||||
"resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz",
|
||||
"integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==",
|
||||
"engines": {
|
||||
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
||||
}
|
||||
@ -1029,12 +1124,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typed-rest-client": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.5.0.tgz",
|
||||
"integrity": "sha512-DVZRlmsfnTjp6ZJaatcdyvvwYwbWvR4YDNFDqb+qdTxpvaVP99YCpBkA8rxsLtAPjBVoDe4fNsnMIdZTiPuKWg==",
|
||||
"version": "1.8.9",
|
||||
"resolved": "https://registry.npmjs.org/typed-rest-client/-/typed-rest-client-1.8.9.tgz",
|
||||
"integrity": "sha512-uSmjE38B80wjL85UFX3sTYEUlvZ1JgCRhsWj/fJ4rZ0FqDUFoIuodtiVeE+cUqiVTOKPdKrp/sdftD15MDek6g==",
|
||||
"dependencies": {
|
||||
"tunnel": "0.0.4",
|
||||
"underscore": "1.8.3"
|
||||
"qs": "^6.9.1",
|
||||
"tunnel": "0.0.6",
|
||||
"underscore": "^1.12.1"
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
@ -1051,9 +1147,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/underscore": {
|
||||
"version": "1.8.3",
|
||||
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz",
|
||||
"integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI="
|
||||
"version": "1.13.4",
|
||||
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.4.tgz",
|
||||
"integrity": "sha512-BQFnUDuAQ4Yf/cYY5LNrK9NCJFKriaRbD9uR1fTeXnBeoa97W0i41qkZfGO9pSo8I5KzjAcSY2XYtdf0oKd7KQ=="
|
||||
},
|
||||
"node_modules/universal-user-agent": {
|
||||
"version": "2.1.0",
|
||||
@ -1081,6 +1177,20 @@
|
||||
"spdx-expression-parse": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="
|
||||
},
|
||||
"node_modules/whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==",
|
||||
"dependencies": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/which": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||
|
22
node_modules/@actions/http-client/node_modules/tunnel/CHANGELOG.md
generated
vendored
22
node_modules/@actions/http-client/node_modules/tunnel/CHANGELOG.md
generated
vendored
@ -1,22 +0,0 @@
|
||||
# Changelog
|
||||
|
||||
- 0.0.6 (2018/09/11)
|
||||
- Fix `localAddress` not working (#25)
|
||||
- Fix `Host:` header for CONNECT method by @tmurakam (#29, #30)
|
||||
- Fix default port for https (#32)
|
||||
- Fix error handling when the proxy send illegal response body (#33)
|
||||
|
||||
- 0.0.5 (2017/06/12)
|
||||
- Fix socket leak.
|
||||
|
||||
- 0.0.4 (2016/01/23)
|
||||
- supported Node v0.12 or later.
|
||||
|
||||
- 0.0.3 (2014/01/20)
|
||||
- fixed package.json
|
||||
|
||||
- 0.0.1 (2012/02/18)
|
||||
- supported Node v0.6.x (0.6.11 or later).
|
||||
|
||||
- 0.0.0 (2012/02/11)
|
||||
- first release.
|
185
node_modules/@actions/http-client/node_modules/tunnel/README.md
generated
vendored
185
node_modules/@actions/http-client/node_modules/tunnel/README.md
generated
vendored
@ -1,185 +0,0 @@
|
||||
# node-tunnel - HTTP/HTTPS Agents for tunneling proxies
|
||||
|
||||
[![Build Status](https://img.shields.io/travis/koichik/node-tunnel.svg?style=flat)](https://travis-ci.org/koichik/node-tunnel)
|
||||
[![Dependency Status](http://img.shields.io/david/koichik/node-tunnel.svg?style=flat)](https://david-dm.org/koichik/node-tunnel#info=dependencies)
|
||||
[![DevDependency Status](http://img.shields.io/david/dev/koichik/node-tunnel.svg?style=flat)](https://david-dm.org/koichik/node-tunnel#info=devDependencies)
|
||||
|
||||
## Example
|
||||
|
||||
```javascript
|
||||
var tunnel = require('tunnel');
|
||||
|
||||
var tunnelingAgent = tunnel.httpsOverHttp({
|
||||
proxy: {
|
||||
host: 'localhost',
|
||||
port: 3128
|
||||
}
|
||||
});
|
||||
|
||||
var req = https.request({
|
||||
host: 'example.com',
|
||||
port: 443,
|
||||
agent: tunnelingAgent
|
||||
});
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
$ npm install tunnel
|
||||
|
||||
## Usages
|
||||
|
||||
### HTTP over HTTP tunneling
|
||||
|
||||
```javascript
|
||||
var tunnelingAgent = tunnel.httpOverHttp({
|
||||
maxSockets: poolSize, // Defaults to http.Agent.defaultMaxSockets
|
||||
|
||||
proxy: { // Proxy settings
|
||||
host: proxyHost, // Defaults to 'localhost'
|
||||
port: proxyPort, // Defaults to 80
|
||||
localAddress: localAddress, // Local interface if necessary
|
||||
|
||||
// Basic authorization for proxy server if necessary
|
||||
proxyAuth: 'user:password',
|
||||
|
||||
// Header fields for proxy server if necessary
|
||||
headers: {
|
||||
'User-Agent': 'Node'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var req = http.request({
|
||||
host: 'example.com',
|
||||
port: 80,
|
||||
agent: tunnelingAgent
|
||||
});
|
||||
```
|
||||
|
||||
### HTTPS over HTTP tunneling
|
||||
|
||||
```javascript
|
||||
var tunnelingAgent = tunnel.httpsOverHttp({
|
||||
maxSockets: poolSize, // Defaults to http.Agent.defaultMaxSockets
|
||||
|
||||
// CA for origin server if necessary
|
||||
ca: [ fs.readFileSync('origin-server-ca.pem')],
|
||||
|
||||
// Client certification for origin server if necessary
|
||||
key: fs.readFileSync('origin-server-key.pem'),
|
||||
cert: fs.readFileSync('origin-server-cert.pem'),
|
||||
|
||||
proxy: { // Proxy settings
|
||||
host: proxyHost, // Defaults to 'localhost'
|
||||
port: proxyPort, // Defaults to 80
|
||||
localAddress: localAddress, // Local interface if necessary
|
||||
|
||||
// Basic authorization for proxy server if necessary
|
||||
proxyAuth: 'user:password',
|
||||
|
||||
// Header fields for proxy server if necessary
|
||||
headers: {
|
||||
'User-Agent': 'Node'
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
var req = https.request({
|
||||
host: 'example.com',
|
||||
port: 443,
|
||||
agent: tunnelingAgent
|
||||
});
|
||||
```
|
||||
|
||||
### HTTP over HTTPS tunneling
|
||||
|
||||
```javascript
|
||||
var tunnelingAgent = tunnel.httpOverHttps({
|
||||
maxSockets: poolSize, // Defaults to http.Agent.defaultMaxSockets
|
||||
|
||||
proxy: { // Proxy settings
|
||||
host: proxyHost, // Defaults to 'localhost'
|
||||
port: proxyPort, // Defaults to 443
|
||||
localAddress: localAddress, // Local interface if necessary
|
||||
|
||||
// Basic authorization for proxy server if necessary
|
||||
proxyAuth: 'user:password',
|
||||
|
||||
// Header fields for proxy server if necessary
|
||||
headers: {
|
||||
'User-Agent': 'Node'
|
||||
},
|
||||
|
||||
// CA for proxy server if necessary
|
||||
ca: [ fs.readFileSync('origin-server-ca.pem')],
|
||||
|
||||
// Server name for verification if necessary
|
||||
servername: 'example.com',
|
||||
|
||||
// Client certification for proxy server if necessary
|
||||
key: fs.readFileSync('origin-server-key.pem'),
|
||||
cert: fs.readFileSync('origin-server-cert.pem'),
|
||||
}
|
||||
});
|
||||
|
||||
var req = http.request({
|
||||
host: 'example.com',
|
||||
port: 80,
|
||||
agent: tunnelingAgent
|
||||
});
|
||||
```
|
||||
|
||||
### HTTPS over HTTPS tunneling
|
||||
|
||||
```javascript
|
||||
var tunnelingAgent = tunnel.httpsOverHttps({
|
||||
maxSockets: poolSize, // Defaults to http.Agent.defaultMaxSockets
|
||||
|
||||
// CA for origin server if necessary
|
||||
ca: [ fs.readFileSync('origin-server-ca.pem')],
|
||||
|
||||
// Client certification for origin server if necessary
|
||||
key: fs.readFileSync('origin-server-key.pem'),
|
||||
cert: fs.readFileSync('origin-server-cert.pem'),
|
||||
|
||||
proxy: { // Proxy settings
|
||||
host: proxyHost, // Defaults to 'localhost'
|
||||
port: proxyPort, // Defaults to 443
|
||||
localAddress: localAddress, // Local interface if necessary
|
||||
|
||||
// Basic authorization for proxy server if necessary
|
||||
proxyAuth: 'user:password',
|
||||
|
||||
// Header fields for proxy server if necessary
|
||||
headers: {
|
||||
'User-Agent': 'Node'
|
||||
}
|
||||
|
||||
// CA for proxy server if necessary
|
||||
ca: [ fs.readFileSync('origin-server-ca.pem')],
|
||||
|
||||
// Server name for verification if necessary
|
||||
servername: 'example.com',
|
||||
|
||||
// Client certification for proxy server if necessary
|
||||
key: fs.readFileSync('origin-server-key.pem'),
|
||||
cert: fs.readFileSync('origin-server-cert.pem'),
|
||||
}
|
||||
});
|
||||
|
||||
var req = https.request({
|
||||
host: 'example.com',
|
||||
port: 443,
|
||||
agent: tunnelingAgent
|
||||
});
|
||||
```
|
||||
|
||||
## CONTRIBUTORS
|
||||
* [Aleksis Brezas (abresas)](https://github.com/abresas)
|
||||
* [Jackson Tian (JacksonTian)](https://github.com/JacksonTian)
|
||||
* [Dmitry Sorin (1999)](https://github.com/1999)
|
||||
|
||||
## License
|
||||
|
||||
Licensed under the [MIT](https://github.com/koichik/node-tunnel/blob/master/LICENSE) license.
|
1
node_modules/@actions/http-client/node_modules/tunnel/index.js
generated
vendored
1
node_modules/@actions/http-client/node_modules/tunnel/index.js
generated
vendored
@ -1 +0,0 @@
|
||||
module.exports = require('./lib/tunnel');
|
264
node_modules/@actions/http-client/node_modules/tunnel/lib/tunnel.js
generated
vendored
264
node_modules/@actions/http-client/node_modules/tunnel/lib/tunnel.js
generated
vendored
@ -1,264 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
var net = require('net');
|
||||
var tls = require('tls');
|
||||
var http = require('http');
|
||||
var https = require('https');
|
||||
var events = require('events');
|
||||
var assert = require('assert');
|
||||
var util = require('util');
|
||||
|
||||
|
||||
exports.httpOverHttp = httpOverHttp;
|
||||
exports.httpsOverHttp = httpsOverHttp;
|
||||
exports.httpOverHttps = httpOverHttps;
|
||||
exports.httpsOverHttps = httpsOverHttps;
|
||||
|
||||
|
||||
function httpOverHttp(options) {
|
||||
var agent = new TunnelingAgent(options);
|
||||
agent.request = http.request;
|
||||
return agent;
|
||||
}
|
||||
|
||||
function httpsOverHttp(options) {
|
||||
var agent = new TunnelingAgent(options);
|
||||
agent.request = http.request;
|
||||
agent.createSocket = createSecureSocket;
|
||||
agent.defaultPort = 443;
|
||||
return agent;
|
||||
}
|
||||
|
||||
function httpOverHttps(options) {
|
||||
var agent = new TunnelingAgent(options);
|
||||
agent.request = https.request;
|
||||
return agent;
|
||||
}
|
||||
|
||||
function httpsOverHttps(options) {
|
||||
var agent = new TunnelingAgent(options);
|
||||
agent.request = https.request;
|
||||
agent.createSocket = createSecureSocket;
|
||||
agent.defaultPort = 443;
|
||||
return agent;
|
||||
}
|
||||
|
||||
|
||||
function TunnelingAgent(options) {
|
||||
var self = this;
|
||||
self.options = options || {};
|
||||
self.proxyOptions = self.options.proxy || {};
|
||||
self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
|
||||
self.requests = [];
|
||||
self.sockets = [];
|
||||
|
||||
self.on('free', function onFree(socket, host, port, localAddress) {
|
||||
var options = toOptions(host, port, localAddress);
|
||||
for (var i = 0, len = self.requests.length; i < len; ++i) {
|
||||
var pending = self.requests[i];
|
||||
if (pending.host === options.host && pending.port === options.port) {
|
||||
// Detect the request to connect same origin server,
|
||||
// reuse the connection.
|
||||
self.requests.splice(i, 1);
|
||||
pending.request.onSocket(socket);
|
||||
return;
|
||||
}
|
||||
}
|
||||
socket.destroy();
|
||||
self.removeSocket(socket);
|
||||
});
|
||||
}
|
||||
util.inherits(TunnelingAgent, events.EventEmitter);
|
||||
|
||||
TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
|
||||
var self = this;
|
||||
var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
|
||||
|
||||
if (self.sockets.length >= this.maxSockets) {
|
||||
// We are over limit so we'll add it to the queue.
|
||||
self.requests.push(options);
|
||||
return;
|
||||
}
|
||||
|
||||
// If we are under maxSockets create a new one.
|
||||
self.createSocket(options, function(socket) {
|
||||
socket.on('free', onFree);
|
||||
socket.on('close', onCloseOrRemove);
|
||||
socket.on('agentRemove', onCloseOrRemove);
|
||||
req.onSocket(socket);
|
||||
|
||||
function onFree() {
|
||||
self.emit('free', socket, options);
|
||||
}
|
||||
|
||||
function onCloseOrRemove(err) {
|
||||
self.removeSocket(socket);
|
||||
socket.removeListener('free', onFree);
|
||||
socket.removeListener('close', onCloseOrRemove);
|
||||
socket.removeListener('agentRemove', onCloseOrRemove);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
|
||||
var self = this;
|
||||
var placeholder = {};
|
||||
self.sockets.push(placeholder);
|
||||
|
||||
var connectOptions = mergeOptions({}, self.proxyOptions, {
|
||||
method: 'CONNECT',
|
||||
path: options.host + ':' + options.port,
|
||||
agent: false,
|
||||
headers: {
|
||||
host: options.host + ':' + options.port
|
||||
}
|
||||
});
|
||||
if (options.localAddress) {
|
||||
connectOptions.localAddress = options.localAddress;
|
||||
}
|
||||
if (connectOptions.proxyAuth) {
|
||||
connectOptions.headers = connectOptions.headers || {};
|
||||
connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
|
||||
new Buffer(connectOptions.proxyAuth).toString('base64');
|
||||
}
|
||||
|
||||
debug('making CONNECT request');
|
||||
var connectReq = self.request(connectOptions);
|
||||
connectReq.useChunkedEncodingByDefault = false; // for v0.6
|
||||
connectReq.once('response', onResponse); // for v0.6
|
||||
connectReq.once('upgrade', onUpgrade); // for v0.6
|
||||
connectReq.once('connect', onConnect); // for v0.7 or later
|
||||
connectReq.once('error', onError);
|
||||
connectReq.end();
|
||||
|
||||
function onResponse(res) {
|
||||
// Very hacky. This is necessary to avoid http-parser leaks.
|
||||
res.upgrade = true;
|
||||
}
|
||||
|
||||
function onUpgrade(res, socket, head) {
|
||||
// Hacky.
|
||||
process.nextTick(function() {
|
||||
onConnect(res, socket, head);
|
||||
});
|
||||
}
|
||||
|
||||
function onConnect(res, socket, head) {
|
||||
connectReq.removeAllListeners();
|
||||
socket.removeAllListeners();
|
||||
|
||||
if (res.statusCode !== 200) {
|
||||
debug('tunneling socket could not be established, statusCode=%d',
|
||||
res.statusCode);
|
||||
socket.destroy();
|
||||
var error = new Error('tunneling socket could not be established, ' +
|
||||
'statusCode=' + res.statusCode);
|
||||
error.code = 'ECONNRESET';
|
||||
options.request.emit('error', error);
|
||||
self.removeSocket(placeholder);
|
||||
return;
|
||||
}
|
||||
if (head.length > 0) {
|
||||
debug('got illegal response body from proxy');
|
||||
socket.destroy();
|
||||
var error = new Error('got illegal response body from proxy');
|
||||
error.code = 'ECONNRESET';
|
||||
options.request.emit('error', error);
|
||||
self.removeSocket(placeholder);
|
||||
return;
|
||||
}
|
||||
debug('tunneling connection has established');
|
||||
self.sockets[self.sockets.indexOf(placeholder)] = socket;
|
||||
return cb(socket);
|
||||
}
|
||||
|
||||
function onError(cause) {
|
||||
connectReq.removeAllListeners();
|
||||
|
||||
debug('tunneling socket could not be established, cause=%s\n',
|
||||
cause.message, cause.stack);
|
||||
var error = new Error('tunneling socket could not be established, ' +
|
||||
'cause=' + cause.message);
|
||||
error.code = 'ECONNRESET';
|
||||
options.request.emit('error', error);
|
||||
self.removeSocket(placeholder);
|
||||
}
|
||||
};
|
||||
|
||||
TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
|
||||
var pos = this.sockets.indexOf(socket)
|
||||
if (pos === -1) {
|
||||
return;
|
||||
}
|
||||
this.sockets.splice(pos, 1);
|
||||
|
||||
var pending = this.requests.shift();
|
||||
if (pending) {
|
||||
// If we have pending requests and a socket gets closed a new one
|
||||
// needs to be created to take over in the pool for the one that closed.
|
||||
this.createSocket(pending, function(socket) {
|
||||
pending.request.onSocket(socket);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
function createSecureSocket(options, cb) {
|
||||
var self = this;
|
||||
TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
|
||||
var hostHeader = options.request.getHeader('host');
|
||||
var tlsOptions = mergeOptions({}, self.options, {
|
||||
socket: socket,
|
||||
servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
|
||||
});
|
||||
|
||||
// 0 is dummy port for v0.6
|
||||
var secureSocket = tls.connect(0, tlsOptions);
|
||||
self.sockets[self.sockets.indexOf(socket)] = secureSocket;
|
||||
cb(secureSocket);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function toOptions(host, port, localAddress) {
|
||||
if (typeof host === 'string') { // since v0.10
|
||||
return {
|
||||
host: host,
|
||||
port: port,
|
||||
localAddress: localAddress
|
||||
};
|
||||
}
|
||||
return host; // for v0.11 or later
|
||||
}
|
||||
|
||||
function mergeOptions(target) {
|
||||
for (var i = 1, len = arguments.length; i < len; ++i) {
|
||||
var overrides = arguments[i];
|
||||
if (typeof overrides === 'object') {
|
||||
var keys = Object.keys(overrides);
|
||||
for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
|
||||
var k = keys[j];
|
||||
if (overrides[k] !== undefined) {
|
||||
target[k] = overrides[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
|
||||
var debug;
|
||||
if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
|
||||
debug = function() {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
if (typeof args[0] === 'string') {
|
||||
args[0] = 'TUNNEL: ' + args[0];
|
||||
} else {
|
||||
args.unshift('TUNNEL:');
|
||||
}
|
||||
console.error.apply(console, args);
|
||||
}
|
||||
} else {
|
||||
debug = function() {};
|
||||
}
|
||||
exports.debug = debug; // for test
|
34
node_modules/@actions/http-client/node_modules/tunnel/package.json
generated
vendored
34
node_modules/@actions/http-client/node_modules/tunnel/package.json
generated
vendored
@ -1,34 +0,0 @@
|
||||
{
|
||||
"name": "tunnel",
|
||||
"version": "0.0.6",
|
||||
"description": "Node HTTP/HTTPS Agents for tunneling proxies",
|
||||
"keywords": [
|
||||
"http",
|
||||
"https",
|
||||
"agent",
|
||||
"proxy",
|
||||
"tunnel"
|
||||
],
|
||||
"homepage": "https://github.com/koichik/node-tunnel/",
|
||||
"bugs": "https://github.com/koichik/node-tunnel/issues",
|
||||
"license": "MIT",
|
||||
"author": "Koichi Kobayashi <koichik@improvement.jp>",
|
||||
"main": "./index.js",
|
||||
"directories": {
|
||||
"lib": "./lib"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/koichik/node-tunnel.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "^5.2.0",
|
||||
"should": "^13.2.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
||||
}
|
||||
}
|
1
node_modules/call-bind/.eslintignore
generated
vendored
Normal file
1
node_modules/call-bind/.eslintignore
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
coverage/
|
17
node_modules/call-bind/.eslintrc
generated
vendored
Normal file
17
node_modules/call-bind/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"func-name-matching": 0,
|
||||
"id-length": 0,
|
||||
"new-cap": [2, {
|
||||
"capIsNewExceptions": [
|
||||
"GetIntrinsic",
|
||||
],
|
||||
}],
|
||||
"no-magic-numbers": 0,
|
||||
"operator-linebreak": [2, "before"],
|
||||
},
|
||||
}
|
12
node_modules/call-bind/.github/FUNDING.yml
generated
vendored
Normal file
12
node_modules/call-bind/.github/FUNDING.yml
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [ljharb]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: npm/call-bind
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
13
node_modules/call-bind/.nycrc
generated
vendored
Normal file
13
node_modules/call-bind/.nycrc
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"all": true,
|
||||
"check-coverage": false,
|
||||
"reporter": ["text-summary", "text", "html", "json"],
|
||||
"lines": 86,
|
||||
"statements": 85.93,
|
||||
"functions": 82.43,
|
||||
"branches": 76.06,
|
||||
"exclude": [
|
||||
"coverage",
|
||||
"test"
|
||||
]
|
||||
}
|
42
node_modules/call-bind/CHANGELOG.md
generated
vendored
Normal file
42
node_modules/call-bind/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v1.0.2](https://github.com/ljharb/call-bind/compare/v1.0.1...v1.0.2) - 2021-01-11
|
||||
|
||||
### Commits
|
||||
|
||||
- [Fix] properly include the receiver in the bound length [`dbae7bc`](https://github.com/ljharb/call-bind/commit/dbae7bc676c079a0d33c0a43e9ef92cb7b01345d)
|
||||
|
||||
## [v1.0.1](https://github.com/ljharb/call-bind/compare/v1.0.0...v1.0.1) - 2021-01-08
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] migrate tests to Github Actions [`b6db284`](https://github.com/ljharb/call-bind/commit/b6db284c36f8ccd195b88a6764fe84b7223a0da1)
|
||||
- [meta] do not publish github action workflow files [`ec7fe46`](https://github.com/ljharb/call-bind/commit/ec7fe46e60cfa4764ee943d2755f5e5a366e578e)
|
||||
- [Fix] preserve original function’s length when possible [`adbceaa`](https://github.com/ljharb/call-bind/commit/adbceaa3cac4b41ea78bb19d7ccdbaaf7e0bdadb)
|
||||
- [Tests] gather coverage data on every job [`d69e23c`](https://github.com/ljharb/call-bind/commit/d69e23cc65f101ba1d4c19bb07fa8eb0ec624be8)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`2fd3586`](https://github.com/ljharb/call-bind/commit/2fd3586c5d47b335364c14293114c6b625ae1f71)
|
||||
- [Deps] update `get-intrinsic` [`f23e931`](https://github.com/ljharb/call-bind/commit/f23e9318cc271c2add8bb38cfded85ee7baf8eee)
|
||||
- [Deps] update `get-intrinsic` [`72d9f44`](https://github.com/ljharb/call-bind/commit/72d9f44e184465ba8dd3fb48260bbcff234985f2)
|
||||
- [meta] fix FUNDING.yml [`e723573`](https://github.com/ljharb/call-bind/commit/e723573438c5a68dcec31fb5d96ea6b7e4a93be8)
|
||||
- [eslint] ignore coverage output [`15e76d2`](https://github.com/ljharb/call-bind/commit/15e76d28a5f43e504696401e5b31ebb78ee1b532)
|
||||
- [meta] add Automatic Rebase and Require Allow Edits workflows [`8fa4dab`](https://github.com/ljharb/call-bind/commit/8fa4dabb23ba3dd7bb92c9571c1241c08b56e4b6)
|
||||
|
||||
## v1.0.0 - 2020-10-30
|
||||
|
||||
### Commits
|
||||
|
||||
- Initial commit [`306cf98`](https://github.com/ljharb/call-bind/commit/306cf98c7ec9e7ef66b653ec152277ac1381eb50)
|
||||
- Tests [`e10d0bb`](https://github.com/ljharb/call-bind/commit/e10d0bbdadc7a10ecedc9a1c035112d3e368b8df)
|
||||
- Implementation [`43852ed`](https://github.com/ljharb/call-bind/commit/43852eda0f187327b7fad2423ca972149a52bd65)
|
||||
- npm init [`408f860`](https://github.com/ljharb/call-bind/commit/408f860b773a2f610805fd3613d0d71bac1b6249)
|
||||
- [meta] add Automatic Rebase and Require Allow Edits workflows [`fb349b2`](https://github.com/ljharb/call-bind/commit/fb349b2e48defbec8b5ec8a8395cc8f69f220b13)
|
||||
- [meta] add `auto-changelog` [`c4001fc`](https://github.com/ljharb/call-bind/commit/c4001fc43031799ef908211c98d3b0fb2b60fde4)
|
||||
- [meta] add "funding"; create `FUNDING.yml` [`d4d6d29`](https://github.com/ljharb/call-bind/commit/d4d6d2974a14bc2e98830468eda7fe6d6a776717)
|
||||
- [Tests] add `npm run lint` [`dedfb98`](https://github.com/ljharb/call-bind/commit/dedfb98bd0ecefb08ddb9a94061bd10cde4332af)
|
||||
- Only apps should have lockfiles [`54ac776`](https://github.com/ljharb/call-bind/commit/54ac77653db45a7361dc153d2f478e743f110650)
|
||||
- [meta] add `safe-publish-latest` [`9ea8e43`](https://github.com/ljharb/call-bind/commit/9ea8e435b950ce9b705559cd651039f9bf40140f)
|
21
node_modules/call-bind/LICENSE
generated
vendored
Normal file
21
node_modules/call-bind/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Jordan Harband
|
||||
|
||||
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.
|
2
node_modules/call-bind/README.md
generated
vendored
Normal file
2
node_modules/call-bind/README.md
generated
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
# call-bind
|
||||
Robustly `.call.bind()` a function.
|
15
node_modules/call-bind/callBound.js
generated
vendored
Normal file
15
node_modules/call-bind/callBound.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var callBind = require('./');
|
||||
|
||||
var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
|
||||
|
||||
module.exports = function callBoundIntrinsic(name, allowMissing) {
|
||||
var intrinsic = GetIntrinsic(name, !!allowMissing);
|
||||
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
||||
return callBind(intrinsic);
|
||||
}
|
||||
return intrinsic;
|
||||
};
|
47
node_modules/call-bind/index.js
generated
vendored
Normal file
47
node_modules/call-bind/index.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
'use strict';
|
||||
|
||||
var bind = require('function-bind');
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $apply = GetIntrinsic('%Function.prototype.apply%');
|
||||
var $call = GetIntrinsic('%Function.prototype.call%');
|
||||
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
|
||||
|
||||
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
||||
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
|
||||
var $max = GetIntrinsic('%Math.max%');
|
||||
|
||||
if ($defineProperty) {
|
||||
try {
|
||||
$defineProperty({}, 'a', { value: 1 });
|
||||
} catch (e) {
|
||||
// IE 8 has a broken defineProperty
|
||||
$defineProperty = null;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = function callBind(originalFunction) {
|
||||
var func = $reflectApply(bind, $call, arguments);
|
||||
if ($gOPD && $defineProperty) {
|
||||
var desc = $gOPD(func, 'length');
|
||||
if (desc.configurable) {
|
||||
// original length, plus the receiver, minus any additional arguments (after the receiver)
|
||||
$defineProperty(
|
||||
func,
|
||||
'length',
|
||||
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
|
||||
);
|
||||
}
|
||||
}
|
||||
return func;
|
||||
};
|
||||
|
||||
var applyBind = function applyBind() {
|
||||
return $reflectApply(bind, $apply, arguments);
|
||||
};
|
||||
|
||||
if ($defineProperty) {
|
||||
$defineProperty(module.exports, 'apply', { value: applyBind });
|
||||
} else {
|
||||
module.exports.apply = applyBind;
|
||||
}
|
80
node_modules/call-bind/package.json
generated
vendored
Normal file
80
node_modules/call-bind/package.json
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
{
|
||||
"name": "call-bind",
|
||||
"version": "1.0.2",
|
||||
"description": "Robustly `.call.bind()` a function",
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
".": [
|
||||
{
|
||||
"default": "./index.js"
|
||||
},
|
||||
"./index.js"
|
||||
],
|
||||
"./callBound": [
|
||||
{
|
||||
"default": "./callBound.js"
|
||||
},
|
||||
"./callBound.js"
|
||||
],
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"scripts": {
|
||||
"prepublish": "safe-publish-latest",
|
||||
"lint": "eslint --ext=.js,.mjs .",
|
||||
"pretest": "npm run lint",
|
||||
"tests-only": "nyc tape 'test/*'",
|
||||
"test": "npm run tests-only",
|
||||
"posttest": "aud --production",
|
||||
"version": "auto-changelog && git add CHANGELOG.md",
|
||||
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ljharb/call-bind.git"
|
||||
},
|
||||
"keywords": [
|
||||
"javascript",
|
||||
"ecmascript",
|
||||
"es",
|
||||
"js",
|
||||
"callbind",
|
||||
"callbound",
|
||||
"call",
|
||||
"bind",
|
||||
"bound",
|
||||
"call-bind",
|
||||
"call-bound",
|
||||
"function",
|
||||
"es-abstract"
|
||||
],
|
||||
"author": "Jordan Harband <ljharb@gmail.com>",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ljharb/call-bind/issues"
|
||||
},
|
||||
"homepage": "https://github.com/ljharb/call-bind#readme",
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^17.3.0",
|
||||
"aud": "^1.1.3",
|
||||
"auto-changelog": "^2.2.1",
|
||||
"eslint": "^7.17.0",
|
||||
"nyc": "^10.3.2",
|
||||
"safe-publish-latest": "^1.1.4",
|
||||
"tape": "^5.1.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.1",
|
||||
"get-intrinsic": "^1.0.2"
|
||||
},
|
||||
"auto-changelog": {
|
||||
"output": "CHANGELOG.md",
|
||||
"template": "keepachangelog",
|
||||
"unreleased": false,
|
||||
"commitLimit": false,
|
||||
"backfillLimit": false,
|
||||
"hideCredit": true
|
||||
}
|
||||
}
|
55
node_modules/call-bind/test/callBound.js
generated
vendored
Normal file
55
node_modules/call-bind/test/callBound.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
|
||||
var callBound = require('../callBound');
|
||||
|
||||
test('callBound', function (t) {
|
||||
// static primitive
|
||||
t.equal(callBound('Array.length'), Array.length, 'Array.length yields itself');
|
||||
t.equal(callBound('%Array.length%'), Array.length, '%Array.length% yields itself');
|
||||
|
||||
// static non-function object
|
||||
t.equal(callBound('Array.prototype'), Array.prototype, 'Array.prototype yields itself');
|
||||
t.equal(callBound('%Array.prototype%'), Array.prototype, '%Array.prototype% yields itself');
|
||||
t.equal(callBound('Array.constructor'), Array.constructor, 'Array.constructor yields itself');
|
||||
t.equal(callBound('%Array.constructor%'), Array.constructor, '%Array.constructor% yields itself');
|
||||
|
||||
// static function
|
||||
t.equal(callBound('Date.parse'), Date.parse, 'Date.parse yields itself');
|
||||
t.equal(callBound('%Date.parse%'), Date.parse, '%Date.parse% yields itself');
|
||||
|
||||
// prototype primitive
|
||||
t.equal(callBound('Error.prototype.message'), Error.prototype.message, 'Error.prototype.message yields itself');
|
||||
t.equal(callBound('%Error.prototype.message%'), Error.prototype.message, '%Error.prototype.message% yields itself');
|
||||
|
||||
// prototype function
|
||||
t.notEqual(callBound('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString does not yield itself');
|
||||
t.notEqual(callBound('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% does not yield itself');
|
||||
t.equal(callBound('Object.prototype.toString')(true), Object.prototype.toString.call(true), 'call-bound Object.prototype.toString calls into the original');
|
||||
t.equal(callBound('%Object.prototype.toString%')(true), Object.prototype.toString.call(true), 'call-bound %Object.prototype.toString% calls into the original');
|
||||
|
||||
t['throws'](
|
||||
function () { callBound('does not exist'); },
|
||||
SyntaxError,
|
||||
'nonexistent intrinsic throws'
|
||||
);
|
||||
t['throws'](
|
||||
function () { callBound('does not exist', true); },
|
||||
SyntaxError,
|
||||
'allowMissing arg still throws for unknown intrinsic'
|
||||
);
|
||||
|
||||
/* globals WeakRef: false */
|
||||
t.test('real but absent intrinsic', { skip: typeof WeakRef !== 'undefined' }, function (st) {
|
||||
st['throws'](
|
||||
function () { callBound('WeakRef'); },
|
||||
TypeError,
|
||||
'real but absent intrinsic throws'
|
||||
);
|
||||
st.equal(callBound('WeakRef', true), undefined, 'allowMissing arg avoids exception');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
66
node_modules/call-bind/test/index.js
generated
vendored
Normal file
66
node_modules/call-bind/test/index.js
generated
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
'use strict';
|
||||
|
||||
var callBind = require('../');
|
||||
var bind = require('function-bind');
|
||||
|
||||
var test = require('tape');
|
||||
|
||||
/*
|
||||
* older engines have length nonconfigurable
|
||||
* in io.js v3, it is configurable except on bound functions, hence the .bind()
|
||||
*/
|
||||
var functionsHaveConfigurableLengths = !!(
|
||||
Object.getOwnPropertyDescriptor
|
||||
&& Object.getOwnPropertyDescriptor(bind.call(function () {}), 'length').configurable
|
||||
);
|
||||
|
||||
test('callBind', function (t) {
|
||||
var sentinel = { sentinel: true };
|
||||
var func = function (a, b) {
|
||||
// eslint-disable-next-line no-invalid-this
|
||||
return [this, a, b];
|
||||
};
|
||||
t.equal(func.length, 2, 'original function length is 2');
|
||||
t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args');
|
||||
t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args');
|
||||
t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args');
|
||||
|
||||
var bound = callBind(func);
|
||||
t.equal(bound.length, func.length + 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths });
|
||||
t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with too few args');
|
||||
t.deepEqual(bound(1, 2), [1, 2, undefined], 'bound func with right args');
|
||||
t.deepEqual(bound(1, 2, 3), [1, 2, 3], 'bound func with too many args');
|
||||
|
||||
var boundR = callBind(func, sentinel);
|
||||
t.equal(boundR.length, func.length, 'function length is preserved', { skip: !functionsHaveConfigurableLengths });
|
||||
t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args');
|
||||
t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args');
|
||||
t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args');
|
||||
|
||||
var boundArg = callBind(func, sentinel, 1);
|
||||
t.equal(boundArg.length, func.length - 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths });
|
||||
t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args');
|
||||
t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg');
|
||||
t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args');
|
||||
|
||||
t.test('callBind.apply', function (st) {
|
||||
var aBound = callBind.apply(func);
|
||||
st.deepEqual(aBound(sentinel), [sentinel, undefined, undefined], 'apply-bound func with no args');
|
||||
st.deepEqual(aBound(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args');
|
||||
st.deepEqual(aBound(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args');
|
||||
|
||||
var aBoundArg = callBind.apply(func);
|
||||
st.deepEqual(aBoundArg(sentinel, [1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with too many args');
|
||||
st.deepEqual(aBoundArg(sentinel, [1, 2], 4), [sentinel, 1, 2], 'apply-bound func with right args');
|
||||
st.deepEqual(aBoundArg(sentinel, [1], 4), [sentinel, 1, undefined], 'apply-bound func with too few args');
|
||||
|
||||
var aBoundR = callBind.apply(func, sentinel);
|
||||
st.deepEqual(aBoundR([1, 2, 3], 4), [sentinel, 1, 2], 'apply-bound func with receiver and too many args');
|
||||
st.deepEqual(aBoundR([1, 2], 4), [sentinel, 1, 2], 'apply-bound func with receiver and right args');
|
||||
st.deepEqual(aBoundR([1], 4), [sentinel, 1, undefined], 'apply-bound func with receiver and too few args');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
20
node_modules/function-bind/.editorconfig
generated
vendored
Normal file
20
node_modules/function-bind/.editorconfig
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
max_line_length = 120
|
||||
|
||||
[CHANGELOG.md]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.json]
|
||||
max_line_length = off
|
||||
|
||||
[Makefile]
|
||||
max_line_length = off
|
15
node_modules/function-bind/.eslintrc
generated
vendored
Normal file
15
node_modules/function-bind/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"func-name-matching": 0,
|
||||
"indent": [2, 4],
|
||||
"max-nested-callbacks": [2, 3],
|
||||
"max-params": [2, 3],
|
||||
"max-statements": [2, 20],
|
||||
"no-new-func": [1],
|
||||
"strict": [0]
|
||||
}
|
||||
}
|
176
node_modules/function-bind/.jscs.json
generated
vendored
Normal file
176
node_modules/function-bind/.jscs.json
generated
vendored
Normal file
@ -0,0 +1,176 @@
|
||||
{
|
||||
"es3": true,
|
||||
|
||||
"additionalRules": [],
|
||||
|
||||
"requireSemicolons": true,
|
||||
|
||||
"disallowMultipleSpaces": true,
|
||||
|
||||
"disallowIdentifierNames": [],
|
||||
|
||||
"requireCurlyBraces": {
|
||||
"allExcept": [],
|
||||
"keywords": ["if", "else", "for", "while", "do", "try", "catch"]
|
||||
},
|
||||
|
||||
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"],
|
||||
|
||||
"disallowSpaceAfterKeywords": [],
|
||||
|
||||
"disallowSpaceBeforeComma": true,
|
||||
"disallowSpaceAfterComma": false,
|
||||
"disallowSpaceBeforeSemicolon": true,
|
||||
|
||||
"disallowNodeTypes": [
|
||||
"DebuggerStatement",
|
||||
"ForInStatement",
|
||||
"LabeledStatement",
|
||||
"SwitchCase",
|
||||
"SwitchStatement",
|
||||
"WithStatement"
|
||||
],
|
||||
|
||||
"requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] },
|
||||
|
||||
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true },
|
||||
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
|
||||
"disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true },
|
||||
"requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true },
|
||||
"disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true },
|
||||
|
||||
"requireSpaceBetweenArguments": true,
|
||||
|
||||
"disallowSpacesInsideParentheses": true,
|
||||
|
||||
"disallowSpacesInsideArrayBrackets": true,
|
||||
|
||||
"disallowQuotedKeysInObjects": { "allExcept": ["reserved"] },
|
||||
|
||||
"disallowSpaceAfterObjectKeys": true,
|
||||
|
||||
"requireCommaBeforeLineBreak": true,
|
||||
|
||||
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
|
||||
"requireSpaceAfterPrefixUnaryOperators": [],
|
||||
|
||||
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
|
||||
"requireSpaceBeforePostfixUnaryOperators": [],
|
||||
|
||||
"disallowSpaceBeforeBinaryOperators": [],
|
||||
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
|
||||
|
||||
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
|
||||
"disallowSpaceAfterBinaryOperators": [],
|
||||
|
||||
"disallowImplicitTypeConversion": ["binary", "string"],
|
||||
|
||||
"disallowKeywords": ["with", "eval"],
|
||||
|
||||
"requireKeywordsOnNewLine": [],
|
||||
"disallowKeywordsOnNewLine": ["else"],
|
||||
|
||||
"requireLineFeedAtFileEnd": true,
|
||||
|
||||
"disallowTrailingWhitespace": true,
|
||||
|
||||
"disallowTrailingComma": true,
|
||||
|
||||
"excludeFiles": ["node_modules/**", "vendor/**"],
|
||||
|
||||
"disallowMultipleLineStrings": true,
|
||||
|
||||
"requireDotNotation": { "allExcept": ["keywords"] },
|
||||
|
||||
"requireParenthesesAroundIIFE": true,
|
||||
|
||||
"validateLineBreaks": "LF",
|
||||
|
||||
"validateQuoteMarks": {
|
||||
"escape": true,
|
||||
"mark": "'"
|
||||
},
|
||||
|
||||
"disallowOperatorBeforeLineBreak": [],
|
||||
|
||||
"requireSpaceBeforeKeywords": [
|
||||
"do",
|
||||
"for",
|
||||
"if",
|
||||
"else",
|
||||
"switch",
|
||||
"case",
|
||||
"try",
|
||||
"catch",
|
||||
"finally",
|
||||
"while",
|
||||
"with",
|
||||
"return"
|
||||
],
|
||||
|
||||
"validateAlignedFunctionParameters": {
|
||||
"lineBreakAfterOpeningBraces": true,
|
||||
"lineBreakBeforeClosingBraces": true
|
||||
},
|
||||
|
||||
"requirePaddingNewLinesBeforeExport": true,
|
||||
|
||||
"validateNewlineAfterArrayElements": {
|
||||
"maximum": 8
|
||||
},
|
||||
|
||||
"requirePaddingNewLinesAfterUseStrict": true,
|
||||
|
||||
"disallowArrowFunctions": true,
|
||||
|
||||
"disallowMultiLineTernary": true,
|
||||
|
||||
"validateOrderInObjectKeys": "asc-insensitive",
|
||||
|
||||
"disallowIdenticalDestructuringNames": true,
|
||||
|
||||
"disallowNestedTernaries": { "maxLevel": 1 },
|
||||
|
||||
"requireSpaceAfterComma": { "allExcept": ["trailing"] },
|
||||
"requireAlignedMultilineParams": false,
|
||||
|
||||
"requireSpacesInGenerator": {
|
||||
"afterStar": true
|
||||
},
|
||||
|
||||
"disallowSpacesInGenerator": {
|
||||
"beforeStar": true
|
||||
},
|
||||
|
||||
"disallowVar": false,
|
||||
|
||||
"requireArrayDestructuring": false,
|
||||
|
||||
"requireEnhancedObjectLiterals": false,
|
||||
|
||||
"requireObjectDestructuring": false,
|
||||
|
||||
"requireEarlyReturn": false,
|
||||
|
||||
"requireCapitalizedConstructorsNew": {
|
||||
"allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"]
|
||||
},
|
||||
|
||||
"requireImportAlphabetized": false,
|
||||
|
||||
"requireSpaceBeforeObjectValues": true,
|
||||
"requireSpaceBeforeDestructuredValues": true,
|
||||
|
||||
"disallowSpacesInsideTemplateStringPlaceholders": true,
|
||||
|
||||
"disallowArrayDestructuringReturn": false,
|
||||
|
||||
"requireNewlineBeforeSingleStatementsInIf": false,
|
||||
|
||||
"disallowUnusedVariables": true,
|
||||
|
||||
"requireSpacesInsideImportedObjectBraces": true,
|
||||
|
||||
"requireUseStrict": true
|
||||
}
|
||||
|
22
node_modules/function-bind/.npmignore
generated
vendored
Normal file
22
node_modules/function-bind/.npmignore
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
# gitignore
|
||||
.DS_Store
|
||||
.monitor
|
||||
.*.swp
|
||||
.nodemonignore
|
||||
releases
|
||||
*.log
|
||||
*.err
|
||||
fleet.json
|
||||
public/browserify
|
||||
bin/*.json
|
||||
.bin
|
||||
build
|
||||
compile
|
||||
.lock-wscript
|
||||
coverage
|
||||
node_modules
|
||||
|
||||
# Only apps should have lockfiles
|
||||
npm-shrinkwrap.json
|
||||
package-lock.json
|
||||
yarn.lock
|
168
node_modules/function-bind/.travis.yml
generated
vendored
Normal file
168
node_modules/function-bind/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,168 @@
|
||||
language: node_js
|
||||
os:
|
||||
- linux
|
||||
node_js:
|
||||
- "8.4"
|
||||
- "7.10"
|
||||
- "6.11"
|
||||
- "5.12"
|
||||
- "4.8"
|
||||
- "iojs-v3.3"
|
||||
- "iojs-v2.5"
|
||||
- "iojs-v1.8"
|
||||
- "0.12"
|
||||
- "0.10"
|
||||
- "0.8"
|
||||
before_install:
|
||||
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi'
|
||||
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then if [ "${TRAVIS_NODE_VERSION%${TRAVIS_NODE_VERSION#[0-9]}}" = "0" ] || [ "${TRAVIS_NODE_VERSION:0:4}" = "iojs" ]; then npm install -g npm@4.5 ; else npm install -g npm; fi; fi'
|
||||
install:
|
||||
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g npm@1.3 && npm install -g npm@1.4.28 && npm install -g npm@2 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
|
||||
script:
|
||||
- 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi'
|
||||
- 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi'
|
||||
- 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi'
|
||||
- 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi'
|
||||
sudo: false
|
||||
env:
|
||||
- TEST=true
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- node_js: "node"
|
||||
env: PRETEST=true
|
||||
- node_js: "4"
|
||||
env: COVERAGE=true
|
||||
- node_js: "8.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.8"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.10"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.8"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.11"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.10"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.8"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v3.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v3.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v3.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v2.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v2.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v2.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v2.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v2.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "0.11"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "0.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "0.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "0.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
allow_failures:
|
||||
- os: osx
|
||||
- env: TEST=true ALLOW_FAILURE=true
|
20
node_modules/function-bind/LICENSE
generated
vendored
Normal file
20
node_modules/function-bind/LICENSE
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
Copyright (c) 2013 Raynos.
|
||||
|
||||
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.
|
||||
|
48
node_modules/function-bind/README.md
generated
vendored
Normal file
48
node_modules/function-bind/README.md
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
# function-bind
|
||||
|
||||
<!--
|
||||
[![build status][travis-svg]][travis-url]
|
||||
[![NPM version][npm-badge-svg]][npm-url]
|
||||
[![Coverage Status][5]][6]
|
||||
[![gemnasium Dependency Status][7]][8]
|
||||
[![Dependency status][deps-svg]][deps-url]
|
||||
[![Dev Dependency status][dev-deps-svg]][dev-deps-url]
|
||||
-->
|
||||
|
||||
<!-- [![browser support][11]][12] -->
|
||||
|
||||
Implementation of function.prototype.bind
|
||||
|
||||
## Example
|
||||
|
||||
I mainly do this for unit tests I run on phantomjs.
|
||||
PhantomJS does not have Function.prototype.bind :(
|
||||
|
||||
```js
|
||||
Function.prototype.bind = require("function-bind")
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
`npm install function-bind`
|
||||
|
||||
## Contributors
|
||||
|
||||
- Raynos
|
||||
|
||||
## MIT Licenced
|
||||
|
||||
[travis-svg]: https://travis-ci.org/Raynos/function-bind.svg
|
||||
[travis-url]: https://travis-ci.org/Raynos/function-bind
|
||||
[npm-badge-svg]: https://badge.fury.io/js/function-bind.svg
|
||||
[npm-url]: https://npmjs.org/package/function-bind
|
||||
[5]: https://coveralls.io/repos/Raynos/function-bind/badge.png
|
||||
[6]: https://coveralls.io/r/Raynos/function-bind
|
||||
[7]: https://gemnasium.com/Raynos/function-bind.png
|
||||
[8]: https://gemnasium.com/Raynos/function-bind
|
||||
[deps-svg]: https://david-dm.org/Raynos/function-bind.svg
|
||||
[deps-url]: https://david-dm.org/Raynos/function-bind
|
||||
[dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg
|
||||
[dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies
|
||||
[11]: https://ci.testling.com/Raynos/function-bind.png
|
||||
[12]: https://ci.testling.com/Raynos/function-bind
|
52
node_modules/function-bind/implementation.js
generated
vendored
Normal file
52
node_modules/function-bind/implementation.js
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
'use strict';
|
||||
|
||||
/* eslint no-invalid-this: 1 */
|
||||
|
||||
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
||||
var slice = Array.prototype.slice;
|
||||
var toStr = Object.prototype.toString;
|
||||
var funcType = '[object Function]';
|
||||
|
||||
module.exports = function bind(that) {
|
||||
var target = this;
|
||||
if (typeof target !== 'function' || toStr.call(target) !== funcType) {
|
||||
throw new TypeError(ERROR_MESSAGE + target);
|
||||
}
|
||||
var args = slice.call(arguments, 1);
|
||||
|
||||
var bound;
|
||||
var binder = function () {
|
||||
if (this instanceof bound) {
|
||||
var result = target.apply(
|
||||
this,
|
||||
args.concat(slice.call(arguments))
|
||||
);
|
||||
if (Object(result) === result) {
|
||||
return result;
|
||||
}
|
||||
return this;
|
||||
} else {
|
||||
return target.apply(
|
||||
that,
|
||||
args.concat(slice.call(arguments))
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
var boundLength = Math.max(0, target.length - args.length);
|
||||
var boundArgs = [];
|
||||
for (var i = 0; i < boundLength; i++) {
|
||||
boundArgs.push('$' + i);
|
||||
}
|
||||
|
||||
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
|
||||
|
||||
if (target.prototype) {
|
||||
var Empty = function Empty() {};
|
||||
Empty.prototype = target.prototype;
|
||||
bound.prototype = new Empty();
|
||||
Empty.prototype = null;
|
||||
}
|
||||
|
||||
return bound;
|
||||
};
|
5
node_modules/function-bind/index.js
generated
vendored
Normal file
5
node_modules/function-bind/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
var implementation = require('./implementation');
|
||||
|
||||
module.exports = Function.prototype.bind || implementation;
|
63
node_modules/function-bind/package.json
generated
vendored
Normal file
63
node_modules/function-bind/package.json
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
{
|
||||
"name": "function-bind",
|
||||
"version": "1.1.1",
|
||||
"description": "Implementation of Function.prototype.bind",
|
||||
"keywords": [
|
||||
"function",
|
||||
"bind",
|
||||
"shim",
|
||||
"es5"
|
||||
],
|
||||
"author": "Raynos <raynos2@gmail.com>",
|
||||
"repository": "git://github.com/Raynos/function-bind.git",
|
||||
"main": "index",
|
||||
"homepage": "https://github.com/Raynos/function-bind",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Raynos"
|
||||
},
|
||||
{
|
||||
"name": "Jordan Harband",
|
||||
"url": "https://github.com/ljharb"
|
||||
}
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/Raynos/function-bind/issues",
|
||||
"email": "raynos2@gmail.com"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^12.2.1",
|
||||
"covert": "^1.1.0",
|
||||
"eslint": "^4.5.0",
|
||||
"jscs": "^3.0.7",
|
||||
"tape": "^4.8.0"
|
||||
},
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"pretest": "npm run lint",
|
||||
"test": "npm run tests-only",
|
||||
"posttest": "npm run coverage -- --quiet",
|
||||
"tests-only": "node test",
|
||||
"coverage": "covert test/*.js",
|
||||
"lint": "npm run jscs && npm run eslint",
|
||||
"jscs": "jscs *.js */*.js",
|
||||
"eslint": "eslint *.js */*.js"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test/index.js",
|
||||
"browsers": [
|
||||
"ie/8..latest",
|
||||
"firefox/16..latest",
|
||||
"firefox/nightly",
|
||||
"chrome/22..latest",
|
||||
"chrome/canary",
|
||||
"opera/12..latest",
|
||||
"opera/next",
|
||||
"safari/5.1..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2..latest"
|
||||
]
|
||||
}
|
||||
}
|
9
node_modules/function-bind/test/.eslintrc
generated
vendored
Normal file
9
node_modules/function-bind/test/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"rules": {
|
||||
"array-bracket-newline": 0,
|
||||
"array-element-newline": 0,
|
||||
"max-statements-per-line": [2, { "max": 2 }],
|
||||
"no-invalid-this": 0,
|
||||
"no-magic-numbers": 0,
|
||||
}
|
||||
}
|
252
node_modules/function-bind/test/index.js
generated
vendored
Normal file
252
node_modules/function-bind/test/index.js
generated
vendored
Normal file
@ -0,0 +1,252 @@
|
||||
// jscs:disable requireUseStrict
|
||||
|
||||
var test = require('tape');
|
||||
|
||||
var functionBind = require('../implementation');
|
||||
var getCurrentContext = function () { return this; };
|
||||
|
||||
test('functionBind is a function', function (t) {
|
||||
t.equal(typeof functionBind, 'function');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('non-functions', function (t) {
|
||||
var nonFunctions = [true, false, [], {}, 42, 'foo', NaN, /a/g];
|
||||
t.plan(nonFunctions.length);
|
||||
for (var i = 0; i < nonFunctions.length; ++i) {
|
||||
try { functionBind.call(nonFunctions[i]); } catch (ex) {
|
||||
t.ok(ex instanceof TypeError, 'throws when given ' + String(nonFunctions[i]));
|
||||
}
|
||||
}
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('without a context', function (t) {
|
||||
t.test('binds properly', function (st) {
|
||||
var args, context;
|
||||
var namespace = {
|
||||
func: functionBind.call(function () {
|
||||
args = Array.prototype.slice.call(arguments);
|
||||
context = this;
|
||||
})
|
||||
};
|
||||
namespace.func(1, 2, 3);
|
||||
st.deepEqual(args, [1, 2, 3]);
|
||||
st.equal(context, getCurrentContext.call());
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('binds properly, and still supplies bound arguments', function (st) {
|
||||
var args, context;
|
||||
var namespace = {
|
||||
func: functionBind.call(function () {
|
||||
args = Array.prototype.slice.call(arguments);
|
||||
context = this;
|
||||
}, undefined, 1, 2, 3)
|
||||
};
|
||||
namespace.func(4, 5, 6);
|
||||
st.deepEqual(args, [1, 2, 3, 4, 5, 6]);
|
||||
st.equal(context, getCurrentContext.call());
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('returns properly', function (st) {
|
||||
var args;
|
||||
var namespace = {
|
||||
func: functionBind.call(function () {
|
||||
args = Array.prototype.slice.call(arguments);
|
||||
return this;
|
||||
}, null)
|
||||
};
|
||||
var context = namespace.func(1, 2, 3);
|
||||
st.equal(context, getCurrentContext.call(), 'returned context is namespaced context');
|
||||
st.deepEqual(args, [1, 2, 3], 'passed arguments are correct');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('returns properly with bound arguments', function (st) {
|
||||
var args;
|
||||
var namespace = {
|
||||
func: functionBind.call(function () {
|
||||
args = Array.prototype.slice.call(arguments);
|
||||
return this;
|
||||
}, null, 1, 2, 3)
|
||||
};
|
||||
var context = namespace.func(4, 5, 6);
|
||||
st.equal(context, getCurrentContext.call(), 'returned context is namespaced context');
|
||||
st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('called as a constructor', function (st) {
|
||||
var thunkify = function (value) {
|
||||
return function () { return value; };
|
||||
};
|
||||
st.test('returns object value', function (sst) {
|
||||
var expectedReturnValue = [1, 2, 3];
|
||||
var Constructor = functionBind.call(thunkify(expectedReturnValue), null);
|
||||
var result = new Constructor();
|
||||
sst.equal(result, expectedReturnValue);
|
||||
sst.end();
|
||||
});
|
||||
|
||||
st.test('does not return primitive value', function (sst) {
|
||||
var Constructor = functionBind.call(thunkify(42), null);
|
||||
var result = new Constructor();
|
||||
sst.notEqual(result, 42);
|
||||
sst.end();
|
||||
});
|
||||
|
||||
st.test('object from bound constructor is instance of original and bound constructor', function (sst) {
|
||||
var A = function (x) {
|
||||
this.name = x || 'A';
|
||||
};
|
||||
var B = functionBind.call(A, null, 'B');
|
||||
|
||||
var result = new B();
|
||||
sst.ok(result instanceof B, 'result is instance of bound constructor');
|
||||
sst.ok(result instanceof A, 'result is instance of original constructor');
|
||||
sst.end();
|
||||
});
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('with a context', function (t) {
|
||||
t.test('with no bound arguments', function (st) {
|
||||
var args, context;
|
||||
var boundContext = {};
|
||||
var namespace = {
|
||||
func: functionBind.call(function () {
|
||||
args = Array.prototype.slice.call(arguments);
|
||||
context = this;
|
||||
}, boundContext)
|
||||
};
|
||||
namespace.func(1, 2, 3);
|
||||
st.equal(context, boundContext, 'binds a context properly');
|
||||
st.deepEqual(args, [1, 2, 3], 'supplies passed arguments');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('with bound arguments', function (st) {
|
||||
var args, context;
|
||||
var boundContext = {};
|
||||
var namespace = {
|
||||
func: functionBind.call(function () {
|
||||
args = Array.prototype.slice.call(arguments);
|
||||
context = this;
|
||||
}, boundContext, 1, 2, 3)
|
||||
};
|
||||
namespace.func(4, 5, 6);
|
||||
st.equal(context, boundContext, 'binds a context properly');
|
||||
st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'supplies bound and passed arguments');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('returns properly', function (st) {
|
||||
var boundContext = {};
|
||||
var args;
|
||||
var namespace = {
|
||||
func: functionBind.call(function () {
|
||||
args = Array.prototype.slice.call(arguments);
|
||||
return this;
|
||||
}, boundContext)
|
||||
};
|
||||
var context = namespace.func(1, 2, 3);
|
||||
st.equal(context, boundContext, 'returned context is bound context');
|
||||
st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context');
|
||||
st.deepEqual(args, [1, 2, 3], 'passed arguments are correct');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('returns properly with bound arguments', function (st) {
|
||||
var boundContext = {};
|
||||
var args;
|
||||
var namespace = {
|
||||
func: functionBind.call(function () {
|
||||
args = Array.prototype.slice.call(arguments);
|
||||
return this;
|
||||
}, boundContext, 1, 2, 3)
|
||||
};
|
||||
var context = namespace.func(4, 5, 6);
|
||||
st.equal(context, boundContext, 'returned context is bound context');
|
||||
st.notEqual(context, getCurrentContext.call(), 'returned context is not lexical context');
|
||||
st.deepEqual(args, [1, 2, 3, 4, 5, 6], 'passed arguments are correct');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('passes the correct arguments when called as a constructor', function (st) {
|
||||
var expected = { name: 'Correct' };
|
||||
var namespace = {
|
||||
Func: functionBind.call(function (arg) {
|
||||
return arg;
|
||||
}, { name: 'Incorrect' })
|
||||
};
|
||||
var returned = new namespace.Func(expected);
|
||||
st.equal(returned, expected, 'returns the right arg when called as a constructor');
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('has the new instance\'s context when called as a constructor', function (st) {
|
||||
var actualContext;
|
||||
var expectedContext = { foo: 'bar' };
|
||||
var namespace = {
|
||||
Func: functionBind.call(function () {
|
||||
actualContext = this;
|
||||
}, expectedContext)
|
||||
};
|
||||
var result = new namespace.Func();
|
||||
st.equal(result instanceof namespace.Func, true);
|
||||
st.notEqual(actualContext, expectedContext);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('bound function length', function (t) {
|
||||
t.test('sets a correct length without thisArg', function (st) {
|
||||
var subject = functionBind.call(function (a, b, c) { return a + b + c; });
|
||||
st.equal(subject.length, 3);
|
||||
st.equal(subject(1, 2, 3), 6);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('sets a correct length with thisArg', function (st) {
|
||||
var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {});
|
||||
st.equal(subject.length, 3);
|
||||
st.equal(subject(1, 2, 3), 6);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('sets a correct length without thisArg and first argument', function (st) {
|
||||
var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1);
|
||||
st.equal(subject.length, 2);
|
||||
st.equal(subject(2, 3), 6);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('sets a correct length with thisArg and first argument', function (st) {
|
||||
var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1);
|
||||
st.equal(subject.length, 2);
|
||||
st.equal(subject(2, 3), 6);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('sets a correct length without thisArg and too many arguments', function (st) {
|
||||
var subject = functionBind.call(function (a, b, c) { return a + b + c; }, undefined, 1, 2, 3, 4);
|
||||
st.equal(subject.length, 0);
|
||||
st.equal(subject(), 6);
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.test('sets a correct length with thisArg and too many arguments', function (st) {
|
||||
var subject = functionBind.call(function (a, b, c) { return a + b + c; }, {}, 1, 2, 3, 4);
|
||||
st.equal(subject.length, 0);
|
||||
st.equal(subject(), 6);
|
||||
st.end();
|
||||
});
|
||||
});
|
37
node_modules/get-intrinsic/.eslintrc
generated
vendored
Normal file
37
node_modules/get-intrinsic/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"env": {
|
||||
"es6": true,
|
||||
"es2017": true,
|
||||
"es2020": true,
|
||||
"es2021": true,
|
||||
"es2022": true,
|
||||
},
|
||||
|
||||
"rules": {
|
||||
"array-bracket-newline": 0,
|
||||
"complexity": 0,
|
||||
"eqeqeq": [2, "allow-null"],
|
||||
"func-name-matching": 0,
|
||||
"id-length": 0,
|
||||
"max-lines-per-function": [2, 90],
|
||||
"max-params": [2, 4],
|
||||
"max-statements": 0,
|
||||
"max-statements-per-line": [2, { "max": 2 }],
|
||||
"multiline-comment-style": 0,
|
||||
"no-magic-numbers": 0,
|
||||
"sort-keys": 0,
|
||||
},
|
||||
|
||||
"overrides": [
|
||||
{
|
||||
"files": "test/**",
|
||||
"rules": {
|
||||
"new-cap": 0,
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
12
node_modules/get-intrinsic/.github/FUNDING.yml
generated
vendored
Normal file
12
node_modules/get-intrinsic/.github/FUNDING.yml
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [ljharb]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: npm/get-intrinsic
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
9
node_modules/get-intrinsic/.nycrc
generated
vendored
Normal file
9
node_modules/get-intrinsic/.nycrc
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"all": true,
|
||||
"check-coverage": false,
|
||||
"reporter": ["text-summary", "text", "html", "json"],
|
||||
"exclude": [
|
||||
"coverage",
|
||||
"test"
|
||||
]
|
||||
}
|
91
node_modules/get-intrinsic/CHANGELOG.md
generated
vendored
Normal file
91
node_modules/get-intrinsic/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v1.1.2](https://github.com/ljharb/get-intrinsic/compare/v1.1.1...v1.1.2) - 2022-06-08
|
||||
|
||||
### Fixed
|
||||
|
||||
- [Fix] properly validate against extra % signs [`#16`](https://github.com/ljharb/get-intrinsic/issues/16)
|
||||
|
||||
### Commits
|
||||
|
||||
- [actions] reuse common workflows [`0972547`](https://github.com/ljharb/get-intrinsic/commit/0972547efd0abc863fe4c445a6ca7eb4f8c6901d)
|
||||
- [meta] use `npmignore` to autogenerate an npmignore file [`5ba0b51`](https://github.com/ljharb/get-intrinsic/commit/5ba0b51d8d8d4f1c31d426d74abc0770fd106bad)
|
||||
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`c364492`](https://github.com/ljharb/get-intrinsic/commit/c364492af4af51333e6f81c0bf21fd3d602c3661)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `es-abstract`, `object-inspect`, `tape` [`dc04dad`](https://github.com/ljharb/get-intrinsic/commit/dc04dad86f6e5608775a2640cb0db5927ae29ed9)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `es-abstract`, `object-inspect`, `safe-publish-latest`, `tape` [`1c14059`](https://github.com/ljharb/get-intrinsic/commit/1c1405984e86dd2dc9366c15d8a0294a96a146a5)
|
||||
- [Tests] use `mock-property` [`b396ef0`](https://github.com/ljharb/get-intrinsic/commit/b396ef05bb73b1d699811abd64b0d9b97997fdda)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect`, `tape` [`c2c758d`](https://github.com/ljharb/get-intrinsic/commit/c2c758d3b90af4fef0a76910d8d3c292ec8d1d3e)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `es-abstract`, `es-value-fixtures`, `object-inspect`, `tape` [`29e3c09`](https://github.com/ljharb/get-intrinsic/commit/29e3c091c2bf3e17099969847e8729d0e46896de)
|
||||
- [actions] update codecov uploader [`8cbc141`](https://github.com/ljharb/get-intrinsic/commit/8cbc1418940d7a8941f3a7985cbc4ac095c5e13d)
|
||||
- [Dev Deps] update `@ljharb/eslint-config`, `es-abstract`, `es-value-fixtures`, `object-inspect`, `tape` [`10b6f5c`](https://github.com/ljharb/get-intrinsic/commit/10b6f5c02593fb3680c581d696ac124e30652932)
|
||||
- [readme] add github actions/codecov badges [`4e25400`](https://github.com/ljharb/get-intrinsic/commit/4e25400d9f51ae9eb059cbe22d9144e70ea214e8)
|
||||
- [Tests] use `for-each` instead of `foreach` [`c05b957`](https://github.com/ljharb/get-intrinsic/commit/c05b957ad9a7bc7721af7cc9e9be1edbfe057496)
|
||||
- [Dev Deps] update `es-abstract` [`29b05ae`](https://github.com/ljharb/get-intrinsic/commit/29b05aec3e7330e9ad0b8e0f685a9112c20cdd97)
|
||||
- [meta] use `prepublishOnly` script for npm 7+ [`95c285d`](https://github.com/ljharb/get-intrinsic/commit/95c285da810516057d3bbfa871176031af38f05d)
|
||||
- [Deps] update `has-symbols` [`593cb4f`](https://github.com/ljharb/get-intrinsic/commit/593cb4fb38e7922e40e42c183f45274b636424cd)
|
||||
- [readme] fix repo URLs [`1c8305b`](https://github.com/ljharb/get-intrinsic/commit/1c8305b5365827c9b6fc785434aac0e1328ff2f5)
|
||||
- [Deps] update `has-symbols` [`c7138b6`](https://github.com/ljharb/get-intrinsic/commit/c7138b6c6d73132d859471fb8c13304e1e7c8b20)
|
||||
- [Dev Deps] remove unused `has-bigints` [`bd63aff`](https://github.com/ljharb/get-intrinsic/commit/bd63aff6ad8f3a986c557fcda2914187bdaab359)
|
||||
|
||||
## [v1.1.1](https://github.com/ljharb/get-intrinsic/compare/v1.1.0...v1.1.1) - 2021-02-03
|
||||
|
||||
### Fixed
|
||||
|
||||
- [meta] export `./package.json` [`#9`](https://github.com/ljharb/get-intrinsic/issues/9)
|
||||
|
||||
### Commits
|
||||
|
||||
- [readme] flesh out the readme; use `evalmd` [`d12f12c`](https://github.com/ljharb/get-intrinsic/commit/d12f12c15345a0a0772cc65a7c64369529abd614)
|
||||
- [eslint] set up proper globals config [`5a8c098`](https://github.com/ljharb/get-intrinsic/commit/5a8c0984e3319d1ac0e64b102f8ec18b64e79f36)
|
||||
- [Dev Deps] update `eslint` [`7b9a5c0`](https://github.com/ljharb/get-intrinsic/commit/7b9a5c0d31a90ca1a1234181c74988fb046701cd)
|
||||
|
||||
## [v1.1.0](https://github.com/ljharb/get-intrinsic/compare/v1.0.2...v1.1.0) - 2021-01-25
|
||||
|
||||
### Fixed
|
||||
|
||||
- [Refactor] delay `Function` eval until syntax-derived values are requested [`#3`](https://github.com/ljharb/get-intrinsic/issues/3)
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] migrate tests to Github Actions [`2ab762b`](https://github.com/ljharb/get-intrinsic/commit/2ab762b48164aea8af37a40ba105bbc8246ab8c4)
|
||||
- [meta] do not publish github action workflow files [`5e7108e`](https://github.com/ljharb/get-intrinsic/commit/5e7108e4768b244d48d9567ba4f8a6cab9c65b8e)
|
||||
- [Tests] add some coverage [`01ac7a8`](https://github.com/ljharb/get-intrinsic/commit/01ac7a87ac29738567e8524cd8c9e026b1fa8cb3)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `call-bind`, `es-abstract`, `tape`; add `call-bind` [`911b672`](https://github.com/ljharb/get-intrinsic/commit/911b672fbffae433a96924c6ce013585e425f4b7)
|
||||
- [Refactor] rearrange evalled constructors a bit [`7e7e4bf`](https://github.com/ljharb/get-intrinsic/commit/7e7e4bf583f3799c8ac1c6c5e10d2cb553957347)
|
||||
- [meta] add Automatic Rebase and Require Allow Edits workflows [`0199968`](https://github.com/ljharb/get-intrinsic/commit/01999687a263ffce0a3cb011dfbcb761754aedbc)
|
||||
|
||||
## [v1.0.2](https://github.com/ljharb/get-intrinsic/compare/v1.0.1...v1.0.2) - 2020-12-17
|
||||
|
||||
### Commits
|
||||
|
||||
- [Fix] Throw for non‑existent intrinsics [`68f873b`](https://github.com/ljharb/get-intrinsic/commit/68f873b013c732a05ad6f5fc54f697e55515461b)
|
||||
- [Fix] Throw for non‑existent segments in the intrinsic path [`8325dee`](https://github.com/ljharb/get-intrinsic/commit/8325deee43128f3654d3399aa9591741ebe17b21)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-bigints`, `object-inspect` [`0c227a7`](https://github.com/ljharb/get-intrinsic/commit/0c227a7d8b629166f25715fd242553892e458525)
|
||||
- [meta] do not lint coverage output [`70d2419`](https://github.com/ljharb/get-intrinsic/commit/70d24199b620043cd9110fc5f426d214ebe21dc9)
|
||||
|
||||
## [v1.0.1](https://github.com/ljharb/get-intrinsic/compare/v1.0.0...v1.0.1) - 2020-10-30
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] gather coverage data on every job [`d1d280d`](https://github.com/ljharb/get-intrinsic/commit/d1d280dec714e3f0519cc877dbcb193057d9cac6)
|
||||
- [Fix] add missing dependencies [`5031771`](https://github.com/ljharb/get-intrinsic/commit/5031771bb1095b38be88ce7c41d5de88718e432e)
|
||||
- [Tests] use `es-value-fixtures` [`af48765`](https://github.com/ljharb/get-intrinsic/commit/af48765a23c5323fb0b6b38dbf00eb5099c7bebc)
|
||||
|
||||
## v1.0.0 - 2020-10-29
|
||||
|
||||
### Commits
|
||||
|
||||
- Implementation [`bbce57c`](https://github.com/ljharb/get-intrinsic/commit/bbce57c6f33d05b2d8d3efa273ceeb3ee01127bb)
|
||||
- Tests [`17b4f0d`](https://github.com/ljharb/get-intrinsic/commit/17b4f0d56dea6b4059b56fc30ef3ee4d9500ebc2)
|
||||
- Initial commit [`3153294`](https://github.com/ljharb/get-intrinsic/commit/31532948de363b0a27dd9fd4649e7b7028ec4b44)
|
||||
- npm init [`fb326c4`](https://github.com/ljharb/get-intrinsic/commit/fb326c4d2817c8419ec31de1295f06bb268a7902)
|
||||
- [meta] add Automatic Rebase and Require Allow Edits workflows [`48862fb`](https://github.com/ljharb/get-intrinsic/commit/48862fb2508c8f6a57968e6d08b7c883afc9d550)
|
||||
- [meta] add `auto-changelog` [`5f28ad0`](https://github.com/ljharb/get-intrinsic/commit/5f28ad019e060a353d8028f9f2591a9cc93074a1)
|
||||
- [meta] add "funding"; create `FUNDING.yml` [`c2bbdde`](https://github.com/ljharb/get-intrinsic/commit/c2bbddeba73a875be61484ee4680b129a6d4e0a1)
|
||||
- [Tests] add `npm run lint` [`0a84b98`](https://github.com/ljharb/get-intrinsic/commit/0a84b98b22b7cf7a748666f705b0003a493c35fd)
|
||||
- Only apps should have lockfiles [`9586c75`](https://github.com/ljharb/get-intrinsic/commit/9586c75866c1ee678e4d5d4dbbdef6997e511b05)
|
21
node_modules/get-intrinsic/LICENSE
generated
vendored
Normal file
21
node_modules/get-intrinsic/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Jordan Harband
|
||||
|
||||
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.
|
71
node_modules/get-intrinsic/README.md
generated
vendored
Normal file
71
node_modules/get-intrinsic/README.md
generated
vendored
Normal file
@ -0,0 +1,71 @@
|
||||
# get-intrinsic <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
|
||||
|
||||
[![github actions][actions-image]][actions-url]
|
||||
[![coverage][codecov-image]][codecov-url]
|
||||
[![dependency status][deps-svg]][deps-url]
|
||||
[![dev dependency status][dev-deps-svg]][dev-deps-url]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][npm-badge-png]][package-url]
|
||||
|
||||
Get and robustly cache all JS language-level intrinsics at first require time.
|
||||
|
||||
See the syntax described [in the JS spec](https://tc39.es/ecma262/#sec-well-known-intrinsic-objects) for reference.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
var assert = require('assert');
|
||||
|
||||
// static methods
|
||||
assert.equal(GetIntrinsic('%Math.pow%'), Math.pow);
|
||||
assert.equal(Math.pow(2, 3), 8);
|
||||
assert.equal(GetIntrinsic('%Math.pow%')(2, 3), 8);
|
||||
delete Math.pow;
|
||||
assert.equal(GetIntrinsic('%Math.pow%')(2, 3), 8);
|
||||
|
||||
// instance methods
|
||||
var arr = [1];
|
||||
assert.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push);
|
||||
assert.deepEqual(arr, [1]);
|
||||
|
||||
arr.push(2);
|
||||
assert.deepEqual(arr, [1, 2]);
|
||||
|
||||
GetIntrinsic('%Array.prototype.push%').call(arr, 3);
|
||||
assert.deepEqual(arr, [1, 2, 3]);
|
||||
|
||||
delete Array.prototype.push;
|
||||
GetIntrinsic('%Array.prototype.push%').call(arr, 4);
|
||||
assert.deepEqual(arr, [1, 2, 3, 4]);
|
||||
|
||||
// missing features
|
||||
delete JSON.parse; // to simulate a real intrinsic that is missing in the environment
|
||||
assert.throws(() => GetIntrinsic('%JSON.parse%'));
|
||||
assert.equal(undefined, GetIntrinsic('%JSON.parse%', true));
|
||||
```
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
## Security
|
||||
|
||||
Please email [@ljharb](https://github.com/ljharb) or see https://tidelift.com/security if you have a potential security vulnerability to report.
|
||||
|
||||
[package-url]: https://npmjs.org/package/get-intrinsic
|
||||
[npm-version-svg]: https://versionbadg.es/ljharb/get-intrinsic.svg
|
||||
[deps-svg]: https://david-dm.org/ljharb/get-intrinsic.svg
|
||||
[deps-url]: https://david-dm.org/ljharb/get-intrinsic
|
||||
[dev-deps-svg]: https://david-dm.org/ljharb/get-intrinsic/dev-status.svg
|
||||
[dev-deps-url]: https://david-dm.org/ljharb/get-intrinsic#info=devDependencies
|
||||
[npm-badge-png]: https://nodei.co/npm/get-intrinsic.png?downloads=true&stars=true
|
||||
[license-image]: https://img.shields.io/npm/l/get-intrinsic.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/get-intrinsic.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=get-intrinsic
|
||||
[codecov-image]: https://codecov.io/gh/ljharb/get-intrinsic/branch/main/graphs/badge.svg
|
||||
[codecov-url]: https://app.codecov.io/gh/ljharb/get-intrinsic/
|
||||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/get-intrinsic
|
||||
[actions-url]: https://github.com/ljharb/get-intrinsic/actions
|
334
node_modules/get-intrinsic/index.js
generated
vendored
Normal file
334
node_modules/get-intrinsic/index.js
generated
vendored
Normal file
@ -0,0 +1,334 @@
|
||||
'use strict';
|
||||
|
||||
var undefined;
|
||||
|
||||
var $SyntaxError = SyntaxError;
|
||||
var $Function = Function;
|
||||
var $TypeError = TypeError;
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
var getEvalledConstructor = function (expressionSyntax) {
|
||||
try {
|
||||
return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
|
||||
} catch (e) {}
|
||||
};
|
||||
|
||||
var $gOPD = Object.getOwnPropertyDescriptor;
|
||||
if ($gOPD) {
|
||||
try {
|
||||
$gOPD({}, '');
|
||||
} catch (e) {
|
||||
$gOPD = null; // this is IE 8, which has a broken gOPD
|
||||
}
|
||||
}
|
||||
|
||||
var throwTypeError = function () {
|
||||
throw new $TypeError();
|
||||
};
|
||||
var ThrowTypeError = $gOPD
|
||||
? (function () {
|
||||
try {
|
||||
// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
|
||||
arguments.callee; // IE 8 does not throw here
|
||||
return throwTypeError;
|
||||
} catch (calleeThrows) {
|
||||
try {
|
||||
// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
||||
return $gOPD(arguments, 'callee').get;
|
||||
} catch (gOPDthrows) {
|
||||
return throwTypeError;
|
||||
}
|
||||
}
|
||||
}())
|
||||
: throwTypeError;
|
||||
|
||||
var hasSymbols = require('has-symbols')();
|
||||
|
||||
var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
|
||||
|
||||
var needsEval = {};
|
||||
|
||||
var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
|
||||
|
||||
var INTRINSICS = {
|
||||
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
|
||||
'%Array%': Array,
|
||||
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
|
||||
'%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
|
||||
'%AsyncFromSyncIteratorPrototype%': undefined,
|
||||
'%AsyncFunction%': needsEval,
|
||||
'%AsyncGenerator%': needsEval,
|
||||
'%AsyncGeneratorFunction%': needsEval,
|
||||
'%AsyncIteratorPrototype%': needsEval,
|
||||
'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
|
||||
'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
|
||||
'%Boolean%': Boolean,
|
||||
'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
|
||||
'%Date%': Date,
|
||||
'%decodeURI%': decodeURI,
|
||||
'%decodeURIComponent%': decodeURIComponent,
|
||||
'%encodeURI%': encodeURI,
|
||||
'%encodeURIComponent%': encodeURIComponent,
|
||||
'%Error%': Error,
|
||||
'%eval%': eval, // eslint-disable-line no-eval
|
||||
'%EvalError%': EvalError,
|
||||
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
|
||||
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
|
||||
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
|
||||
'%Function%': $Function,
|
||||
'%GeneratorFunction%': needsEval,
|
||||
'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
|
||||
'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
|
||||
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
|
||||
'%isFinite%': isFinite,
|
||||
'%isNaN%': isNaN,
|
||||
'%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
|
||||
'%JSON%': typeof JSON === 'object' ? JSON : undefined,
|
||||
'%Map%': typeof Map === 'undefined' ? undefined : Map,
|
||||
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
|
||||
'%Math%': Math,
|
||||
'%Number%': Number,
|
||||
'%Object%': Object,
|
||||
'%parseFloat%': parseFloat,
|
||||
'%parseInt%': parseInt,
|
||||
'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
|
||||
'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
|
||||
'%RangeError%': RangeError,
|
||||
'%ReferenceError%': ReferenceError,
|
||||
'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
|
||||
'%RegExp%': RegExp,
|
||||
'%Set%': typeof Set === 'undefined' ? undefined : Set,
|
||||
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
|
||||
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
|
||||
'%String%': String,
|
||||
'%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
|
||||
'%Symbol%': hasSymbols ? Symbol : undefined,
|
||||
'%SyntaxError%': $SyntaxError,
|
||||
'%ThrowTypeError%': ThrowTypeError,
|
||||
'%TypedArray%': TypedArray,
|
||||
'%TypeError%': $TypeError,
|
||||
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
|
||||
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
|
||||
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
|
||||
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
|
||||
'%URIError%': URIError,
|
||||
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
|
||||
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
|
||||
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
|
||||
};
|
||||
|
||||
var doEval = function doEval(name) {
|
||||
var value;
|
||||
if (name === '%AsyncFunction%') {
|
||||
value = getEvalledConstructor('async function () {}');
|
||||
} else if (name === '%GeneratorFunction%') {
|
||||
value = getEvalledConstructor('function* () {}');
|
||||
} else if (name === '%AsyncGeneratorFunction%') {
|
||||
value = getEvalledConstructor('async function* () {}');
|
||||
} else if (name === '%AsyncGenerator%') {
|
||||
var fn = doEval('%AsyncGeneratorFunction%');
|
||||
if (fn) {
|
||||
value = fn.prototype;
|
||||
}
|
||||
} else if (name === '%AsyncIteratorPrototype%') {
|
||||
var gen = doEval('%AsyncGenerator%');
|
||||
if (gen) {
|
||||
value = getProto(gen.prototype);
|
||||
}
|
||||
}
|
||||
|
||||
INTRINSICS[name] = value;
|
||||
|
||||
return value;
|
||||
};
|
||||
|
||||
var LEGACY_ALIASES = {
|
||||
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
||||
'%ArrayPrototype%': ['Array', 'prototype'],
|
||||
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
||||
'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
|
||||
'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
|
||||
'%ArrayProto_values%': ['Array', 'prototype', 'values'],
|
||||
'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
|
||||
'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
|
||||
'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
|
||||
'%BooleanPrototype%': ['Boolean', 'prototype'],
|
||||
'%DataViewPrototype%': ['DataView', 'prototype'],
|
||||
'%DatePrototype%': ['Date', 'prototype'],
|
||||
'%ErrorPrototype%': ['Error', 'prototype'],
|
||||
'%EvalErrorPrototype%': ['EvalError', 'prototype'],
|
||||
'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
|
||||
'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
|
||||
'%FunctionPrototype%': ['Function', 'prototype'],
|
||||
'%Generator%': ['GeneratorFunction', 'prototype'],
|
||||
'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
|
||||
'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
|
||||
'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
|
||||
'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
|
||||
'%JSONParse%': ['JSON', 'parse'],
|
||||
'%JSONStringify%': ['JSON', 'stringify'],
|
||||
'%MapPrototype%': ['Map', 'prototype'],
|
||||
'%NumberPrototype%': ['Number', 'prototype'],
|
||||
'%ObjectPrototype%': ['Object', 'prototype'],
|
||||
'%ObjProto_toString%': ['Object', 'prototype', 'toString'],
|
||||
'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
|
||||
'%PromisePrototype%': ['Promise', 'prototype'],
|
||||
'%PromiseProto_then%': ['Promise', 'prototype', 'then'],
|
||||
'%Promise_all%': ['Promise', 'all'],
|
||||
'%Promise_reject%': ['Promise', 'reject'],
|
||||
'%Promise_resolve%': ['Promise', 'resolve'],
|
||||
'%RangeErrorPrototype%': ['RangeError', 'prototype'],
|
||||
'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
|
||||
'%RegExpPrototype%': ['RegExp', 'prototype'],
|
||||
'%SetPrototype%': ['Set', 'prototype'],
|
||||
'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
|
||||
'%StringPrototype%': ['String', 'prototype'],
|
||||
'%SymbolPrototype%': ['Symbol', 'prototype'],
|
||||
'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
|
||||
'%TypedArrayPrototype%': ['TypedArray', 'prototype'],
|
||||
'%TypeErrorPrototype%': ['TypeError', 'prototype'],
|
||||
'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
|
||||
'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
|
||||
'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
|
||||
'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
|
||||
'%URIErrorPrototype%': ['URIError', 'prototype'],
|
||||
'%WeakMapPrototype%': ['WeakMap', 'prototype'],
|
||||
'%WeakSetPrototype%': ['WeakSet', 'prototype']
|
||||
};
|
||||
|
||||
var bind = require('function-bind');
|
||||
var hasOwn = require('has');
|
||||
var $concat = bind.call(Function.call, Array.prototype.concat);
|
||||
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
|
||||
var $replace = bind.call(Function.call, String.prototype.replace);
|
||||
var $strSlice = bind.call(Function.call, String.prototype.slice);
|
||||
var $exec = bind.call(Function.call, RegExp.prototype.exec);
|
||||
|
||||
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
||||
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
||||
var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
|
||||
var stringToPath = function stringToPath(string) {
|
||||
var first = $strSlice(string, 0, 1);
|
||||
var last = $strSlice(string, -1);
|
||||
if (first === '%' && last !== '%') {
|
||||
throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
|
||||
} else if (last === '%' && first !== '%') {
|
||||
throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
|
||||
}
|
||||
var result = [];
|
||||
$replace(string, rePropName, function (match, number, quote, subString) {
|
||||
result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
|
||||
});
|
||||
return result;
|
||||
};
|
||||
/* end adaptation */
|
||||
|
||||
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
||||
var intrinsicName = name;
|
||||
var alias;
|
||||
if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
|
||||
alias = LEGACY_ALIASES[intrinsicName];
|
||||
intrinsicName = '%' + alias[0] + '%';
|
||||
}
|
||||
|
||||
if (hasOwn(INTRINSICS, intrinsicName)) {
|
||||
var value = INTRINSICS[intrinsicName];
|
||||
if (value === needsEval) {
|
||||
value = doEval(intrinsicName);
|
||||
}
|
||||
if (typeof value === 'undefined' && !allowMissing) {
|
||||
throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
||||
}
|
||||
|
||||
return {
|
||||
alias: alias,
|
||||
name: intrinsicName,
|
||||
value: value
|
||||
};
|
||||
}
|
||||
|
||||
throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
|
||||
};
|
||||
|
||||
module.exports = function GetIntrinsic(name, allowMissing) {
|
||||
if (typeof name !== 'string' || name.length === 0) {
|
||||
throw new $TypeError('intrinsic name must be a non-empty string');
|
||||
}
|
||||
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
|
||||
throw new $TypeError('"allowMissing" argument must be a boolean');
|
||||
}
|
||||
|
||||
if ($exec(/^%?[^%]*%?$/g, name) === null) {
|
||||
throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
|
||||
}
|
||||
var parts = stringToPath(name);
|
||||
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
||||
|
||||
var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
|
||||
var intrinsicRealName = intrinsic.name;
|
||||
var value = intrinsic.value;
|
||||
var skipFurtherCaching = false;
|
||||
|
||||
var alias = intrinsic.alias;
|
||||
if (alias) {
|
||||
intrinsicBaseName = alias[0];
|
||||
$spliceApply(parts, $concat([0, 1], alias));
|
||||
}
|
||||
|
||||
for (var i = 1, isOwn = true; i < parts.length; i += 1) {
|
||||
var part = parts[i];
|
||||
var first = $strSlice(part, 0, 1);
|
||||
var last = $strSlice(part, -1);
|
||||
if (
|
||||
(
|
||||
(first === '"' || first === "'" || first === '`')
|
||||
|| (last === '"' || last === "'" || last === '`')
|
||||
)
|
||||
&& first !== last
|
||||
) {
|
||||
throw new $SyntaxError('property names with quotes must have matching quotes');
|
||||
}
|
||||
if (part === 'constructor' || !isOwn) {
|
||||
skipFurtherCaching = true;
|
||||
}
|
||||
|
||||
intrinsicBaseName += '.' + part;
|
||||
intrinsicRealName = '%' + intrinsicBaseName + '%';
|
||||
|
||||
if (hasOwn(INTRINSICS, intrinsicRealName)) {
|
||||
value = INTRINSICS[intrinsicRealName];
|
||||
} else if (value != null) {
|
||||
if (!(part in value)) {
|
||||
if (!allowMissing) {
|
||||
throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
|
||||
}
|
||||
return void undefined;
|
||||
}
|
||||
if ($gOPD && (i + 1) >= parts.length) {
|
||||
var desc = $gOPD(value, part);
|
||||
isOwn = !!desc;
|
||||
|
||||
// By convention, when a data property is converted to an accessor
|
||||
// property to emulate a data property that does not suffer from
|
||||
// the override mistake, that accessor's getter is marked with
|
||||
// an `originalValue` property. Here, when we detect this, we
|
||||
// uphold the illusion by pretending to see that original data
|
||||
// property, i.e., returning the value rather than the getter
|
||||
// itself.
|
||||
if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
|
||||
value = desc.get;
|
||||
} else {
|
||||
value = value[part];
|
||||
}
|
||||
} else {
|
||||
isOwn = hasOwn(value, part);
|
||||
value = value[part];
|
||||
}
|
||||
|
||||
if (isOwn && !skipFurtherCaching) {
|
||||
INTRINSICS[intrinsicRealName] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
};
|
88
node_modules/get-intrinsic/package.json
generated
vendored
Normal file
88
node_modules/get-intrinsic/package.json
generated
vendored
Normal file
@ -0,0 +1,88 @@
|
||||
{
|
||||
"name": "get-intrinsic",
|
||||
"version": "1.1.2",
|
||||
"description": "Get and robustly cache all JS language-level intrinsics at first require time",
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
".": [
|
||||
{
|
||||
"default": "./index.js"
|
||||
},
|
||||
"./index.js"
|
||||
],
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"scripts": {
|
||||
"prepack": "npmignore --auto --commentLines=autogenerated",
|
||||
"prepublish": "not-in-publish || npm run prepublishOnly",
|
||||
"prepublishOnly": "safe-publish-latest",
|
||||
"prelint": "evalmd README.md",
|
||||
"lint": "eslint --ext=.js,.mjs .",
|
||||
"pretest": "npm run lint",
|
||||
"tests-only": "nyc tape 'test/**/*.js'",
|
||||
"test": "npm run tests-only",
|
||||
"posttest": "aud --production",
|
||||
"version": "auto-changelog && git add CHANGELOG.md",
|
||||
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/ljharb/get-intrinsic.git"
|
||||
},
|
||||
"keywords": [
|
||||
"javascript",
|
||||
"ecmascript",
|
||||
"es",
|
||||
"js",
|
||||
"intrinsic",
|
||||
"getintrinsic",
|
||||
"es-abstract"
|
||||
],
|
||||
"author": "Jordan Harband <ljharb@gmail.com>",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ljharb/get-intrinsic/issues"
|
||||
},
|
||||
"homepage": "https://github.com/ljharb/get-intrinsic#readme",
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^21.0.0",
|
||||
"aud": "^2.0.0",
|
||||
"auto-changelog": "^2.4.0",
|
||||
"call-bind": "^1.0.2",
|
||||
"es-abstract": "^1.20.1",
|
||||
"es-value-fixtures": "^1.4.1",
|
||||
"eslint": "=8.8.0",
|
||||
"evalmd": "^0.0.19",
|
||||
"for-each": "^0.3.3",
|
||||
"make-async-function": "^1.0.0",
|
||||
"make-async-generator-function": "^1.0.0",
|
||||
"make-generator-function": "^2.0.0",
|
||||
"mock-property": "^1.0.0",
|
||||
"npmignore": "^0.3.0",
|
||||
"nyc": "^10.3.2",
|
||||
"object-inspect": "^1.12.2",
|
||||
"safe-publish-latest": "^2.0.0",
|
||||
"tape": "^5.5.3"
|
||||
},
|
||||
"auto-changelog": {
|
||||
"output": "CHANGELOG.md",
|
||||
"template": "keepachangelog",
|
||||
"unreleased": false,
|
||||
"commitLimit": false,
|
||||
"backfillLimit": false,
|
||||
"hideCredit": true
|
||||
},
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.1",
|
||||
"has": "^1.0.3",
|
||||
"has-symbols": "^1.0.3"
|
||||
},
|
||||
"publishConfig": {
|
||||
"ignore": [
|
||||
".github/workflows"
|
||||
]
|
||||
}
|
||||
}
|
274
node_modules/get-intrinsic/test/GetIntrinsic.js
generated
vendored
Normal file
274
node_modules/get-intrinsic/test/GetIntrinsic.js
generated
vendored
Normal file
@ -0,0 +1,274 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('../');
|
||||
|
||||
var test = require('tape');
|
||||
var forEach = require('for-each');
|
||||
var debug = require('object-inspect');
|
||||
var generatorFns = require('make-generator-function')();
|
||||
var asyncFns = require('make-async-function').list();
|
||||
var asyncGenFns = require('make-async-generator-function')();
|
||||
var mockProperty = require('mock-property');
|
||||
|
||||
var callBound = require('call-bind/callBound');
|
||||
var v = require('es-value-fixtures');
|
||||
var $gOPD = require('es-abstract/helpers/getOwnPropertyDescriptor');
|
||||
var DefinePropertyOrThrow = require('es-abstract/2021/DefinePropertyOrThrow');
|
||||
|
||||
var $isProto = callBound('%Object.prototype.isPrototypeOf%');
|
||||
|
||||
test('export', function (t) {
|
||||
t.equal(typeof GetIntrinsic, 'function', 'it is a function');
|
||||
t.equal(GetIntrinsic.length, 2, 'function has length of 2');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('throws', function (t) {
|
||||
t['throws'](
|
||||
function () { GetIntrinsic('not an intrinsic'); },
|
||||
SyntaxError,
|
||||
'nonexistent intrinsic throws a syntax error'
|
||||
);
|
||||
|
||||
t['throws'](
|
||||
function () { GetIntrinsic(''); },
|
||||
TypeError,
|
||||
'empty string intrinsic throws a type error'
|
||||
);
|
||||
|
||||
t['throws'](
|
||||
function () { GetIntrinsic('.'); },
|
||||
SyntaxError,
|
||||
'"just a dot" intrinsic throws a syntax error'
|
||||
);
|
||||
|
||||
t['throws'](
|
||||
function () { GetIntrinsic('%String'); },
|
||||
SyntaxError,
|
||||
'Leading % without trailing % throws a syntax error'
|
||||
);
|
||||
|
||||
t['throws'](
|
||||
function () { GetIntrinsic('String%'); },
|
||||
SyntaxError,
|
||||
'Trailing % without leading % throws a syntax error'
|
||||
);
|
||||
|
||||
t['throws'](
|
||||
function () { GetIntrinsic("String['prototype]"); },
|
||||
SyntaxError,
|
||||
'Dynamic property access is disallowed for intrinsics (unterminated string)'
|
||||
);
|
||||
|
||||
t['throws'](
|
||||
function () { GetIntrinsic('%Proxy.prototype.undefined%'); },
|
||||
TypeError,
|
||||
"Throws when middle part doesn't exist (%Proxy.prototype.undefined%)"
|
||||
);
|
||||
|
||||
t['throws'](
|
||||
function () { GetIntrinsic('%Array.prototype%garbage%'); },
|
||||
SyntaxError,
|
||||
'Throws with extra percent signs'
|
||||
);
|
||||
|
||||
t['throws'](
|
||||
function () { GetIntrinsic('%Array.prototype%push%'); },
|
||||
SyntaxError,
|
||||
'Throws with extra percent signs, even on an existing intrinsic'
|
||||
);
|
||||
|
||||
forEach(v.nonStrings, function (nonString) {
|
||||
t['throws'](
|
||||
function () { GetIntrinsic(nonString); },
|
||||
TypeError,
|
||||
debug(nonString) + ' is not a String'
|
||||
);
|
||||
});
|
||||
|
||||
forEach(v.nonBooleans, function (nonBoolean) {
|
||||
t['throws'](
|
||||
function () { GetIntrinsic('%', nonBoolean); },
|
||||
TypeError,
|
||||
debug(nonBoolean) + ' is not a Boolean'
|
||||
);
|
||||
});
|
||||
|
||||
forEach([
|
||||
'toString',
|
||||
'propertyIsEnumerable',
|
||||
'hasOwnProperty'
|
||||
], function (objectProtoMember) {
|
||||
t['throws'](
|
||||
function () { GetIntrinsic(objectProtoMember); },
|
||||
SyntaxError,
|
||||
debug(objectProtoMember) + ' is not an intrinsic'
|
||||
);
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('base intrinsics', function (t) {
|
||||
t.equal(GetIntrinsic('%Object%'), Object, '%Object% yields Object');
|
||||
t.equal(GetIntrinsic('Object'), Object, 'Object yields Object');
|
||||
t.equal(GetIntrinsic('%Array%'), Array, '%Array% yields Array');
|
||||
t.equal(GetIntrinsic('Array'), Array, 'Array yields Array');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('dotted paths', function (t) {
|
||||
t.equal(GetIntrinsic('%Object.prototype.toString%'), Object.prototype.toString, '%Object.prototype.toString% yields Object.prototype.toString');
|
||||
t.equal(GetIntrinsic('Object.prototype.toString'), Object.prototype.toString, 'Object.prototype.toString yields Object.prototype.toString');
|
||||
t.equal(GetIntrinsic('%Array.prototype.push%'), Array.prototype.push, '%Array.prototype.push% yields Array.prototype.push');
|
||||
t.equal(GetIntrinsic('Array.prototype.push'), Array.prototype.push, 'Array.prototype.push yields Array.prototype.push');
|
||||
|
||||
test('underscore paths are aliases for dotted paths', { skip: !Object.isFrozen || Object.isFrozen(Object.prototype) }, function (st) {
|
||||
var original = GetIntrinsic('%ObjProto_toString%');
|
||||
|
||||
forEach([
|
||||
'%Object.prototype.toString%',
|
||||
'Object.prototype.toString',
|
||||
'%ObjectPrototype.toString%',
|
||||
'ObjectPrototype.toString',
|
||||
'%ObjProto_toString%',
|
||||
'ObjProto_toString'
|
||||
], function (name) {
|
||||
DefinePropertyOrThrow(Object.prototype, 'toString', {
|
||||
'[[Value]]': function toString() {
|
||||
return original.apply(this, arguments);
|
||||
}
|
||||
});
|
||||
st.equal(GetIntrinsic(name), original, name + ' yields original Object.prototype.toString');
|
||||
});
|
||||
|
||||
DefinePropertyOrThrow(Object.prototype, 'toString', { '[[Value]]': original });
|
||||
st.end();
|
||||
});
|
||||
|
||||
test('dotted paths cache', { skip: !Object.isFrozen || Object.isFrozen(Object.prototype) }, function (st) {
|
||||
var original = GetIntrinsic('%Object.prototype.propertyIsEnumerable%');
|
||||
|
||||
forEach([
|
||||
'%Object.prototype.propertyIsEnumerable%',
|
||||
'Object.prototype.propertyIsEnumerable',
|
||||
'%ObjectPrototype.propertyIsEnumerable%',
|
||||
'ObjectPrototype.propertyIsEnumerable'
|
||||
], function (name) {
|
||||
var restore = mockProperty(Object.prototype, 'propertyIsEnumerable', {
|
||||
value: function propertyIsEnumerable() {
|
||||
return original.apply(this, arguments);
|
||||
}
|
||||
});
|
||||
st.equal(GetIntrinsic(name), original, name + ' yields cached Object.prototype.propertyIsEnumerable');
|
||||
|
||||
restore();
|
||||
});
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
test('dotted path reports correct error', function (st) {
|
||||
st['throws'](function () {
|
||||
GetIntrinsic('%NonExistentIntrinsic.prototype.property%');
|
||||
}, /%NonExistentIntrinsic%/, 'The base intrinsic of %NonExistentIntrinsic.prototype.property% is %NonExistentIntrinsic%');
|
||||
|
||||
st['throws'](function () {
|
||||
GetIntrinsic('%NonExistentIntrinsicPrototype.property%');
|
||||
}, /%NonExistentIntrinsicPrototype%/, 'The base intrinsic of %NonExistentIntrinsicPrototype.property% is %NonExistentIntrinsicPrototype%');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('accessors', { skip: !$gOPD || typeof Map !== 'function' }, function (t) {
|
||||
var actual = $gOPD(Map.prototype, 'size');
|
||||
t.ok(actual, 'Map.prototype.size has a descriptor');
|
||||
t.equal(typeof actual.get, 'function', 'Map.prototype.size has a getter function');
|
||||
t.equal(GetIntrinsic('%Map.prototype.size%'), actual.get, '%Map.prototype.size% yields the getter for it');
|
||||
t.equal(GetIntrinsic('Map.prototype.size'), actual.get, 'Map.prototype.size yields the getter for it');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('generator functions', { skip: !generatorFns.length }, function (t) {
|
||||
var $GeneratorFunction = GetIntrinsic('%GeneratorFunction%');
|
||||
var $GeneratorFunctionPrototype = GetIntrinsic('%Generator%');
|
||||
var $GeneratorPrototype = GetIntrinsic('%GeneratorPrototype%');
|
||||
|
||||
forEach(generatorFns, function (genFn) {
|
||||
var fnName = genFn.name;
|
||||
fnName = fnName ? "'" + fnName + "'" : 'genFn';
|
||||
|
||||
t.ok(genFn instanceof $GeneratorFunction, fnName + ' instanceof %GeneratorFunction%');
|
||||
t.ok($isProto($GeneratorFunctionPrototype, genFn), '%Generator% is prototype of ' + fnName);
|
||||
t.ok($isProto($GeneratorPrototype, genFn.prototype), '%GeneratorPrototype% is prototype of ' + fnName + '.prototype');
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('async functions', { skip: !asyncFns.length }, function (t) {
|
||||
var $AsyncFunction = GetIntrinsic('%AsyncFunction%');
|
||||
var $AsyncFunctionPrototype = GetIntrinsic('%AsyncFunctionPrototype%');
|
||||
|
||||
forEach(asyncFns, function (asyncFn) {
|
||||
var fnName = asyncFn.name;
|
||||
fnName = fnName ? "'" + fnName + "'" : 'asyncFn';
|
||||
|
||||
t.ok(asyncFn instanceof $AsyncFunction, fnName + ' instanceof %AsyncFunction%');
|
||||
t.ok($isProto($AsyncFunctionPrototype, asyncFn), '%AsyncFunctionPrototype% is prototype of ' + fnName);
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('async generator functions', { skip: asyncGenFns.length === 0 }, function (t) {
|
||||
var $AsyncGeneratorFunction = GetIntrinsic('%AsyncGeneratorFunction%');
|
||||
var $AsyncGeneratorFunctionPrototype = GetIntrinsic('%AsyncGenerator%');
|
||||
var $AsyncGeneratorPrototype = GetIntrinsic('%AsyncGeneratorPrototype%');
|
||||
|
||||
forEach(asyncGenFns, function (asyncGenFn) {
|
||||
var fnName = asyncGenFn.name;
|
||||
fnName = fnName ? "'" + fnName + "'" : 'asyncGenFn';
|
||||
|
||||
t.ok(asyncGenFn instanceof $AsyncGeneratorFunction, fnName + ' instanceof %AsyncGeneratorFunction%');
|
||||
t.ok($isProto($AsyncGeneratorFunctionPrototype, asyncGenFn), '%AsyncGenerator% is prototype of ' + fnName);
|
||||
t.ok($isProto($AsyncGeneratorPrototype, asyncGenFn.prototype), '%AsyncGeneratorPrototype% is prototype of ' + fnName + '.prototype');
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('%ThrowTypeError%', function (t) {
|
||||
var $ThrowTypeError = GetIntrinsic('%ThrowTypeError%');
|
||||
|
||||
t.equal(typeof $ThrowTypeError, 'function', 'is a function');
|
||||
t['throws'](
|
||||
$ThrowTypeError,
|
||||
TypeError,
|
||||
'%ThrowTypeError% throws a TypeError'
|
||||
);
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('allowMissing', { skip: asyncGenFns.length > 0 }, function (t) {
|
||||
t['throws'](
|
||||
function () { GetIntrinsic('%AsyncGeneratorPrototype%'); },
|
||||
TypeError,
|
||||
'throws when missing'
|
||||
);
|
||||
|
||||
t.equal(
|
||||
GetIntrinsic('%AsyncGeneratorPrototype%', true),
|
||||
undefined,
|
||||
'does not throw when allowMissing'
|
||||
);
|
||||
|
||||
t.end();
|
||||
});
|
11
node_modules/has-symbols/.eslintrc
generated
vendored
Normal file
11
node_modules/has-symbols/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"root": true,
|
||||
|
||||
"extends": "@ljharb",
|
||||
|
||||
"rules": {
|
||||
"max-statements-per-line": [2, { "max": 2 }],
|
||||
"no-magic-numbers": 0,
|
||||
"multiline-comment-style": 0,
|
||||
}
|
||||
}
|
12
node_modules/has-symbols/.github/FUNDING.yml
generated
vendored
Normal file
12
node_modules/has-symbols/.github/FUNDING.yml
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [ljharb]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: npm/has-symbols
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
9
node_modules/has-symbols/.nycrc
generated
vendored
Normal file
9
node_modules/has-symbols/.nycrc
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"all": true,
|
||||
"check-coverage": false,
|
||||
"reporter": ["text-summary", "text", "html", "json"],
|
||||
"exclude": [
|
||||
"coverage",
|
||||
"test"
|
||||
]
|
||||
}
|
75
node_modules/has-symbols/CHANGELOG.md
generated
vendored
Normal file
75
node_modules/has-symbols/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v1.0.3](https://github.com/inspect-js/has-symbols/compare/v1.0.2...v1.0.3) - 2022-03-01
|
||||
|
||||
### Commits
|
||||
|
||||
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`518b28f`](https://github.com/inspect-js/has-symbols/commit/518b28f6c5a516cbccae30794e40aa9f738b1693)
|
||||
- [meta] add `bugs` and `homepage` fields; reorder package.json [`c480b13`](https://github.com/inspect-js/has-symbols/commit/c480b13fd6802b557e1cef9749872cb5fdeef744)
|
||||
- [actions] reuse common workflows [`01d0ee0`](https://github.com/inspect-js/has-symbols/commit/01d0ee0a8d97c0947f5edb73eb722027a77b2b07)
|
||||
- [actions] update codecov uploader [`6424ebe`](https://github.com/inspect-js/has-symbols/commit/6424ebe86b2c9c7c3d2e9bd4413a4e4f168cb275)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`dfa7e7f`](https://github.com/inspect-js/has-symbols/commit/dfa7e7ff38b594645d8c8222aab895157fa7e282)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`0c8d436`](https://github.com/inspect-js/has-symbols/commit/0c8d43685c45189cea9018191d4fd7eca91c9d02)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`9026554`](https://github.com/inspect-js/has-symbols/commit/902655442a1bf88e72b42345494ef0c60f5d36ab)
|
||||
- [readme] add actions and codecov badges [`eaa9682`](https://github.com/inspect-js/has-symbols/commit/eaa9682f990f481d3acf7a1c7600bec36f7b3adc)
|
||||
- [Dev Deps] update `eslint`, `tape` [`bc7a3ba`](https://github.com/inspect-js/has-symbols/commit/bc7a3ba46f27b7743f8a2579732d59d1b9ac791e)
|
||||
- [Dev Deps] update `eslint`, `auto-changelog` [`0ace00a`](https://github.com/inspect-js/has-symbols/commit/0ace00af08a88cdd1e6ce0d60357d941c60c2d9f)
|
||||
- [meta] use `prepublishOnly` script for npm 7+ [`093f72b`](https://github.com/inspect-js/has-symbols/commit/093f72bc2b0ed00c781f444922a5034257bf561d)
|
||||
- [Tests] test on all 16 minors [`9b80d3d`](https://github.com/inspect-js/has-symbols/commit/9b80d3d9102529f04c20ec5b1fcc6e38426c6b03)
|
||||
|
||||
## [v1.0.2](https://github.com/inspect-js/has-symbols/compare/v1.0.1...v1.0.2) - 2021-02-27
|
||||
|
||||
### Fixed
|
||||
|
||||
- [Fix] use a universal way to get the original Symbol [`#11`](https://github.com/inspect-js/has-symbols/issues/11)
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] migrate tests to Github Actions [`90ae798`](https://github.com/inspect-js/has-symbols/commit/90ae79820bdfe7bc703d67f5f3c5e205f98556d3)
|
||||
- [meta] do not publish github action workflow files [`29e60a1`](https://github.com/inspect-js/has-symbols/commit/29e60a1b7c25c7f1acf7acff4a9320d0d10c49b4)
|
||||
- [Tests] run `nyc` on all tests [`8476b91`](https://github.com/inspect-js/has-symbols/commit/8476b915650d360915abe2522505abf4b0e8f0ae)
|
||||
- [readme] fix repo URLs, remove defunct badges [`126288e`](https://github.com/inspect-js/has-symbols/commit/126288ecc1797c0a40247a6b78bcb2e0bc5d7036)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `core-js`, `get-own-property-symbols` [`d84bdfa`](https://github.com/inspect-js/has-symbols/commit/d84bdfa48ac5188abbb4904b42614cd6c030940a)
|
||||
- [Tests] fix linting errors [`0df3070`](https://github.com/inspect-js/has-symbols/commit/0df3070b981b6c9f2ee530c09189a7f5c6def839)
|
||||
- [actions] add "Allow Edits" workflow [`1e6bc29`](https://github.com/inspect-js/has-symbols/commit/1e6bc29b188f32b9648657b07eda08504be5aa9c)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`36cea2a`](https://github.com/inspect-js/has-symbols/commit/36cea2addd4e6ec435f35a2656b4e9ef82498e9b)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`1278338`](https://github.com/inspect-js/has-symbols/commit/127833801865fbc2cc8979beb9ca869c7bfe8222)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`1493254`](https://github.com/inspect-js/has-symbols/commit/1493254eda13db5fb8fc5e4a3e8324b3d196029d)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js` [`b090bf2`](https://github.com/inspect-js/has-symbols/commit/b090bf214d3679a30edc1e2d729d466ab5183e1d)
|
||||
- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`4addb7a`](https://github.com/inspect-js/has-symbols/commit/4addb7ab4dc73f927ae99928d68817554fc21dc0)
|
||||
- [Dev Deps] update `auto-changelog`, `tape` [`81d0baf`](https://github.com/inspect-js/has-symbols/commit/81d0baf3816096a89a8558e8043895f7a7d10d8b)
|
||||
- [Dev Deps] update `auto-changelog`; add `aud` [`1a4e561`](https://github.com/inspect-js/has-symbols/commit/1a4e5612c25d91c3a03d509721d02630bc4fe3da)
|
||||
- [readme] remove unused testling URLs [`3000941`](https://github.com/inspect-js/has-symbols/commit/3000941f958046e923ed8152edb1ef4a599e6fcc)
|
||||
- [Tests] only audit prod deps [`692e974`](https://github.com/inspect-js/has-symbols/commit/692e9743c912410e9440207631a643a34b4741a1)
|
||||
- [Dev Deps] update `@ljharb/eslint-config` [`51c946c`](https://github.com/inspect-js/has-symbols/commit/51c946c7f6baa793ec5390bb5a45cdce16b4ba76)
|
||||
|
||||
## [v1.0.1](https://github.com/inspect-js/has-symbols/compare/v1.0.0...v1.0.1) - 2019-11-16
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] use shared travis-ci configs [`ce396c9`](https://github.com/inspect-js/has-symbols/commit/ce396c9419ff11c43d0da5d05cdbb79f7fb42229)
|
||||
- [Tests] up to `node` `v12.4`, `v11.15`, `v10.15`, `v9.11`, `v8.15`, `v7.10`, `v6.17`, `v4.9`; use `nvm install-latest-npm` [`0690732`](https://github.com/inspect-js/has-symbols/commit/0690732801f47ab429f39ba1962f522d5c462d6b)
|
||||
- [meta] add `auto-changelog` [`2163d0b`](https://github.com/inspect-js/has-symbols/commit/2163d0b7f36343076b8f947cd1667dd1750f26fc)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `safe-publish-latest`, `tape` [`8e0951f`](https://github.com/inspect-js/has-symbols/commit/8e0951f1a7a2e52068222b7bb73511761e6e4d9c)
|
||||
- [actions] add automatic rebasing / merge commit blocking [`b09cdb7`](https://github.com/inspect-js/has-symbols/commit/b09cdb7cd7ee39e7a769878f56e2d6066f5ccd1d)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `core-js`, `get-own-property-symbols`, `tape` [`1dd42cd`](https://github.com/inspect-js/has-symbols/commit/1dd42cd86183ed0c50f99b1062345c458babca91)
|
||||
- [meta] create FUNDING.yml [`aa57a17`](https://github.com/inspect-js/has-symbols/commit/aa57a17b19708906d1927f821ea8e73394d84ca4)
|
||||
- Only apps should have lockfiles [`a2d8bea`](https://github.com/inspect-js/has-symbols/commit/a2d8bea23a97d15c09eaf60f5b107fcf9a4d57aa)
|
||||
- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`9e96cb7`](https://github.com/inspect-js/has-symbols/commit/9e96cb783746cbed0c10ef78e599a8eaa7ebe193)
|
||||
- [meta] add `funding` field [`a0b32cf`](https://github.com/inspect-js/has-symbols/commit/a0b32cf68e803f963c1639b6d47b0a9d6440bab0)
|
||||
- [Dev Deps] update `safe-publish-latest` [`cb9f0a5`](https://github.com/inspect-js/has-symbols/commit/cb9f0a521a3a1790f1064d437edd33bb6c3d6af0)
|
||||
|
||||
## v1.0.0 - 2016-09-19
|
||||
|
||||
### Commits
|
||||
|
||||
- Tests. [`ecb6eb9`](https://github.com/inspect-js/has-symbols/commit/ecb6eb934e4883137f3f93b965ba5e0a98df430d)
|
||||
- package.json [`88a337c`](https://github.com/inspect-js/has-symbols/commit/88a337cee0864a0da35f5d19e69ff0ef0150e46a)
|
||||
- Initial commit [`42e1e55`](https://github.com/inspect-js/has-symbols/commit/42e1e5502536a2b8ac529c9443984acd14836b1c)
|
||||
- Initial implementation. [`33f5cc6`](https://github.com/inspect-js/has-symbols/commit/33f5cc6cdff86e2194b081ee842bfdc63caf43fb)
|
||||
- read me [`01f1170`](https://github.com/inspect-js/has-symbols/commit/01f1170188ff7cb1558aa297f6ba5b516c6d7b0c)
|
21
node_modules/has-symbols/LICENSE
generated
vendored
Normal file
21
node_modules/has-symbols/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016 Jordan Harband
|
||||
|
||||
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.
|
46
node_modules/has-symbols/README.md
generated
vendored
Normal file
46
node_modules/has-symbols/README.md
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
# has-symbols <sup>[![Version Badge][2]][1]</sup>
|
||||
|
||||
[![github actions][actions-image]][actions-url]
|
||||
[![coverage][codecov-image]][codecov-url]
|
||||
[![dependency status][5]][6]
|
||||
[![dev dependency status][7]][8]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][11]][1]
|
||||
|
||||
Determine if the JS environment has Symbol support. Supports spec, or shams.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var hasSymbols = require('has-symbols');
|
||||
|
||||
hasSymbols() === true; // if the environment has native Symbol support. Not polyfillable, not forgeable.
|
||||
|
||||
var hasSymbolsKinda = require('has-symbols/shams');
|
||||
hasSymbolsKinda() === true; // if the environment has a Symbol sham that mostly follows the spec.
|
||||
```
|
||||
|
||||
## Supported Symbol shams
|
||||
- get-own-property-symbols [npm](https://www.npmjs.com/package/get-own-property-symbols) | [github](https://github.com/WebReflection/get-own-property-symbols)
|
||||
- core-js [npm](https://www.npmjs.com/package/core-js) | [github](https://github.com/zloirock/core-js)
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[1]: https://npmjs.org/package/has-symbols
|
||||
[2]: https://versionbadg.es/inspect-js/has-symbols.svg
|
||||
[5]: https://david-dm.org/inspect-js/has-symbols.svg
|
||||
[6]: https://david-dm.org/inspect-js/has-symbols
|
||||
[7]: https://david-dm.org/inspect-js/has-symbols/dev-status.svg
|
||||
[8]: https://david-dm.org/inspect-js/has-symbols#info=devDependencies
|
||||
[11]: https://nodei.co/npm/has-symbols.png?downloads=true&stars=true
|
||||
[license-image]: https://img.shields.io/npm/l/has-symbols.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/has-symbols.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=has-symbols
|
||||
[codecov-image]: https://codecov.io/gh/inspect-js/has-symbols/branch/main/graphs/badge.svg
|
||||
[codecov-url]: https://app.codecov.io/gh/inspect-js/has-symbols/
|
||||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/has-symbols
|
||||
[actions-url]: https://github.com/inspect-js/has-symbols/actions
|
13
node_modules/has-symbols/index.js
generated
vendored
Normal file
13
node_modules/has-symbols/index.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
|
||||
var hasSymbolSham = require('./shams');
|
||||
|
||||
module.exports = function hasNativeSymbols() {
|
||||
if (typeof origSymbol !== 'function') { return false; }
|
||||
if (typeof Symbol !== 'function') { return false; }
|
||||
if (typeof origSymbol('foo') !== 'symbol') { return false; }
|
||||
if (typeof Symbol('bar') !== 'symbol') { return false; }
|
||||
|
||||
return hasSymbolSham();
|
||||
};
|
101
node_modules/has-symbols/package.json
generated
vendored
Normal file
101
node_modules/has-symbols/package.json
generated
vendored
Normal file
@ -0,0 +1,101 @@
|
||||
{
|
||||
"name": "has-symbols",
|
||||
"version": "1.0.3",
|
||||
"description": "Determine if the JS environment has Symbol support. Supports spec, or shams.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"prepublishOnly": "safe-publish-latest",
|
||||
"prepublish": "not-in-publish || npm run prepublishOnly",
|
||||
"pretest": "npm run --silent lint",
|
||||
"test": "npm run tests-only",
|
||||
"posttest": "aud --production",
|
||||
"tests-only": "npm run test:stock && npm run test:staging && npm run test:shams",
|
||||
"test:stock": "nyc node test",
|
||||
"test:staging": "nyc node --harmony --es-staging test",
|
||||
"test:shams": "npm run --silent test:shams:getownpropertysymbols && npm run --silent test:shams:corejs",
|
||||
"test:shams:corejs": "nyc node test/shams/core-js.js",
|
||||
"test:shams:getownpropertysymbols": "nyc node test/shams/get-own-property-symbols.js",
|
||||
"lint": "eslint --ext=js,mjs .",
|
||||
"version": "auto-changelog && git add CHANGELOG.md",
|
||||
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/inspect-js/has-symbols.git"
|
||||
},
|
||||
"keywords": [
|
||||
"Symbol",
|
||||
"symbols",
|
||||
"typeof",
|
||||
"sham",
|
||||
"polyfill",
|
||||
"native",
|
||||
"core-js",
|
||||
"ES6"
|
||||
],
|
||||
"author": {
|
||||
"name": "Jordan Harband",
|
||||
"email": "ljharb@gmail.com",
|
||||
"url": "http://ljharb.codes"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Jordan Harband",
|
||||
"email": "ljharb@gmail.com",
|
||||
"url": "http://ljharb.codes"
|
||||
}
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/ljharb/has-symbols/issues"
|
||||
},
|
||||
"homepage": "https://github.com/ljharb/has-symbols#readme",
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^20.2.3",
|
||||
"aud": "^2.0.0",
|
||||
"auto-changelog": "^2.4.0",
|
||||
"core-js": "^2.6.12",
|
||||
"eslint": "=8.8.0",
|
||||
"get-own-property-symbols": "^0.9.5",
|
||||
"nyc": "^10.3.2",
|
||||
"safe-publish-latest": "^2.0.0",
|
||||
"tape": "^5.5.2"
|
||||
},
|
||||
"testling": {
|
||||
"files": "test/index.js",
|
||||
"browsers": [
|
||||
"iexplore/6.0..latest",
|
||||
"firefox/3.0..6.0",
|
||||
"firefox/15.0..latest",
|
||||
"firefox/nightly",
|
||||
"chrome/4.0..10.0",
|
||||
"chrome/20.0..latest",
|
||||
"chrome/canary",
|
||||
"opera/10.0..latest",
|
||||
"opera/next",
|
||||
"safari/4.0..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"auto-changelog": {
|
||||
"output": "CHANGELOG.md",
|
||||
"template": "keepachangelog",
|
||||
"unreleased": false,
|
||||
"commitLimit": false,
|
||||
"backfillLimit": false,
|
||||
"hideCredit": true
|
||||
},
|
||||
"greenkeeper": {
|
||||
"ignore": [
|
||||
"core-js"
|
||||
]
|
||||
}
|
||||
}
|
42
node_modules/has-symbols/shams.js
generated
vendored
Normal file
42
node_modules/has-symbols/shams.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
'use strict';
|
||||
|
||||
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
||||
module.exports = function hasSymbols() {
|
||||
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
|
||||
if (typeof Symbol.iterator === 'symbol') { return true; }
|
||||
|
||||
var obj = {};
|
||||
var sym = Symbol('test');
|
||||
var symObj = Object(sym);
|
||||
if (typeof sym === 'string') { return false; }
|
||||
|
||||
if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
|
||||
if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
|
||||
|
||||
// temp disabled per https://github.com/ljharb/object.assign/issues/17
|
||||
// if (sym instanceof Symbol) { return false; }
|
||||
// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
|
||||
// if (!(symObj instanceof Symbol)) { return false; }
|
||||
|
||||
// if (typeof Symbol.prototype.toString !== 'function') { return false; }
|
||||
// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
|
||||
|
||||
var symVal = 42;
|
||||
obj[sym] = symVal;
|
||||
for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
|
||||
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
|
||||
|
||||
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
|
||||
|
||||
var syms = Object.getOwnPropertySymbols(obj);
|
||||
if (syms.length !== 1 || syms[0] !== sym) { return false; }
|
||||
|
||||
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
|
||||
|
||||
if (typeof Object.getOwnPropertyDescriptor === 'function') {
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
|
||||
if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
22
node_modules/has-symbols/test/index.js
generated
vendored
Normal file
22
node_modules/has-symbols/test/index.js
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var hasSymbols = require('../');
|
||||
var runSymbolTests = require('./tests');
|
||||
|
||||
test('interface', function (t) {
|
||||
t.equal(typeof hasSymbols, 'function', 'is a function');
|
||||
t.equal(typeof hasSymbols(), 'boolean', 'returns a boolean');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('Symbols are supported', { skip: !hasSymbols() }, function (t) {
|
||||
runSymbolTests(t);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('Symbols are not supported', { skip: hasSymbols() }, function (t) {
|
||||
t.equal(typeof Symbol, 'undefined', 'global Symbol is undefined');
|
||||
t.equal(typeof Object.getOwnPropertySymbols, 'undefined', 'Object.getOwnPropertySymbols does not exist');
|
||||
t.end();
|
||||
});
|
28
node_modules/has-symbols/test/shams/core-js.js
generated
vendored
Normal file
28
node_modules/has-symbols/test/shams/core-js.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
|
||||
if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') {
|
||||
test('has native Symbol support', function (t) {
|
||||
t.equal(typeof Symbol, 'function');
|
||||
t.equal(typeof Symbol(), 'symbol');
|
||||
t.end();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var hasSymbols = require('../../shams');
|
||||
|
||||
test('polyfilled Symbols', function (t) {
|
||||
/* eslint-disable global-require */
|
||||
t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling');
|
||||
require('core-js/fn/symbol');
|
||||
require('core-js/fn/symbol/to-string-tag');
|
||||
|
||||
require('../tests')(t);
|
||||
|
||||
var hasSymbolsAfter = hasSymbols();
|
||||
t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling');
|
||||
/* eslint-enable global-require */
|
||||
t.end();
|
||||
});
|
28
node_modules/has-symbols/test/shams/get-own-property-symbols.js
generated
vendored
Normal file
28
node_modules/has-symbols/test/shams/get-own-property-symbols.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
|
||||
if (typeof Symbol === 'function' && typeof Symbol() === 'symbol') {
|
||||
test('has native Symbol support', function (t) {
|
||||
t.equal(typeof Symbol, 'function');
|
||||
t.equal(typeof Symbol(), 'symbol');
|
||||
t.end();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var hasSymbols = require('../../shams');
|
||||
|
||||
test('polyfilled Symbols', function (t) {
|
||||
/* eslint-disable global-require */
|
||||
t.equal(hasSymbols(), false, 'hasSymbols is false before polyfilling');
|
||||
|
||||
require('get-own-property-symbols');
|
||||
|
||||
require('../tests')(t);
|
||||
|
||||
var hasSymbolsAfter = hasSymbols();
|
||||
t.equal(hasSymbolsAfter, true, 'hasSymbols is true after polyfilling');
|
||||
/* eslint-enable global-require */
|
||||
t.end();
|
||||
});
|
56
node_modules/has-symbols/test/tests.js
generated
vendored
Normal file
56
node_modules/has-symbols/test/tests.js
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
'use strict';
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
module.exports = function runSymbolTests(t) {
|
||||
t.equal(typeof Symbol, 'function', 'global Symbol is a function');
|
||||
|
||||
if (typeof Symbol !== 'function') { return false; }
|
||||
|
||||
t.notEqual(Symbol(), Symbol(), 'two symbols are not equal');
|
||||
|
||||
/*
|
||||
t.equal(
|
||||
Symbol.prototype.toString.call(Symbol('foo')),
|
||||
Symbol.prototype.toString.call(Symbol('foo')),
|
||||
'two symbols with the same description stringify the same'
|
||||
);
|
||||
*/
|
||||
|
||||
/*
|
||||
var foo = Symbol('foo');
|
||||
|
||||
t.notEqual(
|
||||
String(foo),
|
||||
String(Symbol('bar')),
|
||||
'two symbols with different descriptions do not stringify the same'
|
||||
);
|
||||
*/
|
||||
|
||||
t.equal(typeof Symbol.prototype.toString, 'function', 'Symbol#toString is a function');
|
||||
// t.equal(String(foo), Symbol.prototype.toString.call(foo), 'Symbol#toString equals String of the same symbol');
|
||||
|
||||
t.equal(typeof Object.getOwnPropertySymbols, 'function', 'Object.getOwnPropertySymbols is a function');
|
||||
|
||||
var obj = {};
|
||||
var sym = Symbol('test');
|
||||
var symObj = Object(sym);
|
||||
t.notEqual(typeof sym, 'string', 'Symbol is not a string');
|
||||
t.equal(Object.prototype.toString.call(sym), '[object Symbol]', 'symbol primitive Object#toStrings properly');
|
||||
t.equal(Object.prototype.toString.call(symObj), '[object Symbol]', 'symbol primitive Object#toStrings properly');
|
||||
|
||||
var symVal = 42;
|
||||
obj[sym] = symVal;
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
for (sym in obj) { t.fail('symbol property key was found in for..in of object'); }
|
||||
|
||||
t.deepEqual(Object.keys(obj), [], 'no enumerable own keys on symbol-valued object');
|
||||
t.deepEqual(Object.getOwnPropertyNames(obj), [], 'no own names on symbol-valued object');
|
||||
t.deepEqual(Object.getOwnPropertySymbols(obj), [sym], 'one own symbol on symbol-valued object');
|
||||
t.equal(Object.prototype.propertyIsEnumerable.call(obj, sym), true, 'symbol is enumerable');
|
||||
t.deepEqual(Object.getOwnPropertyDescriptor(obj, sym), {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
value: 42,
|
||||
writable: true
|
||||
}, 'property descriptor is correct');
|
||||
};
|
22
node_modules/has/LICENSE-MIT
generated
vendored
Normal file
22
node_modules/has/LICENSE-MIT
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
Copyright (c) 2013 Thiago de Arruda
|
||||
|
||||
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.
|
18
node_modules/has/README.md
generated
vendored
Normal file
18
node_modules/has/README.md
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
# has
|
||||
|
||||
> Object.prototype.hasOwnProperty.call shortcut
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
npm install --save has
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var has = require('has');
|
||||
|
||||
has({}, 'hasOwnProperty'); // false
|
||||
has(Object.prototype, 'hasOwnProperty'); // true
|
||||
```
|
48
node_modules/has/package.json
generated
vendored
Normal file
48
node_modules/has/package.json
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "has",
|
||||
"description": "Object.prototype.hasOwnProperty.call shortcut",
|
||||
"version": "1.0.3",
|
||||
"homepage": "https://github.com/tarruda/has",
|
||||
"author": {
|
||||
"name": "Thiago de Arruda",
|
||||
"email": "tpadilha84@gmail.com"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Jordan Harband",
|
||||
"email": "ljharb@gmail.com",
|
||||
"url": "http://ljharb.codes"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/tarruda/has.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/tarruda/has/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "https://github.com/tarruda/has/blob/master/LICENSE-MIT"
|
||||
}
|
||||
],
|
||||
"main": "./src",
|
||||
"dependencies": {
|
||||
"function-bind": "^1.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^12.2.1",
|
||||
"eslint": "^4.19.1",
|
||||
"tape": "^4.9.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4.0"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"pretest": "npm run lint",
|
||||
"test": "tape test"
|
||||
}
|
||||
}
|
5
node_modules/has/src/index.js
generated
vendored
Normal file
5
node_modules/has/src/index.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
var bind = require('function-bind');
|
||||
|
||||
module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
|
10
node_modules/has/test/index.js
generated
vendored
Normal file
10
node_modules/has/test/index.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var has = require('../');
|
||||
|
||||
test('has', function (t) {
|
||||
t.equal(has({}, 'hasOwnProperty'), false, 'object literal does not have own property "hasOwnProperty"');
|
||||
t.equal(has(Object.prototype, 'hasOwnProperty'), true, 'Object.prototype has own property "hasOwnProperty"');
|
||||
t.end();
|
||||
});
|
36
node_modules/hosted-git-info/CHANGELOG.md
generated
vendored
36
node_modules/hosted-git-info/CHANGELOG.md
generated
vendored
@ -2,6 +2,42 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
<a name="2.8.9"></a>
|
||||
## [2.8.9](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9) (2021-04-07)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* backport regex fix from [#76](https://github.com/npm/hosted-git-info/issues/76) ([29adfe5](https://github.com/npm/hosted-git-info/commit/29adfe5)), closes [#84](https://github.com/npm/hosted-git-info/issues/84)
|
||||
|
||||
|
||||
|
||||
<a name="2.8.8"></a>
|
||||
## [2.8.8](https://github.com/npm/hosted-git-info/compare/v2.8.7...v2.8.8) (2020-02-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* [#61](https://github.com/npm/hosted-git-info/issues/61) & [#65](https://github.com/npm/hosted-git-info/issues/65) addressing issues w/ url.URL implmentation which regressed node 6 support ([5038b18](https://github.com/npm/hosted-git-info/commit/5038b18)), closes [#66](https://github.com/npm/hosted-git-info/issues/66)
|
||||
|
||||
|
||||
|
||||
<a name="2.8.7"></a>
|
||||
## [2.8.7](https://github.com/npm/hosted-git-info/compare/v2.8.6...v2.8.7) (2020-02-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Do not attempt to use url.URL when unavailable ([2d0bb66](https://github.com/npm/hosted-git-info/commit/2d0bb66)), closes [#61](https://github.com/npm/hosted-git-info/issues/61) [#62](https://github.com/npm/hosted-git-info/issues/62)
|
||||
* Do not pass scp-style URLs to the WhatWG url.URL ([f2cdfcf](https://github.com/npm/hosted-git-info/commit/f2cdfcf)), closes [#60](https://github.com/npm/hosted-git-info/issues/60)
|
||||
|
||||
|
||||
|
||||
<a name="2.8.6"></a>
|
||||
## [2.8.6](https://github.com/npm/hosted-git-info/compare/v2.8.5...v2.8.6) (2020-02-25)
|
||||
|
||||
|
||||
|
||||
<a name="2.8.5"></a>
|
||||
## [2.8.5](https://github.com/npm/hosted-git-info/compare/v2.8.4...v2.8.5) (2019-10-07)
|
||||
|
||||
|
31
node_modules/hosted-git-info/index.js
generated
vendored
31
node_modules/hosted-git-info/index.js
generated
vendored
@ -41,13 +41,13 @@ function fromUrl (giturl, opts) {
|
||||
isGitHubShorthand(giturl) ? 'github:' + giturl : giturl
|
||||
)
|
||||
var parsed = parseGitUrl(url)
|
||||
var shortcutMatch = url.match(new RegExp('^([^:]+):(?:(?:[^@:]+(?:[^@]+)?@)?([^/]*))[/](.+?)(?:[.]git)?($|#)'))
|
||||
var shortcutMatch = url.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/)
|
||||
var matches = Object.keys(gitHosts).map(function (gitHostName) {
|
||||
try {
|
||||
var gitHostInfo = gitHosts[gitHostName]
|
||||
var auth = null
|
||||
if (parsed.auth && authProtocols[parsed.protocol]) {
|
||||
auth = decodeURIComponent(parsed.auth)
|
||||
auth = parsed.auth
|
||||
}
|
||||
var committish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null
|
||||
var user = null
|
||||
@ -55,7 +55,7 @@ function fromUrl (giturl, opts) {
|
||||
var defaultRepresentation = null
|
||||
if (shortcutMatch && shortcutMatch[1] === gitHostName) {
|
||||
user = shortcutMatch[2] && decodeURIComponent(shortcutMatch[2])
|
||||
project = decodeURIComponent(shortcutMatch[3])
|
||||
project = decodeURIComponent(shortcutMatch[3].replace(/\.git$/, ''))
|
||||
defaultRepresentation = 'shortcut'
|
||||
} else {
|
||||
if (parsed.host && parsed.host !== gitHostInfo.domain && parsed.host.replace(/^www[.]/, '') !== gitHostInfo.domain) return
|
||||
@ -106,7 +106,30 @@ function fixupUnqualifiedGist (giturl) {
|
||||
|
||||
function parseGitUrl (giturl) {
|
||||
var matched = giturl.match(/^([^@]+)@([^:/]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/)
|
||||
if (!matched) return url.parse(giturl)
|
||||
if (!matched) {
|
||||
var legacy = url.parse(giturl)
|
||||
// If we don't have url.URL, then sorry, this is just not fixable.
|
||||
// This affects Node <= 6.12.
|
||||
if (legacy.auth && typeof url.URL === 'function') {
|
||||
// git urls can be in the form of scp-style/ssh-connect strings, like
|
||||
// git+ssh://user@host.com:some/path, which the legacy url parser
|
||||
// supports, but WhatWG url.URL class does not. However, the legacy
|
||||
// parser de-urlencodes the username and password, so something like
|
||||
// https://user%3An%40me:p%40ss%3Aword@x.com/ becomes
|
||||
// https://user:n@me:p@ss:word@x.com/ which is all kinds of wrong.
|
||||
// Pull off just the auth and host, so we dont' get the confusing
|
||||
// scp-style URL, then pass that to the WhatWG parser to get the
|
||||
// auth properly escaped.
|
||||
var authmatch = giturl.match(/[^@]+@[^:/]+/)
|
||||
/* istanbul ignore else - this should be impossible */
|
||||
if (authmatch) {
|
||||
var whatwg = new url.URL(authmatch[0])
|
||||
legacy.auth = whatwg.username || ''
|
||||
if (whatwg.password) legacy.auth += ':' + whatwg.password
|
||||
}
|
||||
}
|
||||
return legacy
|
||||
}
|
||||
return {
|
||||
protocol: 'git+ssh:',
|
||||
slashes: true,
|
||||
|
79
node_modules/hosted-git-info/package.json
generated
vendored
79
node_modules/hosted-git-info/package.json
generated
vendored
@ -1,42 +1,32 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"hosted-git-info@2.8.5",
|
||||
"/home/stCarolas/Coding/projects/setup-maven"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "hosted-git-info@2.8.5",
|
||||
"_id": "hosted-git-info@2.8.5",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-kssjab8CvdXfcXMXVcvsXum4Hwdq9XGtRD3TteMEvEbq0LXyiNQr6AprqKqfeaDXze7SxWvRxdpwE6ku7ikLkg==",
|
||||
"_location": "/hosted-git-info",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "hosted-git-info@2.8.5",
|
||||
"name": "hosted-git-info",
|
||||
"escapedName": "hosted-git-info",
|
||||
"rawSpec": "2.8.5",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.8.5"
|
||||
"version": "2.8.9",
|
||||
"description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/npm/hosted-git-info.git"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/normalize-package-data"
|
||||
"keywords": [
|
||||
"git",
|
||||
"github",
|
||||
"bitbucket",
|
||||
"gitlab"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz",
|
||||
"_spec": "2.8.5",
|
||||
"_where": "/home/stCarolas/Coding/projects/setup-maven",
|
||||
"author": {
|
||||
"name": "Rebecca Turner",
|
||||
"email": "me@re-becca.org",
|
||||
"url": "http://re-becca.org"
|
||||
},
|
||||
"author": "Rebecca Turner <me@re-becca.org> (http://re-becca.org)",
|
||||
"license": "ISC",
|
||||
"bugs": {
|
||||
"url": "https://github.com/npm/hosted-git-info/issues"
|
||||
},
|
||||
"description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab",
|
||||
"homepage": "https://github.com/npm/hosted-git-info",
|
||||
"scripts": {
|
||||
"prerelease": "npm t",
|
||||
"postrelease": "npm publish --tag=ancient-legacy-fixes && git push --follow-tags",
|
||||
"posttest": "standard",
|
||||
"release": "standard-version -s",
|
||||
"test:coverage": "tap --coverage-report=html -J --coverage=90 --no-esm test/*.js",
|
||||
"test": "tap -J --coverage=90 --no-esm test/*.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"standard": "^11.0.1",
|
||||
"standard-version": "^4.4.0",
|
||||
@ -46,28 +36,5 @@
|
||||
"index.js",
|
||||
"git-host.js",
|
||||
"git-host-info.js"
|
||||
],
|
||||
"homepage": "https://github.com/npm/hosted-git-info",
|
||||
"keywords": [
|
||||
"git",
|
||||
"github",
|
||||
"bitbucket",
|
||||
"gitlab"
|
||||
],
|
||||
"license": "ISC",
|
||||
"main": "index.js",
|
||||
"name": "hosted-git-info",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/npm/hosted-git-info.git"
|
||||
},
|
||||
"scripts": {
|
||||
"postrelease": "npm publish --tag=ancient-legacy-fixes && git push --follow-tags",
|
||||
"prerelease": "npm t",
|
||||
"pretest": "standard",
|
||||
"release": "standard-version -s",
|
||||
"test": "tap -J --100 --no-esm test/*.js",
|
||||
"test:coverage": "tap --coverage-report=html -J --100 --no-esm test/*.js"
|
||||
},
|
||||
"version": "2.8.5"
|
||||
]
|
||||
}
|
||||
|
266
node_modules/node-fetch/CHANGELOG.md
generated
vendored
266
node_modules/node-fetch/CHANGELOG.md
generated
vendored
@ -1,266 +0,0 @@
|
||||
|
||||
Changelog
|
||||
=========
|
||||
|
||||
|
||||
# 2.x release
|
||||
|
||||
## v2.6.0
|
||||
|
||||
- Enhance: `options.agent`, it now accepts a function that returns custom http(s).Agent instance based on current URL, see readme for more information.
|
||||
- Fix: incorrect `Content-Length` was returned for stream body in 2.5.0 release; note that `node-fetch` doesn't calculate content length for stream body.
|
||||
- Fix: `Response.url` should return empty string instead of `null` by default.
|
||||
|
||||
## v2.5.0
|
||||
|
||||
- Enhance: `Response` object now includes `redirected` property.
|
||||
- Enhance: `fetch()` now accepts third-party `Blob` implementation as body.
|
||||
- Other: disable `package-lock.json` generation as we never commit them.
|
||||
- Other: dev dependency update.
|
||||
- Other: readme update.
|
||||
|
||||
## v2.4.1
|
||||
|
||||
- Fix: `Blob` import rule for node < 10, as `Readable` isn't a named export.
|
||||
|
||||
## v2.4.0
|
||||
|
||||
- Enhance: added `Brotli` compression support (using node's zlib).
|
||||
- Enhance: updated `Blob` implementation per spec.
|
||||
- Fix: set content type automatically for `URLSearchParams`.
|
||||
- Fix: `Headers` now reject empty header names.
|
||||
- Fix: test cases, as node 12+ no longer accepts invalid header response.
|
||||
|
||||
## v2.3.0
|
||||
|
||||
- Enhance: added `AbortSignal` support, with README example.
|
||||
- Enhance: handle invalid `Location` header during redirect by rejecting them explicitly with `FetchError`.
|
||||
- Fix: update `browser.js` to support react-native environment, where `self` isn't available globally.
|
||||
|
||||
## v2.2.1
|
||||
|
||||
- Fix: `compress` flag shouldn't overwrite existing `Accept-Encoding` header.
|
||||
- Fix: multiple `import` rules, where `PassThrough` etc. doesn't have a named export when using node <10 and `--exerimental-modules` flag.
|
||||
- Other: Better README.
|
||||
|
||||
## v2.2.0
|
||||
|
||||
- Enhance: Support all `ArrayBuffer` view types
|
||||
- Enhance: Support Web Workers
|
||||
- Enhance: Support Node.js' `--experimental-modules` mode; deprecate `.es.js` file
|
||||
- Fix: Add `__esModule` property to the exports object
|
||||
- Other: Better example in README for writing response to a file
|
||||
- Other: More tests for Agent
|
||||
|
||||
## v2.1.2
|
||||
|
||||
- Fix: allow `Body` methods to work on `ArrayBuffer`-backed `Body` objects
|
||||
- Fix: reject promise returned by `Body` methods when the accumulated `Buffer` exceeds the maximum size
|
||||
- Fix: support custom `Host` headers with any casing
|
||||
- Fix: support importing `fetch()` from TypeScript in `browser.js`
|
||||
- Fix: handle the redirect response body properly
|
||||
|
||||
## v2.1.1
|
||||
|
||||
Fix packaging errors in v2.1.0.
|
||||
|
||||
## v2.1.0
|
||||
|
||||
- Enhance: allow using ArrayBuffer as the `body` of a `fetch()` or `Request`
|
||||
- Fix: store HTTP headers of a `Headers` object internally with the given case, for compatibility with older servers that incorrectly treated header names in a case-sensitive manner
|
||||
- Fix: silently ignore invalid HTTP headers
|
||||
- Fix: handle HTTP redirect responses without a `Location` header just like non-redirect responses
|
||||
- Fix: include bodies when following a redirection when appropriate
|
||||
|
||||
## v2.0.0
|
||||
|
||||
This is a major release. Check [our upgrade guide](https://github.com/bitinn/node-fetch/blob/master/UPGRADE-GUIDE.md) for an overview on some key differences between v1 and v2.
|
||||
|
||||
### General changes
|
||||
|
||||
- Major: Node.js 0.10.x and 0.12.x support is dropped
|
||||
- Major: `require('node-fetch/lib/response')` etc. is now unsupported; use `require('node-fetch').Response` or ES6 module imports
|
||||
- Enhance: start testing on Node.js v4.x, v6.x, v8.x LTS, as well as v9.x stable
|
||||
- Enhance: use Rollup to produce a distributed bundle (less memory overhead and faster startup)
|
||||
- Enhance: make `Object.prototype.toString()` on Headers, Requests, and Responses return correct class strings
|
||||
- Other: rewrite in ES2015 using Babel
|
||||
- Other: use Codecov for code coverage tracking
|
||||
- Other: update package.json script for npm 5
|
||||
- Other: `encoding` module is now optional (alpha.7)
|
||||
- Other: expose browser.js through package.json, avoid bundling mishaps (alpha.9)
|
||||
- Other: allow TypeScript to `import` node-fetch by exposing default (alpha.9)
|
||||
|
||||
### HTTP requests
|
||||
|
||||
- Major: overwrite user's `Content-Length` if we can be sure our information is correct (per spec)
|
||||
- Fix: errors in a response are caught before the body is accessed
|
||||
- Fix: support WHATWG URL objects, created by `whatwg-url` package or `require('url').URL` in Node.js 7+
|
||||
|
||||
### Response and Request classes
|
||||
|
||||
- Major: `response.text()` no longer attempts to detect encoding, instead always opting for UTF-8 (per spec); use `response.textConverted()` for the v1 behavior
|
||||
- Major: make `response.json()` throw error instead of returning an empty object on 204 no-content respose (per spec; reverts behavior changed in v1.6.2)
|
||||
- Major: internal methods are no longer exposed
|
||||
- Major: throw error when a `GET` or `HEAD` Request is constructed with a non-null body (per spec)
|
||||
- Enhance: add `response.arrayBuffer()` (also applies to Requests)
|
||||
- Enhance: add experimental `response.blob()` (also applies to Requests)
|
||||
- Enhance: `URLSearchParams` is now accepted as a body
|
||||
- Enhance: wrap `response.json()` json parsing error as `FetchError`
|
||||
- Fix: fix Request and Response with `null` body
|
||||
|
||||
### Headers class
|
||||
|
||||
- Major: remove `headers.getAll()`; make `get()` return all headers delimited by commas (per spec)
|
||||
- Enhance: make Headers iterable
|
||||
- Enhance: make Headers constructor accept an array of tuples
|
||||
- Enhance: make sure header names and values are valid in HTTP
|
||||
- Fix: coerce Headers prototype function parameters to strings, where applicable
|
||||
|
||||
### Documentation
|
||||
|
||||
- Enhance: more comprehensive API docs
|
||||
- Enhance: add a list of default headers in README
|
||||
|
||||
|
||||
# 1.x release
|
||||
|
||||
## backport releases (v1.7.0 and beyond)
|
||||
|
||||
See [changelog on 1.x branch](https://github.com/bitinn/node-fetch/blob/1.x/CHANGELOG.md) for details.
|
||||
|
||||
## v1.6.3
|
||||
|
||||
- Enhance: error handling document to explain `FetchError` design
|
||||
- Fix: support `form-data` 2.x releases (requires `form-data` >= 2.1.0)
|
||||
|
||||
## v1.6.2
|
||||
|
||||
- Enhance: minor document update
|
||||
- Fix: response.json() returns empty object on 204 no-content response instead of throwing a syntax error
|
||||
|
||||
## v1.6.1
|
||||
|
||||
- Fix: if `res.body` is a non-stream non-formdata object, we will call `body.toString` and send it as a string
|
||||
- Fix: `counter` value is incorrectly set to `follow` value when wrapping Request instance
|
||||
- Fix: documentation update
|
||||
|
||||
## v1.6.0
|
||||
|
||||
- Enhance: added `res.buffer()` api for convenience, it returns body as a Node.js buffer
|
||||
- Enhance: better old server support by handling raw deflate response
|
||||
- Enhance: skip encoding detection for non-HTML/XML response
|
||||
- Enhance: minor document update
|
||||
- Fix: HEAD request doesn't need decompression, as body is empty
|
||||
- Fix: `req.body` now accepts a Node.js buffer
|
||||
|
||||
## v1.5.3
|
||||
|
||||
- Fix: handle 204 and 304 responses when body is empty but content-encoding is gzip/deflate
|
||||
- Fix: allow resolving response and cloned response in any order
|
||||
- Fix: avoid setting `content-length` when `form-data` body use streams
|
||||
- Fix: send DELETE request with content-length when body is present
|
||||
- Fix: allow any url when calling new Request, but still reject non-http(s) url in fetch
|
||||
|
||||
## v1.5.2
|
||||
|
||||
- Fix: allow node.js core to handle keep-alive connection pool when passing a custom agent
|
||||
|
||||
## v1.5.1
|
||||
|
||||
- Fix: redirect mode `manual` should work even when there is no redirection or broken redirection
|
||||
|
||||
## v1.5.0
|
||||
|
||||
- Enhance: rejected promise now use custom `Error` (thx to @pekeler)
|
||||
- Enhance: `FetchError` contains `err.type` and `err.code`, allows for better error handling (thx to @pekeler)
|
||||
- Enhance: basic support for redirect mode `manual` and `error`, allows for location header extraction (thx to @jimmywarting for the initial PR)
|
||||
|
||||
## v1.4.1
|
||||
|
||||
- Fix: wrapping Request instance with FormData body again should preserve the body as-is
|
||||
|
||||
## v1.4.0
|
||||
|
||||
- Enhance: Request and Response now have `clone` method (thx to @kirill-konshin for the initial PR)
|
||||
- Enhance: Request and Response now have proper string and buffer body support (thx to @kirill-konshin)
|
||||
- Enhance: Body constructor has been refactored out (thx to @kirill-konshin)
|
||||
- Enhance: Headers now has `forEach` method (thx to @tricoder42)
|
||||
- Enhance: back to 100% code coverage
|
||||
- Fix: better form-data support (thx to @item4)
|
||||
- Fix: better character encoding detection under chunked encoding (thx to @dsuket for the initial PR)
|
||||
|
||||
## v1.3.3
|
||||
|
||||
- Fix: make sure `Content-Length` header is set when body is string for POST/PUT/PATCH requests
|
||||
- Fix: handle body stream error, for cases such as incorrect `Content-Encoding` header
|
||||
- Fix: when following certain redirects, use `GET` on subsequent request per Fetch Spec
|
||||
- Fix: `Request` and `Response` constructors now parse headers input using `Headers`
|
||||
|
||||
## v1.3.2
|
||||
|
||||
- Enhance: allow auto detect of form-data input (no `FormData` spec on node.js, this is form-data specific feature)
|
||||
|
||||
## v1.3.1
|
||||
|
||||
- Enhance: allow custom host header to be set (server-side only feature, as it's a forbidden header on client-side)
|
||||
|
||||
## v1.3.0
|
||||
|
||||
- Enhance: now `fetch.Request` is exposed as well
|
||||
|
||||
## v1.2.1
|
||||
|
||||
- Enhance: `Headers` now normalized `Number` value to `String`, prevent common mistakes
|
||||
|
||||
## v1.2.0
|
||||
|
||||
- Enhance: now fetch.Headers and fetch.Response are exposed, making testing easier
|
||||
|
||||
## v1.1.2
|
||||
|
||||
- Fix: `Headers` should only support `String` and `Array` properties, and ignore others
|
||||
|
||||
## v1.1.1
|
||||
|
||||
- Enhance: now req.headers accept both plain object and `Headers` instance
|
||||
|
||||
## v1.1.0
|
||||
|
||||
- Enhance: timeout now also applies to response body (in case of slow response)
|
||||
- Fix: timeout is now cleared properly when fetch is done/has failed
|
||||
|
||||
## v1.0.6
|
||||
|
||||
- Fix: less greedy content-type charset matching
|
||||
|
||||
## v1.0.5
|
||||
|
||||
- Fix: when `follow = 0`, fetch should not follow redirect
|
||||
- Enhance: update tests for better coverage
|
||||
- Enhance: code formatting
|
||||
- Enhance: clean up doc
|
||||
|
||||
## v1.0.4
|
||||
|
||||
- Enhance: test iojs support
|
||||
- Enhance: timeout attached to socket event only fire once per redirect
|
||||
|
||||
## v1.0.3
|
||||
|
||||
- Fix: response size limit should reject large chunk
|
||||
- Enhance: added character encoding detection for xml, such as rss/atom feed (encoding in DTD)
|
||||
|
||||
## v1.0.2
|
||||
|
||||
- Fix: added res.ok per spec change
|
||||
|
||||
## v1.0.0
|
||||
|
||||
- Enhance: better test coverage and doc
|
||||
|
||||
|
||||
# 0.x release
|
||||
|
||||
## v0.1
|
||||
|
||||
- Major: initial public release
|
53
node_modules/node-fetch/README.md
generated
vendored
53
node_modules/node-fetch/README.md
generated
vendored
@ -5,11 +5,14 @@ node-fetch
|
||||
[![build status][travis-image]][travis-url]
|
||||
[![coverage status][codecov-image]][codecov-url]
|
||||
[![install size][install-size-image]][install-size-url]
|
||||
[![Discord][discord-image]][discord-url]
|
||||
|
||||
A light-weight module that brings `window.fetch` to Node.js
|
||||
|
||||
(We are looking for [v2 maintainers and collaborators](https://github.com/bitinn/node-fetch/issues/567))
|
||||
|
||||
[![Backers][opencollective-image]][opencollective-url]
|
||||
|
||||
<!-- TOC -->
|
||||
|
||||
- [Motivation](#motivation)
|
||||
@ -48,7 +51,7 @@ A light-weight module that brings `window.fetch` to Node.js
|
||||
|
||||
## Motivation
|
||||
|
||||
Instead of implementing `XMLHttpRequest` in Node.js to run browser-specific [Fetch polyfill](https://github.com/github/fetch), why not go from native `http` to `fetch` API directly? Hence `node-fetch`, minimal code for a `window.fetch` compatible API on Node.js runtime.
|
||||
Instead of implementing `XMLHttpRequest` in Node.js to run browser-specific [Fetch polyfill](https://github.com/github/fetch), why not go from native `http` to `fetch` API directly? Hence, `node-fetch`, minimal code for a `window.fetch` compatible API on Node.js runtime.
|
||||
|
||||
See Matt Andrews' [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) or Leonardo Quixada's [cross-fetch](https://github.com/lquixada/cross-fetch) for isomorphic usage (exports `node-fetch` for server-side, `whatwg-fetch` for client-side).
|
||||
|
||||
@ -56,9 +59,9 @@ See Matt Andrews' [isomorphic-fetch](https://github.com/matthew-andrews/isomorph
|
||||
|
||||
- Stay consistent with `window.fetch` API.
|
||||
- Make conscious trade-off when following [WHATWG fetch spec][whatwg-fetch] and [stream spec](https://streams.spec.whatwg.org/) implementation details, document known differences.
|
||||
- Use native promise, but allow substituting it with [insert your favorite promise library].
|
||||
- Use native Node streams for body, on both request and response.
|
||||
- Decode content encoding (gzip/deflate) properly, and convert string output (such as `res.text()` and `res.json()`) to UTF-8 automatically.
|
||||
- Use native promise but allow substituting it with [insert your favorite promise library].
|
||||
- Use native Node streams for body on both request and response.
|
||||
- Decode content encoding (gzip/deflate) properly and convert string output (such as `res.text()` and `res.json()`) to UTF-8 automatically.
|
||||
- Useful extensions such as timeout, redirect limit, response size limit, [explicit errors](ERROR-HANDLING.md) for troubleshooting.
|
||||
|
||||
## Difference from client-side fetch
|
||||
@ -72,16 +75,16 @@ See Matt Andrews' [isomorphic-fetch](https://github.com/matthew-andrews/isomorph
|
||||
Current stable release (`2.x`)
|
||||
|
||||
```sh
|
||||
$ npm install node-fetch --save
|
||||
$ npm install node-fetch
|
||||
```
|
||||
|
||||
## Loading and configuring the module
|
||||
We suggest you load the module via `require`, pending the stabalizing of es modules in node:
|
||||
We suggest you load the module via `require` until the stabilization of ES modules in node:
|
||||
```js
|
||||
const fetch = require('node-fetch');
|
||||
```
|
||||
|
||||
If you are using a Promise library other than native, set it through fetch.Promise:
|
||||
If you are using a Promise library other than native, set it through `fetch.Promise`:
|
||||
```js
|
||||
const Bluebird = require('bluebird');
|
||||
|
||||
@ -90,7 +93,7 @@ fetch.Promise = Bluebird;
|
||||
|
||||
## Common Usage
|
||||
|
||||
NOTE: The documentation below is up-to-date with `2.x` releases, [see `1.x` readme](https://github.com/bitinn/node-fetch/blob/1.x/README.md), [changelog](https://github.com/bitinn/node-fetch/blob/1.x/CHANGELOG.md) and [2.x upgrade guide](UPGRADE-GUIDE.md) for the differences.
|
||||
NOTE: The documentation below is up-to-date with `2.x` releases; see the [`1.x` readme](https://github.com/bitinn/node-fetch/blob/1.x/README.md), [changelog](https://github.com/bitinn/node-fetch/blob/1.x/CHANGELOG.md) and [2.x upgrade guide](UPGRADE-GUIDE.md) for the differences.
|
||||
|
||||
#### Plain text or HTML
|
||||
```js
|
||||
@ -146,9 +149,9 @@ fetch('https://httpbin.org/post', { method: 'POST', body: params })
|
||||
```
|
||||
|
||||
#### Handling exceptions
|
||||
NOTE: 3xx-5xx responses are *NOT* exceptions, and should be handled in `then()`, see the next section.
|
||||
NOTE: 3xx-5xx responses are *NOT* exceptions and should be handled in `then()`; see the next section for more information.
|
||||
|
||||
Adding a catch to the fetch promise chain will catch *all* exceptions, such as errors originating from node core libraries, like network errors, and operational errors which are instances of FetchError. See the [error handling document](ERROR-HANDLING.md) for more details.
|
||||
Adding a catch to the fetch promise chain will catch *all* exceptions, such as errors originating from node core libraries, network errors and operational errors, which are instances of FetchError. See the [error handling document](ERROR-HANDLING.md) for more details.
|
||||
|
||||
```js
|
||||
fetch('https://domain.invalid/')
|
||||
@ -186,7 +189,7 @@ fetch('https://assets-cdn.github.com/images/modules/logos_page/Octocat.png')
|
||||
```
|
||||
|
||||
#### Buffer
|
||||
If you prefer to cache binary data in full, use buffer(). (NOTE: buffer() is a `node-fetch` only API)
|
||||
If you prefer to cache binary data in full, use buffer(). (NOTE: `buffer()` is a `node-fetch`-only API)
|
||||
|
||||
```js
|
||||
const fileType = require('file-type');
|
||||
@ -211,7 +214,7 @@ fetch('https://github.com/')
|
||||
|
||||
#### Extract Set-Cookie Header
|
||||
|
||||
Unlike browsers, you can access raw `Set-Cookie` headers manually using `Headers.raw()`, this is a `node-fetch` only API.
|
||||
Unlike browsers, you can access raw `Set-Cookie` headers manually using `Headers.raw()`. This is a `node-fetch` only API.
|
||||
|
||||
```js
|
||||
fetch(url).then(res => {
|
||||
@ -263,11 +266,11 @@ fetch('https://httpbin.org/post', options)
|
||||
|
||||
#### Request cancellation with AbortSignal
|
||||
|
||||
> NOTE: You may only cancel streamed requests on Node >= v8.0.0
|
||||
> NOTE: You may cancel streamed requests only on Node >= v8.0.0
|
||||
|
||||
You may cancel requests with `AbortController`. A suggested implementation is [`abort-controller`](https://www.npmjs.com/package/abort-controller).
|
||||
|
||||
An example of timing out a request after 150ms could be achieved as follows:
|
||||
An example of timing out a request after 150ms could be achieved as the following:
|
||||
|
||||
```js
|
||||
import AbortController from 'abort-controller';
|
||||
@ -308,7 +311,7 @@ See [test cases](https://github.com/bitinn/node-fetch/blob/master/test/test.js)
|
||||
|
||||
Perform an HTTP(S) fetch.
|
||||
|
||||
`url` should be an absolute url, such as `https://example.com/`. A path-relative URL (`/file/under/root`) or protocol-relative URL (`//can-be-http-or-https.com/`) will result in a rejected promise.
|
||||
`url` should be an absolute url, such as `https://example.com/`. A path-relative URL (`/file/under/root`) or protocol-relative URL (`//can-be-http-or-https.com/`) will result in a rejected `Promise`.
|
||||
|
||||
<a id="fetch-options"></a>
|
||||
### Options
|
||||
@ -350,7 +353,7 @@ Note: when `body` is a `Stream`, `Content-Length` is not set automatically.
|
||||
|
||||
##### Custom Agent
|
||||
|
||||
The `agent` option allows you to specify networking related options that's out of the scope of Fetch. Including and not limit to:
|
||||
The `agent` option allows you to specify networking related options which are out of the scope of Fetch, including and not limited to the following:
|
||||
|
||||
- Support self-signed certificate
|
||||
- Use only IPv4 or IPv6
|
||||
@ -358,7 +361,7 @@ The `agent` option allows you to specify networking related options that's out o
|
||||
|
||||
See [`http.Agent`](https://nodejs.org/api/http.html#http_new_agent_options) for more information.
|
||||
|
||||
In addition, `agent` option accepts a function that returns http(s).Agent instance given current [URL](https://nodejs.org/api/url.html), this is useful during a redirection chain across HTTP and HTTPS protocol.
|
||||
In addition, the `agent` option accepts a function that returns `http`(s)`.Agent` instance given current [URL](https://nodejs.org/api/url.html), this is useful during a redirection chain across HTTP and HTTPS protocol.
|
||||
|
||||
```js
|
||||
const httpAgent = new http.Agent({
|
||||
@ -432,7 +435,7 @@ The following properties are not implemented in node-fetch at this moment:
|
||||
|
||||
<small>*(spec-compliant)*</small>
|
||||
|
||||
- `body` A string or [Readable stream][node-readable]
|
||||
- `body` A `String` or [`Readable` stream][node-readable]
|
||||
- `options` A [`ResponseInit`][response-init] options dictionary
|
||||
|
||||
Constructs a new `Response` object. The constructor is identical to that in the [browser](https://developer.mozilla.org/en-US/docs/Web/API/Response/Response).
|
||||
@ -462,7 +465,7 @@ This class allows manipulating and iterating over a set of HTTP headers. All met
|
||||
|
||||
- `init` Optional argument to pre-fill the `Headers` object
|
||||
|
||||
Construct a new `Headers` object. `init` can be either `null`, a `Headers` object, an key-value map object, or any iterable object.
|
||||
Construct a new `Headers` object. `init` can be either `null`, a `Headers` object, an key-value map object or any iterable object.
|
||||
|
||||
```js
|
||||
// Example adapted from https://fetch.spec.whatwg.org/#example-headers-class
|
||||
@ -503,7 +506,7 @@ The following methods are not yet implemented in node-fetch at this moment:
|
||||
|
||||
* Node.js [`Readable` stream][node-readable]
|
||||
|
||||
The data encapsulated in the `Body` object. Note that while the [Fetch Standard][whatwg-fetch] requires the property to always be a WHATWG `ReadableStream`, in node-fetch it is a Node.js [`Readable` stream][node-readable].
|
||||
Data are encapsulated in the `Body` object. Note that while the [Fetch Standard][whatwg-fetch] requires the property to always be a WHATWG `ReadableStream`, in node-fetch it is a Node.js [`Readable` stream][node-readable].
|
||||
|
||||
#### body.bodyUsed
|
||||
|
||||
@ -511,7 +514,7 @@ The data encapsulated in the `Body` object. Note that while the [Fetch Standard]
|
||||
|
||||
* `Boolean`
|
||||
|
||||
A boolean property for if this body has been consumed. Per spec, a consumed body cannot be used again.
|
||||
A boolean property for if this body has been consumed. Per the specs, a consumed body cannot be used again.
|
||||
|
||||
#### body.arrayBuffer()
|
||||
#### body.blob()
|
||||
@ -538,9 +541,9 @@ Consume the body and return a promise that will resolve to a Buffer.
|
||||
|
||||
* Returns: <code>Promise<String></code>
|
||||
|
||||
Identical to `body.text()`, except instead of always converting to UTF-8, encoding sniffing will be performed and text converted to UTF-8, if possible.
|
||||
Identical to `body.text()`, except instead of always converting to UTF-8, encoding sniffing will be performed and text converted to UTF-8 if possible.
|
||||
|
||||
(This API requires an optional dependency on npm package [encoding](https://www.npmjs.com/package/encoding), which you need to install manually. `webpack` users may see [a warning message](https://github.com/bitinn/node-fetch/issues/412#issuecomment-379007792) due to this optional dependency.)
|
||||
(This API requires an optional dependency of the npm package [encoding](https://www.npmjs.com/package/encoding), which you need to install manually. `webpack` users may see [a warning message](https://github.com/bitinn/node-fetch/issues/412#issuecomment-379007792) due to this optional dependency.)
|
||||
|
||||
<a id="class-fetcherror"></a>
|
||||
### Class: FetchError
|
||||
@ -574,6 +577,10 @@ MIT
|
||||
[codecov-url]: https://codecov.io/gh/bitinn/node-fetch
|
||||
[install-size-image]: https://flat.badgen.net/packagephobia/install/node-fetch
|
||||
[install-size-url]: https://packagephobia.now.sh/result?p=node-fetch
|
||||
[discord-image]: https://img.shields.io/discord/619915844268326952?color=%237289DA&label=Discord&style=flat-square
|
||||
[discord-url]: https://discord.gg/Zxbndcm
|
||||
[opencollective-image]: https://opencollective.com/node-fetch/backers.svg
|
||||
[opencollective-url]: https://opencollective.com/node-fetch
|
||||
[whatwg-fetch]: https://fetch.spec.whatwg.org/
|
||||
[response-init]: https://fetch.spec.whatwg.org/#responseinit
|
||||
[node-readable]: https://nodejs.org/api/stream.html#stream_readable_streams
|
||||
|
2
node_modules/node-fetch/browser.js
generated
vendored
2
node_modules/node-fetch/browser.js
generated
vendored
@ -16,7 +16,9 @@ var global = getGlobal();
|
||||
module.exports = exports = global.fetch;
|
||||
|
||||
// Needed for TypeScript and Webpack.
|
||||
if (global.fetch) {
|
||||
exports.default = global.fetch.bind(global);
|
||||
}
|
||||
|
||||
exports.Headers = global.Headers;
|
||||
exports.Request = global.Request;
|
||||
|
69
node_modules/node-fetch/lib/index.es.js
generated
vendored
69
node_modules/node-fetch/lib/index.es.js
generated
vendored
@ -3,6 +3,7 @@ process.emitWarning("The .es.js file is deprecated. Use .mjs instead.");
|
||||
import Stream from 'stream';
|
||||
import http from 'http';
|
||||
import Url from 'url';
|
||||
import whatwgUrl from 'whatwg-url';
|
||||
import https from 'https';
|
||||
import zlib from 'zlib';
|
||||
|
||||
@ -461,6 +462,12 @@ function convertBody(buffer, headers) {
|
||||
// html4
|
||||
if (!res && str) {
|
||||
res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
|
||||
if (!res) {
|
||||
res = /<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(str);
|
||||
if (res) {
|
||||
res.pop(); // drop last quote
|
||||
}
|
||||
}
|
||||
|
||||
if (res) {
|
||||
res = /charset=(.*)/i.exec(res.pop());
|
||||
@ -1131,11 +1138,32 @@ Object.defineProperty(Response.prototype, Symbol.toStringTag, {
|
||||
});
|
||||
|
||||
const INTERNALS$2 = Symbol('Request internals');
|
||||
const URL = Url.URL || whatwgUrl.URL;
|
||||
|
||||
// fix an issue where "format", "parse" aren't a named export for node <10
|
||||
const parse_url = Url.parse;
|
||||
const format_url = Url.format;
|
||||
|
||||
/**
|
||||
* Wrapper around `new URL` to handle arbitrary URLs
|
||||
*
|
||||
* @param {string} urlStr
|
||||
* @return {void}
|
||||
*/
|
||||
function parseURL(urlStr) {
|
||||
/*
|
||||
Check whether the URL is absolute or not
|
||||
Scheme: https://tools.ietf.org/html/rfc3986#section-3.1
|
||||
Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
|
||||
*/
|
||||
if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) {
|
||||
urlStr = new URL(urlStr).toString();
|
||||
}
|
||||
|
||||
// Fallback to old implementation for arbitrary URLs
|
||||
return parse_url(urlStr);
|
||||
}
|
||||
|
||||
const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
|
||||
|
||||
/**
|
||||
@ -1172,14 +1200,14 @@ class Request {
|
||||
// in order to support Node.js' Url objects; though WHATWG's URL objects
|
||||
// will fall into this branch also (since their `toString()` will return
|
||||
// `href` property anyway)
|
||||
parsedURL = parse_url(input.href);
|
||||
parsedURL = parseURL(input.href);
|
||||
} else {
|
||||
// coerce input to a string before attempting to parse
|
||||
parsedURL = parse_url(`${input}`);
|
||||
parsedURL = parseURL(`${input}`);
|
||||
}
|
||||
input = {};
|
||||
} else {
|
||||
parsedURL = parse_url(input.url);
|
||||
parsedURL = parseURL(input.url);
|
||||
}
|
||||
|
||||
let method = init.method || input.method || 'GET';
|
||||
@ -1373,9 +1401,17 @@ AbortError.prototype = Object.create(Error.prototype);
|
||||
AbortError.prototype.constructor = AbortError;
|
||||
AbortError.prototype.name = 'AbortError';
|
||||
|
||||
const URL$1 = Url.URL || whatwgUrl.URL;
|
||||
|
||||
// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
|
||||
const PassThrough$1 = Stream.PassThrough;
|
||||
const resolve_url = Url.resolve;
|
||||
|
||||
const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {
|
||||
const orig = new URL$1(original).hostname;
|
||||
const dest = new URL$1(destination).hostname;
|
||||
|
||||
return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);
|
||||
};
|
||||
|
||||
/**
|
||||
* Fetch function
|
||||
@ -1463,12 +1499,24 @@ function fetch(url, opts) {
|
||||
const location = headers.get('Location');
|
||||
|
||||
// HTTP fetch step 5.3
|
||||
const locationURL = location === null ? null : resolve_url(request.url, location);
|
||||
let locationURL = null;
|
||||
try {
|
||||
locationURL = location === null ? null : new URL$1(location, request.url).toString();
|
||||
} catch (err) {
|
||||
// error here can only be invalid URL in Location: header
|
||||
// do not throw when options.redirect == manual
|
||||
// let the user extract the errorneous redirect URL
|
||||
if (request.redirect !== 'manual') {
|
||||
reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));
|
||||
finalize();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// HTTP fetch step 5.5
|
||||
switch (request.redirect) {
|
||||
case 'error':
|
||||
reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
|
||||
reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));
|
||||
finalize();
|
||||
return;
|
||||
case 'manual':
|
||||
@ -1507,9 +1555,16 @@ function fetch(url, opts) {
|
||||
method: request.method,
|
||||
body: request.body,
|
||||
signal: request.signal,
|
||||
timeout: request.timeout
|
||||
timeout: request.timeout,
|
||||
size: request.size
|
||||
};
|
||||
|
||||
if (!isDomainOrSubdomain(request.url, locationURL)) {
|
||||
for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {
|
||||
requestOpts.headers.delete(name);
|
||||
}
|
||||
}
|
||||
|
||||
// HTTP-redirect fetch step 9
|
||||
if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
|
||||
reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
|
||||
|
69
node_modules/node-fetch/lib/index.js
generated
vendored
69
node_modules/node-fetch/lib/index.js
generated
vendored
@ -7,6 +7,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
||||
var Stream = _interopDefault(require('stream'));
|
||||
var http = _interopDefault(require('http'));
|
||||
var Url = _interopDefault(require('url'));
|
||||
var whatwgUrl = _interopDefault(require('whatwg-url'));
|
||||
var https = _interopDefault(require('https'));
|
||||
var zlib = _interopDefault(require('zlib'));
|
||||
|
||||
@ -465,6 +466,12 @@ function convertBody(buffer, headers) {
|
||||
// html4
|
||||
if (!res && str) {
|
||||
res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
|
||||
if (!res) {
|
||||
res = /<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(str);
|
||||
if (res) {
|
||||
res.pop(); // drop last quote
|
||||
}
|
||||
}
|
||||
|
||||
if (res) {
|
||||
res = /charset=(.*)/i.exec(res.pop());
|
||||
@ -1135,11 +1142,32 @@ Object.defineProperty(Response.prototype, Symbol.toStringTag, {
|
||||
});
|
||||
|
||||
const INTERNALS$2 = Symbol('Request internals');
|
||||
const URL = Url.URL || whatwgUrl.URL;
|
||||
|
||||
// fix an issue where "format", "parse" aren't a named export for node <10
|
||||
const parse_url = Url.parse;
|
||||
const format_url = Url.format;
|
||||
|
||||
/**
|
||||
* Wrapper around `new URL` to handle arbitrary URLs
|
||||
*
|
||||
* @param {string} urlStr
|
||||
* @return {void}
|
||||
*/
|
||||
function parseURL(urlStr) {
|
||||
/*
|
||||
Check whether the URL is absolute or not
|
||||
Scheme: https://tools.ietf.org/html/rfc3986#section-3.1
|
||||
Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
|
||||
*/
|
||||
if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) {
|
||||
urlStr = new URL(urlStr).toString();
|
||||
}
|
||||
|
||||
// Fallback to old implementation for arbitrary URLs
|
||||
return parse_url(urlStr);
|
||||
}
|
||||
|
||||
const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
|
||||
|
||||
/**
|
||||
@ -1176,14 +1204,14 @@ class Request {
|
||||
// in order to support Node.js' Url objects; though WHATWG's URL objects
|
||||
// will fall into this branch also (since their `toString()` will return
|
||||
// `href` property anyway)
|
||||
parsedURL = parse_url(input.href);
|
||||
parsedURL = parseURL(input.href);
|
||||
} else {
|
||||
// coerce input to a string before attempting to parse
|
||||
parsedURL = parse_url(`${input}`);
|
||||
parsedURL = parseURL(`${input}`);
|
||||
}
|
||||
input = {};
|
||||
} else {
|
||||
parsedURL = parse_url(input.url);
|
||||
parsedURL = parseURL(input.url);
|
||||
}
|
||||
|
||||
let method = init.method || input.method || 'GET';
|
||||
@ -1377,9 +1405,17 @@ AbortError.prototype = Object.create(Error.prototype);
|
||||
AbortError.prototype.constructor = AbortError;
|
||||
AbortError.prototype.name = 'AbortError';
|
||||
|
||||
const URL$1 = Url.URL || whatwgUrl.URL;
|
||||
|
||||
// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
|
||||
const PassThrough$1 = Stream.PassThrough;
|
||||
const resolve_url = Url.resolve;
|
||||
|
||||
const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {
|
||||
const orig = new URL$1(original).hostname;
|
||||
const dest = new URL$1(destination).hostname;
|
||||
|
||||
return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);
|
||||
};
|
||||
|
||||
/**
|
||||
* Fetch function
|
||||
@ -1467,12 +1503,24 @@ function fetch(url, opts) {
|
||||
const location = headers.get('Location');
|
||||
|
||||
// HTTP fetch step 5.3
|
||||
const locationURL = location === null ? null : resolve_url(request.url, location);
|
||||
let locationURL = null;
|
||||
try {
|
||||
locationURL = location === null ? null : new URL$1(location, request.url).toString();
|
||||
} catch (err) {
|
||||
// error here can only be invalid URL in Location: header
|
||||
// do not throw when options.redirect == manual
|
||||
// let the user extract the errorneous redirect URL
|
||||
if (request.redirect !== 'manual') {
|
||||
reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));
|
||||
finalize();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// HTTP fetch step 5.5
|
||||
switch (request.redirect) {
|
||||
case 'error':
|
||||
reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
|
||||
reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));
|
||||
finalize();
|
||||
return;
|
||||
case 'manual':
|
||||
@ -1511,9 +1559,16 @@ function fetch(url, opts) {
|
||||
method: request.method,
|
||||
body: request.body,
|
||||
signal: request.signal,
|
||||
timeout: request.timeout
|
||||
timeout: request.timeout,
|
||||
size: request.size
|
||||
};
|
||||
|
||||
if (!isDomainOrSubdomain(request.url, locationURL)) {
|
||||
for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {
|
||||
requestOpts.headers.delete(name);
|
||||
}
|
||||
}
|
||||
|
||||
// HTTP-redirect fetch step 9
|
||||
if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
|
||||
reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
|
||||
|
69
node_modules/node-fetch/lib/index.mjs
generated
vendored
69
node_modules/node-fetch/lib/index.mjs
generated
vendored
@ -1,6 +1,7 @@
|
||||
import Stream from 'stream';
|
||||
import http from 'http';
|
||||
import Url from 'url';
|
||||
import whatwgUrl from 'whatwg-url';
|
||||
import https from 'https';
|
||||
import zlib from 'zlib';
|
||||
|
||||
@ -459,6 +460,12 @@ function convertBody(buffer, headers) {
|
||||
// html4
|
||||
if (!res && str) {
|
||||
res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
|
||||
if (!res) {
|
||||
res = /<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(str);
|
||||
if (res) {
|
||||
res.pop(); // drop last quote
|
||||
}
|
||||
}
|
||||
|
||||
if (res) {
|
||||
res = /charset=(.*)/i.exec(res.pop());
|
||||
@ -1129,11 +1136,32 @@ Object.defineProperty(Response.prototype, Symbol.toStringTag, {
|
||||
});
|
||||
|
||||
const INTERNALS$2 = Symbol('Request internals');
|
||||
const URL = Url.URL || whatwgUrl.URL;
|
||||
|
||||
// fix an issue where "format", "parse" aren't a named export for node <10
|
||||
const parse_url = Url.parse;
|
||||
const format_url = Url.format;
|
||||
|
||||
/**
|
||||
* Wrapper around `new URL` to handle arbitrary URLs
|
||||
*
|
||||
* @param {string} urlStr
|
||||
* @return {void}
|
||||
*/
|
||||
function parseURL(urlStr) {
|
||||
/*
|
||||
Check whether the URL is absolute or not
|
||||
Scheme: https://tools.ietf.org/html/rfc3986#section-3.1
|
||||
Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3
|
||||
*/
|
||||
if (/^[a-zA-Z][a-zA-Z\d+\-.]*:/.exec(urlStr)) {
|
||||
urlStr = new URL(urlStr).toString();
|
||||
}
|
||||
|
||||
// Fallback to old implementation for arbitrary URLs
|
||||
return parse_url(urlStr);
|
||||
}
|
||||
|
||||
const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
|
||||
|
||||
/**
|
||||
@ -1170,14 +1198,14 @@ class Request {
|
||||
// in order to support Node.js' Url objects; though WHATWG's URL objects
|
||||
// will fall into this branch also (since their `toString()` will return
|
||||
// `href` property anyway)
|
||||
parsedURL = parse_url(input.href);
|
||||
parsedURL = parseURL(input.href);
|
||||
} else {
|
||||
// coerce input to a string before attempting to parse
|
||||
parsedURL = parse_url(`${input}`);
|
||||
parsedURL = parseURL(`${input}`);
|
||||
}
|
||||
input = {};
|
||||
} else {
|
||||
parsedURL = parse_url(input.url);
|
||||
parsedURL = parseURL(input.url);
|
||||
}
|
||||
|
||||
let method = init.method || input.method || 'GET';
|
||||
@ -1371,9 +1399,17 @@ AbortError.prototype = Object.create(Error.prototype);
|
||||
AbortError.prototype.constructor = AbortError;
|
||||
AbortError.prototype.name = 'AbortError';
|
||||
|
||||
const URL$1 = Url.URL || whatwgUrl.URL;
|
||||
|
||||
// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
|
||||
const PassThrough$1 = Stream.PassThrough;
|
||||
const resolve_url = Url.resolve;
|
||||
|
||||
const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {
|
||||
const orig = new URL$1(original).hostname;
|
||||
const dest = new URL$1(destination).hostname;
|
||||
|
||||
return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);
|
||||
};
|
||||
|
||||
/**
|
||||
* Fetch function
|
||||
@ -1461,12 +1497,24 @@ function fetch(url, opts) {
|
||||
const location = headers.get('Location');
|
||||
|
||||
// HTTP fetch step 5.3
|
||||
const locationURL = location === null ? null : resolve_url(request.url, location);
|
||||
let locationURL = null;
|
||||
try {
|
||||
locationURL = location === null ? null : new URL$1(location, request.url).toString();
|
||||
} catch (err) {
|
||||
// error here can only be invalid URL in Location: header
|
||||
// do not throw when options.redirect == manual
|
||||
// let the user extract the errorneous redirect URL
|
||||
if (request.redirect !== 'manual') {
|
||||
reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));
|
||||
finalize();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// HTTP fetch step 5.5
|
||||
switch (request.redirect) {
|
||||
case 'error':
|
||||
reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
|
||||
reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));
|
||||
finalize();
|
||||
return;
|
||||
case 'manual':
|
||||
@ -1505,9 +1553,16 @@ function fetch(url, opts) {
|
||||
method: request.method,
|
||||
body: request.body,
|
||||
signal: request.signal,
|
||||
timeout: request.timeout
|
||||
timeout: request.timeout,
|
||||
size: request.size
|
||||
};
|
||||
|
||||
if (!isDomainOrSubdomain(request.url, locationURL)) {
|
||||
for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {
|
||||
requestOpts.headers.delete(name);
|
||||
}
|
||||
}
|
||||
|
||||
// HTTP-redirect fetch step 9
|
||||
if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
|
||||
reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
|
||||
|
109
node_modules/node-fetch/package.json
generated
vendored
109
node_modules/node-fetch/package.json
generated
vendored
@ -1,38 +1,52 @@
|
||||
{
|
||||
"_from": "node-fetch@^2.3.0",
|
||||
"_id": "node-fetch@2.6.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==",
|
||||
"_location": "/node-fetch",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "node-fetch@^2.3.0",
|
||||
"name": "node-fetch",
|
||||
"escapedName": "node-fetch",
|
||||
"rawSpec": "^2.3.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^2.3.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@octokit/request"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
|
||||
"_shasum": "e633456386d4aa55863f676a7ab0daa8fdecb0fd",
|
||||
"_spec": "node-fetch@^2.3.0",
|
||||
"_where": "/home/stCarolas/Coding/projects/setup-maven/node_modules/@octokit/request",
|
||||
"author": {
|
||||
"name": "David Frank"
|
||||
},
|
||||
"version": "2.6.7",
|
||||
"description": "A light-weight module that brings window.fetch to node.js",
|
||||
"main": "lib/index.js",
|
||||
"browser": "./browser.js",
|
||||
"module": "lib/index.mjs",
|
||||
"files": [
|
||||
"lib/index.js",
|
||||
"lib/index.mjs",
|
||||
"lib/index.es.js",
|
||||
"browser.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "cross-env BABEL_ENV=rollup rollup -c",
|
||||
"prepare": "npm run build",
|
||||
"test": "cross-env BABEL_ENV=test mocha --require babel-register --throw-deprecation test/test.js",
|
||||
"report": "cross-env BABEL_ENV=coverage nyc --reporter lcov --reporter text mocha -R spec test/test.js",
|
||||
"coverage": "cross-env BABEL_ENV=coverage nyc --reporter json --reporter text mocha -R spec test/test.js && codecov -f coverage/coverage-final.json"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/bitinn/node-fetch.git"
|
||||
},
|
||||
"keywords": [
|
||||
"fetch",
|
||||
"http",
|
||||
"promise"
|
||||
],
|
||||
"author": "David Frank",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/bitinn/node-fetch/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {},
|
||||
"deprecated": false,
|
||||
"description": "A light-weight module that brings window.fetch to node.js",
|
||||
"homepage": "https://github.com/bitinn/node-fetch",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"encoding": "^0.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"encoding": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ungap/url-search-params": "^0.1.2",
|
||||
"abort-controller": "^1.1.0",
|
||||
@ -45,7 +59,7 @@
|
||||
"chai-as-promised": "^7.1.1",
|
||||
"chai-iterator": "^1.1.1",
|
||||
"chai-string": "~1.3.0",
|
||||
"codecov": "^3.3.0",
|
||||
"codecov": "3.3.0",
|
||||
"cross-env": "^5.2.0",
|
||||
"form-data": "^2.3.3",
|
||||
"is-builtin-module": "^1.0.0",
|
||||
@ -57,37 +71,6 @@
|
||||
"rollup": "^0.63.4",
|
||||
"rollup-plugin-babel": "^3.0.7",
|
||||
"string-to-arraybuffer": "^1.0.2",
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
},
|
||||
"files": [
|
||||
"lib/index.js",
|
||||
"lib/index.mjs",
|
||||
"lib/index.es.js",
|
||||
"browser.js"
|
||||
],
|
||||
"homepage": "https://github.com/bitinn/node-fetch",
|
||||
"keywords": [
|
||||
"fetch",
|
||||
"http",
|
||||
"promise"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/index",
|
||||
"module": "lib/index.mjs",
|
||||
"name": "node-fetch",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/bitinn/node-fetch.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "cross-env BABEL_ENV=rollup rollup -c",
|
||||
"coverage": "cross-env BABEL_ENV=coverage nyc --reporter json --reporter text mocha -R spec test/test.js && codecov -f coverage/coverage-final.json",
|
||||
"prepare": "npm run build",
|
||||
"report": "cross-env BABEL_ENV=coverage nyc --reporter lcov --reporter text mocha -R spec test/test.js",
|
||||
"test": "cross-env BABEL_ENV=test mocha --require babel-register --throw-deprecation test/test.js"
|
||||
},
|
||||
"version": "2.6.0"
|
||||
"teeny-request": "3.7.0"
|
||||
}
|
||||
}
|
||||
|
53
node_modules/object-inspect/.eslintrc
generated
vendored
Normal file
53
node_modules/object-inspect/.eslintrc
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
{
|
||||
"root": true,
|
||||
"extends": "@ljharb",
|
||||
"rules": {
|
||||
"complexity": 0,
|
||||
"func-style": [2, "declaration"],
|
||||
"indent": [2, 4],
|
||||
"max-lines": 1,
|
||||
"max-lines-per-function": 1,
|
||||
"max-params": [2, 4],
|
||||
"max-statements": 0,
|
||||
"max-statements-per-line": [2, { "max": 2 }],
|
||||
"no-magic-numbers": 0,
|
||||
"no-param-reassign": 1,
|
||||
"strict": 0, // TODO
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["test/**", "test-*", "example/**"],
|
||||
"extends": "@ljharb/eslint-config/tests",
|
||||
"rules": {
|
||||
"id-length": 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
"files": ["example/**"],
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
"files": ["test/browser/**"],
|
||||
"env": {
|
||||
"browser": true,
|
||||
},
|
||||
},
|
||||
{
|
||||
"files": ["test/bigint*"],
|
||||
"rules": {
|
||||
"new-cap": [2, { "capIsNewExceptions": ["BigInt"] }],
|
||||
},
|
||||
},
|
||||
{
|
||||
"files": "index.js",
|
||||
"globals": {
|
||||
"HTMLElement": false,
|
||||
},
|
||||
"rules": {
|
||||
"no-use-before-define": 1,
|
||||
},
|
||||
},
|
||||
],
|
||||
}
|
12
node_modules/object-inspect/.github/FUNDING.yml
generated
vendored
Normal file
12
node_modules/object-inspect/.github/FUNDING.yml
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [ljharb]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: npm/object-inspect
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
13
node_modules/object-inspect/.nycrc
generated
vendored
Normal file
13
node_modules/object-inspect/.nycrc
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
{
|
||||
"all": true,
|
||||
"check-coverage": false,
|
||||
"instrumentation": false,
|
||||
"sourceMap": false,
|
||||
"reporter": ["text-summary", "text", "html", "json"],
|
||||
"exclude": [
|
||||
"coverage",
|
||||
"example",
|
||||
"test",
|
||||
"test-core-js.js"
|
||||
]
|
||||
}
|
360
node_modules/object-inspect/CHANGELOG.md
generated
vendored
Normal file
360
node_modules/object-inspect/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,360 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v1.12.2](https://github.com/inspect-js/object-inspect/compare/v1.12.1...v1.12.2) - 2022-05-26
|
||||
|
||||
### Commits
|
||||
|
||||
- [Fix] use `util.inspect` for a custom inspection symbol method [`e243bf2`](https://github.com/inspect-js/object-inspect/commit/e243bf2eda6c4403ac6f1146fddb14d12e9646c1)
|
||||
- [meta] add support info [`ca20ba3`](https://github.com/inspect-js/object-inspect/commit/ca20ba35713c17068ca912a86c542f5e8acb656c)
|
||||
- [Fix] ignore `cause` in node v16.9 and v16.10 where it has a bug [`86aa553`](https://github.com/inspect-js/object-inspect/commit/86aa553a4a455562c2c56f1540f0bf857b9d314b)
|
||||
|
||||
## [v1.12.1](https://github.com/inspect-js/object-inspect/compare/v1.12.0...v1.12.1) - 2022-05-21
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] use `mock-property` [`4ec8893`](https://github.com/inspect-js/object-inspect/commit/4ec8893ea9bfd28065ca3638cf6762424bf44352)
|
||||
- [meta] use `npmignore` to autogenerate an npmignore file [`07f868c`](https://github.com/inspect-js/object-inspect/commit/07f868c10bd25a9d18686528339bb749c211fc9a)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`b05244b`](https://github.com/inspect-js/object-inspect/commit/b05244b4f331e00c43b3151bc498041be77ccc91)
|
||||
- [Dev Deps] update `@ljharb/eslint-config`, `error-cause`, `es-value-fixtures`, `functions-have-names`, `tape` [`d037398`](https://github.com/inspect-js/object-inspect/commit/d037398dcc5d531532e4c19c4a711ed677f579c1)
|
||||
- [Fix] properly handle callable regexes in older engines [`848fe48`](https://github.com/inspect-js/object-inspect/commit/848fe48bd6dd0064ba781ee6f3c5e54a94144c37)
|
||||
|
||||
## [v1.12.0](https://github.com/inspect-js/object-inspect/compare/v1.11.1...v1.12.0) - 2021-12-18
|
||||
|
||||
### Commits
|
||||
|
||||
- [New] add `numericSeparator` boolean option [`2d2d537`](https://github.com/inspect-js/object-inspect/commit/2d2d537f5359a4300ce1c10241369f8024f89e11)
|
||||
- [Robustness] cache more prototype methods [`191533d`](https://github.com/inspect-js/object-inspect/commit/191533da8aec98a05eadd73a5a6e979c9c8653e8)
|
||||
- [New] ensure an Error’s `cause` is displayed [`53bc2ce`](https://github.com/inspect-js/object-inspect/commit/53bc2cee4e5a9cc4986f3cafa22c0685f340715e)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`bc164b6`](https://github.com/inspect-js/object-inspect/commit/bc164b6e2e7d36b263970f16f54de63048b84a36)
|
||||
- [Robustness] cache `RegExp.prototype.test` [`a314ab8`](https://github.com/inspect-js/object-inspect/commit/a314ab8271b905cbabc594c82914d2485a8daf12)
|
||||
- [meta] fix auto-changelog settings [`5ed0983`](https://github.com/inspect-js/object-inspect/commit/5ed0983be72f73e32e2559997517a95525c7e20d)
|
||||
|
||||
## [v1.11.1](https://github.com/inspect-js/object-inspect/compare/v1.11.0...v1.11.1) - 2021-12-05
|
||||
|
||||
### Commits
|
||||
|
||||
- [meta] add `auto-changelog` [`7dbdd22`](https://github.com/inspect-js/object-inspect/commit/7dbdd228401d6025d8b7391476d88aee9ea9bbdf)
|
||||
- [actions] reuse common workflows [`c8823bc`](https://github.com/inspect-js/object-inspect/commit/c8823bc0a8790729680709d45fb6e652432e91aa)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`7532b12`](https://github.com/inspect-js/object-inspect/commit/7532b120598307497b712890f75af8056f6d37a6)
|
||||
- [Refactor] use `has-tostringtag` to behave correctly in the presence of symbol shams [`94abb5d`](https://github.com/inspect-js/object-inspect/commit/94abb5d4e745bf33253942dea86b3e538d2ff6c6)
|
||||
- [actions] update codecov uploader [`5ed5102`](https://github.com/inspect-js/object-inspect/commit/5ed51025267a00e53b1341357315490ac4eb0874)
|
||||
- [Dev Deps] update `eslint`, `tape` [`37b2ad2`](https://github.com/inspect-js/object-inspect/commit/37b2ad26c08d94bfd01d5d07069a0b28ef4e2ad7)
|
||||
- [meta] add `sideEffects` flag [`d341f90`](https://github.com/inspect-js/object-inspect/commit/d341f905ef8bffa6a694cda6ddc5ba343532cd4f)
|
||||
|
||||
## [v1.11.0](https://github.com/inspect-js/object-inspect/compare/v1.10.3...v1.11.0) - 2021-07-12
|
||||
|
||||
### Commits
|
||||
|
||||
- [New] `customInspect`: add `symbol` option, to mimic modern util.inspect behavior [`e973a6e`](https://github.com/inspect-js/object-inspect/commit/e973a6e21f8140c5837cf25e9d89bdde88dc3120)
|
||||
- [Dev Deps] update `eslint` [`05f1cb3`](https://github.com/inspect-js/object-inspect/commit/05f1cb3cbcfe1f238e8b51cf9bc294305b7ed793)
|
||||
|
||||
## [v1.10.3](https://github.com/inspect-js/object-inspect/compare/v1.10.2...v1.10.3) - 2021-05-07
|
||||
|
||||
### Commits
|
||||
|
||||
- [Fix] handle core-js Symbol shams [`4acfc2c`](https://github.com/inspect-js/object-inspect/commit/4acfc2c4b503498759120eb517abad6d51c9c5d6)
|
||||
- [readme] update badges [`95c323a`](https://github.com/inspect-js/object-inspect/commit/95c323ad909d6cbabb95dd6015c190ba6db9c1f2)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud` [`cb38f48`](https://github.com/inspect-js/object-inspect/commit/cb38f485de6ec7a95109b5a9bbd0a1deba2f6611)
|
||||
|
||||
## [v1.10.2](https://github.com/inspect-js/object-inspect/compare/v1.10.1...v1.10.2) - 2021-04-17
|
||||
|
||||
### Commits
|
||||
|
||||
- [Fix] use a robust check for a boxed Symbol [`87f12d6`](https://github.com/inspect-js/object-inspect/commit/87f12d6e69ce530be04659c81a4cd502943acac5)
|
||||
|
||||
## [v1.10.1](https://github.com/inspect-js/object-inspect/compare/v1.10.0...v1.10.1) - 2021-04-17
|
||||
|
||||
### Commits
|
||||
|
||||
- [Fix] use a robust check for a boxed bigint [`d5ca829`](https://github.com/inspect-js/object-inspect/commit/d5ca8298b6d2e5c7b9334a5b21b96ed95d225c91)
|
||||
|
||||
## [v1.10.0](https://github.com/inspect-js/object-inspect/compare/v1.9.0...v1.10.0) - 2021-04-17
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] increase coverage [`d8abb8a`](https://github.com/inspect-js/object-inspect/commit/d8abb8a62c2f084919df994a433b346e0d87a227)
|
||||
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`4bfec2e`](https://github.com/inspect-js/object-inspect/commit/4bfec2e30aaef6ddef6cbb1448306f9f8b9520b7)
|
||||
- [New] respect `Symbol.toStringTag` on objects [`799b58f`](https://github.com/inspect-js/object-inspect/commit/799b58f536a45e4484633a8e9daeb0330835f175)
|
||||
- [Fix] do not allow Symbol.toStringTag to masquerade as builtins [`d6c5b37`](https://github.com/inspect-js/object-inspect/commit/d6c5b37d7e94427796b82432fb0c8964f033a6ab)
|
||||
- [New] add `WeakRef` support [`b6d898e`](https://github.com/inspect-js/object-inspect/commit/b6d898ee21868c780a7ee66b28532b5b34ed7f09)
|
||||
- [meta] do not publish github action workflow files [`918cdfc`](https://github.com/inspect-js/object-inspect/commit/918cdfc4b6fe83f559ff6ef04fe66201e3ff5cbd)
|
||||
- [meta] create `FUNDING.yml` [`0bb5fc5`](https://github.com/inspect-js/object-inspect/commit/0bb5fc516dbcd2cd728bd89cee0b580acc5ce301)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`22c8dc0`](https://github.com/inspect-js/object-inspect/commit/22c8dc0cac113d70f4781e49a950070923a671be)
|
||||
- [meta] use `prepublishOnly` script for npm 7+ [`e52ee09`](https://github.com/inspect-js/object-inspect/commit/e52ee09e8050b8dbac94ef57f786675567728223)
|
||||
- [Dev Deps] update `eslint` [`7c4e6fd`](https://github.com/inspect-js/object-inspect/commit/7c4e6fdedcd27cc980e13c9ad834d05a96f3d40c)
|
||||
|
||||
## [v1.9.0](https://github.com/inspect-js/object-inspect/compare/v1.8.0...v1.9.0) - 2020-11-30
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] migrate tests to Github Actions [`d262251`](https://github.com/inspect-js/object-inspect/commit/d262251e13e16d3490b5473672f6b6d6ff86675d)
|
||||
- [New] add enumerable own Symbols to plain object output [`ee60c03`](https://github.com/inspect-js/object-inspect/commit/ee60c033088cff9d33baa71e59a362a541b48284)
|
||||
- [Tests] add passing tests [`01ac3e4`](https://github.com/inspect-js/object-inspect/commit/01ac3e4b5a30f97875a63dc9b1416b3bd626afc9)
|
||||
- [actions] add "Require Allow Edits" action [`c2d7746`](https://github.com/inspect-js/object-inspect/commit/c2d774680cde4ca4af332d84d4121b26f798ba9e)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `core-js` [`70058de`](https://github.com/inspect-js/object-inspect/commit/70058de1579fc54d1d15ed6c2dbe246637ce70ff)
|
||||
- [Fix] hex characters in strings should be uppercased, to match node `assert` [`6ab8faa`](https://github.com/inspect-js/object-inspect/commit/6ab8faaa0abc08fe7a8e2afd8b39c6f1f0e00113)
|
||||
- [Tests] run `nyc` on all tests [`4c47372`](https://github.com/inspect-js/object-inspect/commit/4c473727879ddc8e28b599202551ddaaf07b6210)
|
||||
- [Tests] node 0.8 has an unpredictable property order; fix `groups` test by removing property [`f192069`](https://github.com/inspect-js/object-inspect/commit/f192069a978a3b60e6f0e0d45ac7df260ab9a778)
|
||||
- [New] add enumerable properties to Function inspect result, per node’s `assert` [`fd38e1b`](https://github.com/inspect-js/object-inspect/commit/fd38e1bc3e2a1dc82091ce3e021917462eee64fc)
|
||||
- [Tests] fix tests for node < 10, due to regex match `groups` [`2ac6462`](https://github.com/inspect-js/object-inspect/commit/2ac6462cc4f72eaa0b63a8cfee9aabe3008b2330)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config` [`44b59e2`](https://github.com/inspect-js/object-inspect/commit/44b59e2676a7f825ef530dfd19dafb599e3b9456)
|
||||
- [Robustness] cache `Symbol.prototype.toString` [`f3c2074`](https://github.com/inspect-js/object-inspect/commit/f3c2074d8f32faf8292587c07c9678ea931703dd)
|
||||
- [Dev Deps] update `eslint` [`9411294`](https://github.com/inspect-js/object-inspect/commit/94112944b9245e3302e25453277876402d207e7f)
|
||||
- [meta] `require-allow-edits` no longer requires an explicit github token [`36c0220`](https://github.com/inspect-js/object-inspect/commit/36c02205de3c2b0e84d53777c5c9fd54a36c48ab)
|
||||
- [actions] update rebase checkout action to v2 [`55a39a6`](https://github.com/inspect-js/object-inspect/commit/55a39a64e944f19c6a7d8efddf3df27700f20d14)
|
||||
- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`f59fd3c`](https://github.com/inspect-js/object-inspect/commit/f59fd3cf406c3a7c7ece140904a80bbc6bacfcca)
|
||||
- [Dev Deps] update `eslint` [`a492bec`](https://github.com/inspect-js/object-inspect/commit/a492becec644b0155c9c4bc1caf6f9fac11fb2c7)
|
||||
|
||||
## [v1.8.0](https://github.com/inspect-js/object-inspect/compare/v1.7.0...v1.8.0) - 2020-06-18
|
||||
|
||||
### Fixed
|
||||
|
||||
- [New] add `indent` option [`#27`](https://github.com/inspect-js/object-inspect/issues/27)
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] add codecov [`4324cbb`](https://github.com/inspect-js/object-inspect/commit/4324cbb1a2bd7710822a4151ff373570db22453e)
|
||||
- [New] add `maxStringLength` option [`b3995cb`](https://github.com/inspect-js/object-inspect/commit/b3995cb71e15b5ee127a3094c43994df9d973502)
|
||||
- [New] add `customInspect` option, to disable custom inspect methods [`28b9179`](https://github.com/inspect-js/object-inspect/commit/28b9179ee802bb3b90810100c11637db90c2fb6d)
|
||||
- [Tests] add Date and RegExp tests [`3b28eca`](https://github.com/inspect-js/object-inspect/commit/3b28eca57b0367aeadffac604ea09e8bdae7d97b)
|
||||
- [actions] add automatic rebasing / merge commit blocking [`0d9c6c0`](https://github.com/inspect-js/object-inspect/commit/0d9c6c044e83475ff0bfffb9d35b149834c83a2e)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `tape`; add `aud` [`7c204f2`](https://github.com/inspect-js/object-inspect/commit/7c204f22b9e41bc97147f4d32d4cb045b17769a6)
|
||||
- [readme] fix repo URLs, remove testling [`34ca9a0`](https://github.com/inspect-js/object-inspect/commit/34ca9a0dabfe75bd311f806a326fadad029909a3)
|
||||
- [Fix] when truncating a deep array, note it as `[Array]` instead of just `[Object]` [`f74c82d`](https://github.com/inspect-js/object-inspect/commit/f74c82dd0b35386445510deb250f34c41be3ec0e)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`1a8a5ea`](https://github.com/inspect-js/object-inspect/commit/1a8a5ea069ea2bee89d77caedad83ffa23d35711)
|
||||
- [Fix] do not be fooled by a function’s own `toString` method [`7cb5c65`](https://github.com/inspect-js/object-inspect/commit/7cb5c657a976f94715c19c10556a30f15bb7d5d7)
|
||||
- [patch] indicate explicitly that anon functions are anonymous, to match node [`81ebdd4`](https://github.com/inspect-js/object-inspect/commit/81ebdd4215005144074bbdff3f6bafa01407910a)
|
||||
- [Dev Deps] loosen the `core-js` dep [`e7472e8`](https://github.com/inspect-js/object-inspect/commit/e7472e8e242117670560bd995830c2a4d12080f5)
|
||||
- [Dev Deps] update `tape` [`699827e`](https://github.com/inspect-js/object-inspect/commit/699827e6b37258b5203c33c78c009bf4b0e6a66d)
|
||||
- [meta] add `safe-publish-latest` [`c5d2868`](https://github.com/inspect-js/object-inspect/commit/c5d2868d6eb33c472f37a20f89ceef2787046088)
|
||||
- [Dev Deps] update `@ljharb/eslint-config` [`9199501`](https://github.com/inspect-js/object-inspect/commit/919950195d486114ccebacbdf9d74d7f382693b0)
|
||||
|
||||
## [v1.7.0](https://github.com/inspect-js/object-inspect/compare/v1.6.0...v1.7.0) - 2019-11-10
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] use shared travis-ci configs [`19899ed`](https://github.com/inspect-js/object-inspect/commit/19899edbf31f4f8809acf745ce34ad1ce1bfa63b)
|
||||
- [Tests] add linting [`a00f057`](https://github.com/inspect-js/object-inspect/commit/a00f057d917f66ea26dd37769c6b810ec4af97e8)
|
||||
- [Tests] lint last file [`2698047`](https://github.com/inspect-js/object-inspect/commit/2698047b58af1e2e88061598ef37a75f228dddf6)
|
||||
- [Tests] up to `node` `v12.7`, `v11.15`, `v10.16`, `v8.16`, `v6.17` [`589e87a`](https://github.com/inspect-js/object-inspect/commit/589e87a99cadcff4b600e6a303418e9d922836e8)
|
||||
- [New] add support for `WeakMap` and `WeakSet` [`3ddb3e4`](https://github.com/inspect-js/object-inspect/commit/3ddb3e4e0c8287130c61a12e0ed9c104b1549306)
|
||||
- [meta] clean up license so github can detect it properly [`27527bb`](https://github.com/inspect-js/object-inspect/commit/27527bb801520c9610c68cc3b55d6f20a2bee56d)
|
||||
- [Tests] cover `util.inspect.custom` [`36d47b9`](https://github.com/inspect-js/object-inspect/commit/36d47b9c59056a57ef2f1491602c726359561800)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `tape` [`b614eaa`](https://github.com/inspect-js/object-inspect/commit/b614eaac901da0e5c69151f534671f990a94cace)
|
||||
- [Tests] fix coverage thresholds [`7b7b176`](https://github.com/inspect-js/object-inspect/commit/7b7b176e15f8bd6e8b2f261ff5a493c2fe78d9c2)
|
||||
- [Tests] bigint tests now can run on unflagged node [`063af31`](https://github.com/inspect-js/object-inspect/commit/063af31ce9cd13c202e3b67c07ba06dc9b7c0f81)
|
||||
- [Refactor] add early bailout to `isMap` and `isSet` checks [`fc51047`](https://github.com/inspect-js/object-inspect/commit/fc5104714a3671d37e225813db79470d6335683b)
|
||||
- [meta] add `funding` field [`7f9953a`](https://github.com/inspect-js/object-inspect/commit/7f9953a113eec7b064a6393cf9f90ba15f1d131b)
|
||||
- [Tests] Fix invalid strict-mode syntax with hexadecimal [`a8b5425`](https://github.com/inspect-js/object-inspect/commit/a8b542503b4af1599a275209a1a99f5fdedb1ead)
|
||||
- [Dev Deps] update `@ljharb/eslint-config` [`98df157`](https://github.com/inspect-js/object-inspect/commit/98df1577314d9188a3fc3f17fdcf2fba697ae1bd)
|
||||
- add copyright to LICENSE [`bb69fd0`](https://github.com/inspect-js/object-inspect/commit/bb69fd017a062d299e44da1f9b2c7dcd67f621e6)
|
||||
- [Tests] use `npx aud` in `posttest` [`4838353`](https://github.com/inspect-js/object-inspect/commit/4838353593974cf7f905b9ef04c03c094f0cdbe2)
|
||||
- [Tests] move `0.6` to allowed failures, because it won‘t build on travis [`1bff32a`](https://github.com/inspect-js/object-inspect/commit/1bff32aa52e8aea687f0856b28ba754b3e43ebf7)
|
||||
|
||||
## [v1.6.0](https://github.com/inspect-js/object-inspect/compare/v1.5.0...v1.6.0) - 2018-05-02
|
||||
|
||||
### Commits
|
||||
|
||||
- [New] add support for boxed BigInt primitives [`356c66a`](https://github.com/inspect-js/object-inspect/commit/356c66a410e7aece7162c8319880a5ef647beaa9)
|
||||
- [Tests] up to `node` `v10.0`, `v9.11`, `v8.11`, `v6.14`, `v4.9` [`c77b65b`](https://github.com/inspect-js/object-inspect/commit/c77b65bba593811b906b9ec57561c5cba92e2db3)
|
||||
- [New] Add support for upcoming `BigInt` [`1ac548e`](https://github.com/inspect-js/object-inspect/commit/1ac548e4b27e26466c28c9a5e63e5d4e0591c31f)
|
||||
- [Tests] run bigint tests in CI with --harmony-bigint flag [`d31b738`](https://github.com/inspect-js/object-inspect/commit/d31b73831880254b5c6cf5691cda9a149fbc5f04)
|
||||
- [Dev Deps] update `core-js`, `tape` [`ff9eff6`](https://github.com/inspect-js/object-inspect/commit/ff9eff67113341ee1aaf80c1c22d683f43bfbccf)
|
||||
- [Docs] fix example to use `safer-buffer` [`48cae12`](https://github.com/inspect-js/object-inspect/commit/48cae12a73ec6cacc955175bc56bbe6aee6a211f)
|
||||
|
||||
## [v1.5.0](https://github.com/inspect-js/object-inspect/compare/v1.4.1...v1.5.0) - 2017-12-25
|
||||
|
||||
### Commits
|
||||
|
||||
- [New] add `quoteStyle` option [`f5a72d2`](https://github.com/inspect-js/object-inspect/commit/f5a72d26edb3959b048f74c056ca7100a6b091e4)
|
||||
- [Tests] add more test coverage [`30ebe4e`](https://github.com/inspect-js/object-inspect/commit/30ebe4e1fa943b99ecbb85be7614256d536e2759)
|
||||
- [Tests] require 0.6 to pass [`99a008c`](https://github.com/inspect-js/object-inspect/commit/99a008ccace189a60fd7da18bf00e32c9572b980)
|
||||
|
||||
## [v1.4.1](https://github.com/inspect-js/object-inspect/compare/v1.4.0...v1.4.1) - 2017-12-19
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] up to `node` `v9.3`, `v8.9`, `v6.12` [`6674476`](https://github.com/inspect-js/object-inspect/commit/6674476cc56acaac1bde96c84fed5ef631911906)
|
||||
- [Fix] `inspect(Object(-0))` should be “Object(-0)”, not “Object(0)” [`d0a031f`](https://github.com/inspect-js/object-inspect/commit/d0a031f1cbb3024ee9982bfe364dd18a7e4d1bd3)
|
||||
|
||||
## [v1.4.0](https://github.com/inspect-js/object-inspect/compare/v1.3.0...v1.4.0) - 2017-10-24
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] add `npm run coverage` [`3b48fb2`](https://github.com/inspect-js/object-inspect/commit/3b48fb25db037235eeb808f0b2830aad7aa36f70)
|
||||
- [Tests] remove commented-out osx builds [`71e24db`](https://github.com/inspect-js/object-inspect/commit/71e24db8ad6ee3b9b381c5300b0475f2ba595a73)
|
||||
- [New] add support for `util.inspect.custom`, in node only. [`20cca77`](https://github.com/inspect-js/object-inspect/commit/20cca7762d7e17f15b21a90793dff84acce155df)
|
||||
- [Tests] up to `node` `v8.6`; use `nvm install-latest-npm` to ensure new npm doesn’t break old node [`252952d`](https://github.com/inspect-js/object-inspect/commit/252952d230d8065851dd3d4d5fe8398aae068529)
|
||||
- [Tests] up to `node` `v8.8` [`4aa868d`](https://github.com/inspect-js/object-inspect/commit/4aa868d3a62914091d489dd6ec6eed194ee67cd3)
|
||||
- [Dev Deps] update `core-js`, `tape` [`59483d1`](https://github.com/inspect-js/object-inspect/commit/59483d1df418f852f51fa0db7b24aa6b0209a27a)
|
||||
|
||||
## [v1.3.0](https://github.com/inspect-js/object-inspect/compare/v1.2.2...v1.3.0) - 2017-07-31
|
||||
|
||||
### Fixed
|
||||
|
||||
- [Fix] Map/Set: work around core-js bug < v2.5.0 [`#9`](https://github.com/inspect-js/object-inspect/issues/9)
|
||||
|
||||
### Commits
|
||||
|
||||
- [New] add support for arrays with additional object keys [`0d19937`](https://github.com/inspect-js/object-inspect/commit/0d199374ee37959e51539616666f420ccb29acb9)
|
||||
- [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`; fix new npm breaking on older nodes [`e24784a`](https://github.com/inspect-js/object-inspect/commit/e24784a90c49117787157a12a63897c49cf89bbb)
|
||||
- Only apps should have lockfiles [`c6faebc`](https://github.com/inspect-js/object-inspect/commit/c6faebcb2ee486a889a4a1c4d78c0776c7576185)
|
||||
- [Dev Deps] update `tape` [`7345a0a`](https://github.com/inspect-js/object-inspect/commit/7345a0aeba7e91b888a079c10004d17696a7f586)
|
||||
|
||||
## [v1.2.2](https://github.com/inspect-js/object-inspect/compare/v1.2.1...v1.2.2) - 2017-03-24
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] up to `node` `v7.7`, `v6.10`, `v4.8`; improve test matrix [`a2ddc15`](https://github.com/inspect-js/object-inspect/commit/a2ddc15a1f2c65af18076eea1c0eb9cbceb478a0)
|
||||
- [Tests] up to `node` `v7.0`, `v6.9`, `v5.12`, `v4.6`, `io.js` `v3.3`; improve test matrix [`a48949f`](https://github.com/inspect-js/object-inspect/commit/a48949f6b574b2d4d2298109d8e8d0eb3e7a83e7)
|
||||
- [Performance] check for primitive types as early as possible. [`3b8092a`](https://github.com/inspect-js/object-inspect/commit/3b8092a2a4deffd0575f94334f00194e2d48dad3)
|
||||
- [Refactor] remove unneeded `else`s. [`7255034`](https://github.com/inspect-js/object-inspect/commit/725503402e08de4f96f6bf2d8edef44ac36f26b6)
|
||||
- [Refactor] avoid recreating `lowbyte` function every time. [`81edd34`](https://github.com/inspect-js/object-inspect/commit/81edd3475bd15bdd18e84de7472033dcf5004aaa)
|
||||
- [Fix] differentiate -0 from 0 [`521d345`](https://github.com/inspect-js/object-inspect/commit/521d3456b009da7bf1c5785c8a9df5a9f8718264)
|
||||
- [Refactor] move object key gathering into separate function [`aca6265`](https://github.com/inspect-js/object-inspect/commit/aca626536eaeef697196c6e9db3e90e7e0355b6a)
|
||||
- [Refactor] consolidate wrapping logic for boxed primitives into a function. [`4e440cd`](https://github.com/inspect-js/object-inspect/commit/4e440cd9065df04802a2a1dead03f48c353ca301)
|
||||
- [Robustness] use `typeof` instead of comparing to literal `undefined` [`5ca6f60`](https://github.com/inspect-js/object-inspect/commit/5ca6f601937506daff8ed2fcf686363b55807b69)
|
||||
- [Refactor] consolidate Map/Set notations. [`4e576e5`](https://github.com/inspect-js/object-inspect/commit/4e576e5d7ed2f9ec3fb7f37a0d16732eb10758a9)
|
||||
- [Tests] ensure that this function remains anonymous, despite ES6 name inference. [`7540ae5`](https://github.com/inspect-js/object-inspect/commit/7540ae591278756db614fa4def55ca413150e1a3)
|
||||
- [Refactor] explicitly coerce Error objects to strings. [`7f4ca84`](https://github.com/inspect-js/object-inspect/commit/7f4ca8424ee8dc2c0ca5a422d94f7fac40327261)
|
||||
- [Refactor] split up `var` declarations for debuggability [`6f2c11e`](https://github.com/inspect-js/object-inspect/commit/6f2c11e6a85418586a00292dcec5e97683f89bc3)
|
||||
- [Robustness] cache `Object.prototype.toString` [`df44a20`](https://github.com/inspect-js/object-inspect/commit/df44a20adfccf31529d60d1df2079bfc3c836e27)
|
||||
- [Dev Deps] update `tape` [`3ec714e`](https://github.com/inspect-js/object-inspect/commit/3ec714eba57bc3f58a6eb4fca1376f49e70d300a)
|
||||
- [Dev Deps] update `tape` [`beb72d9`](https://github.com/inspect-js/object-inspect/commit/beb72d969653747d7cde300393c28755375329b0)
|
||||
|
||||
## [v1.2.1](https://github.com/inspect-js/object-inspect/compare/v1.2.0...v1.2.1) - 2016-04-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- [Fix] fix Boolean `false` object inspection. [`#7`](https://github.com/substack/object-inspect/pull/7)
|
||||
|
||||
## [v1.2.0](https://github.com/inspect-js/object-inspect/compare/v1.1.0...v1.2.0) - 2016-04-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- [New] add support for inspecting String/Number/Boolean objects. [`#6`](https://github.com/inspect-js/object-inspect/issues/6)
|
||||
|
||||
### Commits
|
||||
|
||||
- [Dev Deps] update `tape` [`742caa2`](https://github.com/inspect-js/object-inspect/commit/742caa262cf7af4c815d4821c8bd0129c1446432)
|
||||
|
||||
## [v1.1.0](https://github.com/inspect-js/object-inspect/compare/1.0.2...v1.1.0) - 2015-12-14
|
||||
|
||||
### Merged
|
||||
|
||||
- [New] add ES6 Map/Set support. [`#4`](https://github.com/inspect-js/object-inspect/pull/4)
|
||||
|
||||
### Fixed
|
||||
|
||||
- [New] add ES6 Map/Set support. [`#3`](https://github.com/inspect-js/object-inspect/issues/3)
|
||||
|
||||
### Commits
|
||||
|
||||
- Update `travis.yml` to test on bunches of `iojs` and `node` versions. [`4c1fd65`](https://github.com/inspect-js/object-inspect/commit/4c1fd65cc3bd95307e854d114b90478324287fd2)
|
||||
- [Dev Deps] update `tape` [`88a907e`](https://github.com/inspect-js/object-inspect/commit/88a907e33afbe408e4b5d6e4e42a33143f88848c)
|
||||
|
||||
## [1.0.2](https://github.com/inspect-js/object-inspect/compare/1.0.1...1.0.2) - 2015-08-07
|
||||
|
||||
### Commits
|
||||
|
||||
- [Fix] Cache `Object.prototype.hasOwnProperty` in case it's deleted later. [`1d0075d`](https://github.com/inspect-js/object-inspect/commit/1d0075d3091dc82246feeb1f9871cb2b8ed227b3)
|
||||
- [Dev Deps] Update `tape` [`ca8d5d7`](https://github.com/inspect-js/object-inspect/commit/ca8d5d75635ddbf76f944e628267581e04958457)
|
||||
- gitignore node_modules since this is a reusable modules. [`ed41407`](https://github.com/inspect-js/object-inspect/commit/ed41407811743ca530cdeb28f982beb96026af82)
|
||||
|
||||
## [1.0.1](https://github.com/inspect-js/object-inspect/compare/1.0.0...1.0.1) - 2015-07-19
|
||||
|
||||
### Commits
|
||||
|
||||
- Make `inspect` work with symbol primitives and objects, including in node 0.11 and 0.12. [`ddf1b94`](https://github.com/inspect-js/object-inspect/commit/ddf1b94475ab951f1e3bccdc0a48e9073cfbfef4)
|
||||
- bump tape [`103d674`](https://github.com/inspect-js/object-inspect/commit/103d67496b504bdcfdd765d303a773f87ec106e2)
|
||||
- use newer travis config [`d497276`](https://github.com/inspect-js/object-inspect/commit/d497276c1da14234bb5098a59cf20de75fbc316a)
|
||||
|
||||
## [1.0.0](https://github.com/inspect-js/object-inspect/compare/0.4.0...1.0.0) - 2014-08-05
|
||||
|
||||
### Commits
|
||||
|
||||
- error inspect works properly [`260a22d`](https://github.com/inspect-js/object-inspect/commit/260a22d134d3a8a482c67d52091c6040c34f4299)
|
||||
- seen coverage [`57269e8`](https://github.com/inspect-js/object-inspect/commit/57269e8baa992a7439047f47325111fdcbcb8417)
|
||||
- htmlelement instance coverage [`397ffe1`](https://github.com/inspect-js/object-inspect/commit/397ffe10a1980350868043ef9de65686d438979f)
|
||||
- more element coverage [`6905cc2`](https://github.com/inspect-js/object-inspect/commit/6905cc2f7df35600177e613b0642b4df5efd3eca)
|
||||
- failing test for type errors [`385b615`](https://github.com/inspect-js/object-inspect/commit/385b6152e49b51b68449a662f410b084ed7c601a)
|
||||
- fn name coverage [`edc906d`](https://github.com/inspect-js/object-inspect/commit/edc906d40fca6b9194d304062c037ee8e398c4c2)
|
||||
- server-side element test [`362d1d3`](https://github.com/inspect-js/object-inspect/commit/362d1d3e86f187651c29feeb8478110afada385b)
|
||||
- custom inspect fn [`e89b0f6`](https://github.com/inspect-js/object-inspect/commit/e89b0f6fe6d5e03681282af83732a509160435a6)
|
||||
- fixed browser test [`b530882`](https://github.com/inspect-js/object-inspect/commit/b5308824a1c8471c5617e394766a03a6977102a9)
|
||||
- depth test, matches node [`1cfd9e0`](https://github.com/inspect-js/object-inspect/commit/1cfd9e0285a4ae1dff44101ad482915d9bf47e48)
|
||||
- exercise hasOwnProperty path [`8d753fb`](https://github.com/inspect-js/object-inspect/commit/8d753fb362a534fa1106e4d80f2ee9bea06a66d9)
|
||||
- more cases covered for errors [`c5c46a5`](https://github.com/inspect-js/object-inspect/commit/c5c46a569ec4606583497e8550f0d8c7ad39a4a4)
|
||||
- \W obj key test case [`b0eceee`](https://github.com/inspect-js/object-inspect/commit/b0eceeea6e0eb94d686c1046e99b9e25e5005f75)
|
||||
- coverage for explicit depth param [`e12b91c`](https://github.com/inspect-js/object-inspect/commit/e12b91cd59683362f3a0e80f46481a0211e26c15)
|
||||
|
||||
## [0.4.0](https://github.com/inspect-js/object-inspect/compare/0.3.1...0.4.0) - 2014-03-21
|
||||
|
||||
### Commits
|
||||
|
||||
- passing lowbyte interpolation test [`b847511`](https://github.com/inspect-js/object-inspect/commit/b8475114f5def7e7961c5353d48d3d8d9a520985)
|
||||
- lowbyte test [`4a2b0e1`](https://github.com/inspect-js/object-inspect/commit/4a2b0e142667fc933f195472759385ac08f3946c)
|
||||
|
||||
## [0.3.1](https://github.com/inspect-js/object-inspect/compare/0.3.0...0.3.1) - 2014-03-04
|
||||
|
||||
### Commits
|
||||
|
||||
- sort keys [`a07b19c`](https://github.com/inspect-js/object-inspect/commit/a07b19cc3b1521a82d4fafb6368b7a9775428a05)
|
||||
|
||||
## [0.3.0](https://github.com/inspect-js/object-inspect/compare/0.2.0...0.3.0) - 2014-03-04
|
||||
|
||||
### Commits
|
||||
|
||||
- [] and {} instead of [ ] and { } [`654c44b`](https://github.com/inspect-js/object-inspect/commit/654c44b2865811f3519e57bb8526e0821caf5c6b)
|
||||
|
||||
## [0.2.0](https://github.com/inspect-js/object-inspect/compare/0.1.3...0.2.0) - 2014-03-04
|
||||
|
||||
### Commits
|
||||
|
||||
- failing holes test [`99cdfad`](https://github.com/inspect-js/object-inspect/commit/99cdfad03c6474740275a75636fe6ca86c77737a)
|
||||
- regex already work [`e324033`](https://github.com/inspect-js/object-inspect/commit/e324033267025995ec97d32ed0a65737c99477a6)
|
||||
- failing undef/null test [`1f88a00`](https://github.com/inspect-js/object-inspect/commit/1f88a00265d3209719dda8117b7e6360b4c20943)
|
||||
- holes in the all example [`7d345f3`](https://github.com/inspect-js/object-inspect/commit/7d345f3676dcbe980cff89a4f6c243269ebbb709)
|
||||
- check for .inspect(), fixes Buffer use-case [`c3f7546`](https://github.com/inspect-js/object-inspect/commit/c3f75466dbca125347d49847c05262c292f12b79)
|
||||
- fixes for holes [`ce25f73`](https://github.com/inspect-js/object-inspect/commit/ce25f736683de4b92ff27dc5471218415e2d78d8)
|
||||
- weird null behavior [`405c1ea`](https://github.com/inspect-js/object-inspect/commit/405c1ea72cd5a8cf3b498c3eaa903d01b9fbcab5)
|
||||
- tape is actually a devDependency, upgrade [`703b0ce`](https://github.com/inspect-js/object-inspect/commit/703b0ce6c5817b4245a082564bccd877e0bb6990)
|
||||
- put date in the example [`a342219`](https://github.com/inspect-js/object-inspect/commit/a3422190eeaa013215f46df2d0d37b48595ac058)
|
||||
- passing the null test [`4ab737e`](https://github.com/inspect-js/object-inspect/commit/4ab737ebf862a75d247ebe51e79307a34d6380d4)
|
||||
|
||||
## [0.1.3](https://github.com/inspect-js/object-inspect/compare/0.1.1...0.1.3) - 2013-07-26
|
||||
|
||||
### Commits
|
||||
|
||||
- special isElement() check [`882768a`](https://github.com/inspect-js/object-inspect/commit/882768a54035d30747be9de1baf14e5aa0daa128)
|
||||
- oh right old IEs don't have indexOf either [`36d1275`](https://github.com/inspect-js/object-inspect/commit/36d12756c38b08a74370b0bb696c809e529913a5)
|
||||
|
||||
## [0.1.1](https://github.com/inspect-js/object-inspect/compare/0.1.0...0.1.1) - 2013-07-26
|
||||
|
||||
### Commits
|
||||
|
||||
- tests! [`4422fd9`](https://github.com/inspect-js/object-inspect/commit/4422fd95532c2745aa6c4f786f35f1090be29998)
|
||||
- fix for ie<9, doesn't have hasOwnProperty [`6b7d611`](https://github.com/inspect-js/object-inspect/commit/6b7d61183050f6da801ea04473211da226482613)
|
||||
- fix for all IEs: no f.name [`4e0c2f6`](https://github.com/inspect-js/object-inspect/commit/4e0c2f6dfd01c306d067d7163319acc97c94ee50)
|
||||
- badges [`5ed0d88`](https://github.com/inspect-js/object-inspect/commit/5ed0d88e4e407f9cb327fa4a146c17921f9680f3)
|
||||
|
||||
## [0.1.0](https://github.com/inspect-js/object-inspect/compare/0.0.0...0.1.0) - 2013-07-26
|
||||
|
||||
### Commits
|
||||
|
||||
- [Function] for functions [`ad5c485`](https://github.com/inspect-js/object-inspect/commit/ad5c485098fc83352cb540a60b2548ca56820e0b)
|
||||
|
||||
## 0.0.0 - 2013-07-26
|
||||
|
||||
### Commits
|
||||
|
||||
- working browser example [`34be6b6`](https://github.com/inspect-js/object-inspect/commit/34be6b6548f9ce92bdc3c27572857ba0c4a1218d)
|
||||
- package.json etc [`cad51f2`](https://github.com/inspect-js/object-inspect/commit/cad51f23fc6bcf1a456ed6abe16088256c2f632f)
|
||||
- docs complete [`b80cce2`](https://github.com/inspect-js/object-inspect/commit/b80cce2490c4e7183a9ee11ea89071f0abec4446)
|
||||
- circular example [`4b4a7b9`](https://github.com/inspect-js/object-inspect/commit/4b4a7b92209e4e6b4630976cb6bcd17d14165a59)
|
||||
- string rep [`7afb479`](https://github.com/inspect-js/object-inspect/commit/7afb479baa798d27f09e0a178b72ea327f60f5c8)
|
21
node_modules/object-inspect/LICENSE
generated
vendored
Normal file
21
node_modules/object-inspect/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2013 James Halliday
|
||||
|
||||
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.
|
23
node_modules/object-inspect/example/all.js
generated
vendored
Normal file
23
node_modules/object-inspect/example/all.js
generated
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
var inspect = require('../');
|
||||
var Buffer = require('safer-buffer').Buffer;
|
||||
|
||||
var holes = ['a', 'b'];
|
||||
holes[4] = 'e';
|
||||
holes[6] = 'g';
|
||||
|
||||
var obj = {
|
||||
a: 1,
|
||||
b: [3, 4, undefined, null],
|
||||
c: undefined,
|
||||
d: null,
|
||||
e: {
|
||||
regex: /^x/i,
|
||||
buf: Buffer.from('abc'),
|
||||
holes: holes
|
||||
},
|
||||
now: new Date()
|
||||
};
|
||||
obj.self = obj;
|
||||
console.log(inspect(obj));
|
6
node_modules/object-inspect/example/circular.js
generated
vendored
Normal file
6
node_modules/object-inspect/example/circular.js
generated
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
var inspect = require('../');
|
||||
var obj = { a: 1, b: [3, 4] };
|
||||
obj.c = obj;
|
||||
console.log(inspect(obj));
|
5
node_modules/object-inspect/example/fn.js
generated
vendored
Normal file
5
node_modules/object-inspect/example/fn.js
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
var inspect = require('../');
|
||||
var obj = [1, 2, function f(n) { return n + 5; }, 4];
|
||||
console.log(inspect(obj));
|
10
node_modules/object-inspect/example/inspect.js
generated
vendored
Normal file
10
node_modules/object-inspect/example/inspect.js
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
/* eslint-env browser */
|
||||
var inspect = require('../');
|
||||
|
||||
var d = document.createElement('div');
|
||||
d.setAttribute('id', 'beep');
|
||||
d.innerHTML = '<b>wooo</b><i>iiiii</i>';
|
||||
|
||||
console.log(inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }]));
|
512
node_modules/object-inspect/index.js
generated
vendored
Normal file
512
node_modules/object-inspect/index.js
generated
vendored
Normal file
@ -0,0 +1,512 @@
|
||||
var hasMap = typeof Map === 'function' && Map.prototype;
|
||||
var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
|
||||
var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
|
||||
var mapForEach = hasMap && Map.prototype.forEach;
|
||||
var hasSet = typeof Set === 'function' && Set.prototype;
|
||||
var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
|
||||
var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
|
||||
var setForEach = hasSet && Set.prototype.forEach;
|
||||
var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
|
||||
var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
|
||||
var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
|
||||
var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
|
||||
var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
|
||||
var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
|
||||
var booleanValueOf = Boolean.prototype.valueOf;
|
||||
var objectToString = Object.prototype.toString;
|
||||
var functionToString = Function.prototype.toString;
|
||||
var $match = String.prototype.match;
|
||||
var $slice = String.prototype.slice;
|
||||
var $replace = String.prototype.replace;
|
||||
var $toUpperCase = String.prototype.toUpperCase;
|
||||
var $toLowerCase = String.prototype.toLowerCase;
|
||||
var $test = RegExp.prototype.test;
|
||||
var $concat = Array.prototype.concat;
|
||||
var $join = Array.prototype.join;
|
||||
var $arrSlice = Array.prototype.slice;
|
||||
var $floor = Math.floor;
|
||||
var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
|
||||
var gOPS = Object.getOwnPropertySymbols;
|
||||
var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
|
||||
var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
|
||||
// ie, `has-tostringtag/shams
|
||||
var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
|
||||
? Symbol.toStringTag
|
||||
: null;
|
||||
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
|
||||
var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
|
||||
[].__proto__ === Array.prototype // eslint-disable-line no-proto
|
||||
? function (O) {
|
||||
return O.__proto__; // eslint-disable-line no-proto
|
||||
}
|
||||
: null
|
||||
);
|
||||
|
||||
function addNumericSeparator(num, str) {
|
||||
if (
|
||||
num === Infinity
|
||||
|| num === -Infinity
|
||||
|| num !== num
|
||||
|| (num && num > -1000 && num < 1000)
|
||||
|| $test.call(/e/, str)
|
||||
) {
|
||||
return str;
|
||||
}
|
||||
var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
|
||||
if (typeof num === 'number') {
|
||||
var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
|
||||
if (int !== num) {
|
||||
var intStr = String(int);
|
||||
var dec = $slice.call(str, intStr.length + 1);
|
||||
return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
|
||||
}
|
||||
}
|
||||
return $replace.call(str, sepRegex, '$&_');
|
||||
}
|
||||
|
||||
var utilInspect = require('./util.inspect');
|
||||
var inspectCustom = utilInspect.custom;
|
||||
var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
|
||||
|
||||
module.exports = function inspect_(obj, options, depth, seen) {
|
||||
var opts = options || {};
|
||||
|
||||
if (has(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
|
||||
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
||||
}
|
||||
if (
|
||||
has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
|
||||
? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
|
||||
: opts.maxStringLength !== null
|
||||
)
|
||||
) {
|
||||
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
|
||||
}
|
||||
var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
|
||||
if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
|
||||
throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
|
||||
}
|
||||
|
||||
if (
|
||||
has(opts, 'indent')
|
||||
&& opts.indent !== null
|
||||
&& opts.indent !== '\t'
|
||||
&& !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
|
||||
) {
|
||||
throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
|
||||
}
|
||||
if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
|
||||
throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
|
||||
}
|
||||
var numericSeparator = opts.numericSeparator;
|
||||
|
||||
if (typeof obj === 'undefined') {
|
||||
return 'undefined';
|
||||
}
|
||||
if (obj === null) {
|
||||
return 'null';
|
||||
}
|
||||
if (typeof obj === 'boolean') {
|
||||
return obj ? 'true' : 'false';
|
||||
}
|
||||
|
||||
if (typeof obj === 'string') {
|
||||
return inspectString(obj, opts);
|
||||
}
|
||||
if (typeof obj === 'number') {
|
||||
if (obj === 0) {
|
||||
return Infinity / obj > 0 ? '0' : '-0';
|
||||
}
|
||||
var str = String(obj);
|
||||
return numericSeparator ? addNumericSeparator(obj, str) : str;
|
||||
}
|
||||
if (typeof obj === 'bigint') {
|
||||
var bigIntStr = String(obj) + 'n';
|
||||
return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
|
||||
}
|
||||
|
||||
var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
|
||||
if (typeof depth === 'undefined') { depth = 0; }
|
||||
if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
|
||||
return isArray(obj) ? '[Array]' : '[Object]';
|
||||
}
|
||||
|
||||
var indent = getIndent(opts, depth);
|
||||
|
||||
if (typeof seen === 'undefined') {
|
||||
seen = [];
|
||||
} else if (indexOf(seen, obj) >= 0) {
|
||||
return '[Circular]';
|
||||
}
|
||||
|
||||
function inspect(value, from, noIndent) {
|
||||
if (from) {
|
||||
seen = $arrSlice.call(seen);
|
||||
seen.push(from);
|
||||
}
|
||||
if (noIndent) {
|
||||
var newOpts = {
|
||||
depth: opts.depth
|
||||
};
|
||||
if (has(opts, 'quoteStyle')) {
|
||||
newOpts.quoteStyle = opts.quoteStyle;
|
||||
}
|
||||
return inspect_(value, newOpts, depth + 1, seen);
|
||||
}
|
||||
return inspect_(value, opts, depth + 1, seen);
|
||||
}
|
||||
|
||||
if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable
|
||||
var name = nameOf(obj);
|
||||
var keys = arrObjKeys(obj, inspect);
|
||||
return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
|
||||
}
|
||||
if (isSymbol(obj)) {
|
||||
var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
|
||||
return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
|
||||
}
|
||||
if (isElement(obj)) {
|
||||
var s = '<' + $toLowerCase.call(String(obj.nodeName));
|
||||
var attrs = obj.attributes || [];
|
||||
for (var i = 0; i < attrs.length; i++) {
|
||||
s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
|
||||
}
|
||||
s += '>';
|
||||
if (obj.childNodes && obj.childNodes.length) { s += '...'; }
|
||||
s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
|
||||
return s;
|
||||
}
|
||||
if (isArray(obj)) {
|
||||
if (obj.length === 0) { return '[]'; }
|
||||
var xs = arrObjKeys(obj, inspect);
|
||||
if (indent && !singleLineValues(xs)) {
|
||||
return '[' + indentedJoin(xs, indent) + ']';
|
||||
}
|
||||
return '[ ' + $join.call(xs, ', ') + ' ]';
|
||||
}
|
||||
if (isError(obj)) {
|
||||
var parts = arrObjKeys(obj, inspect);
|
||||
if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
|
||||
return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
|
||||
}
|
||||
if (parts.length === 0) { return '[' + String(obj) + ']'; }
|
||||
return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
|
||||
}
|
||||
if (typeof obj === 'object' && customInspect) {
|
||||
if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
|
||||
return utilInspect(obj, { depth: maxDepth - depth });
|
||||
} else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
|
||||
return obj.inspect();
|
||||
}
|
||||
}
|
||||
if (isMap(obj)) {
|
||||
var mapParts = [];
|
||||
mapForEach.call(obj, function (value, key) {
|
||||
mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
|
||||
});
|
||||
return collectionOf('Map', mapSize.call(obj), mapParts, indent);
|
||||
}
|
||||
if (isSet(obj)) {
|
||||
var setParts = [];
|
||||
setForEach.call(obj, function (value) {
|
||||
setParts.push(inspect(value, obj));
|
||||
});
|
||||
return collectionOf('Set', setSize.call(obj), setParts, indent);
|
||||
}
|
||||
if (isWeakMap(obj)) {
|
||||
return weakCollectionOf('WeakMap');
|
||||
}
|
||||
if (isWeakSet(obj)) {
|
||||
return weakCollectionOf('WeakSet');
|
||||
}
|
||||
if (isWeakRef(obj)) {
|
||||
return weakCollectionOf('WeakRef');
|
||||
}
|
||||
if (isNumber(obj)) {
|
||||
return markBoxed(inspect(Number(obj)));
|
||||
}
|
||||
if (isBigInt(obj)) {
|
||||
return markBoxed(inspect(bigIntValueOf.call(obj)));
|
||||
}
|
||||
if (isBoolean(obj)) {
|
||||
return markBoxed(booleanValueOf.call(obj));
|
||||
}
|
||||
if (isString(obj)) {
|
||||
return markBoxed(inspect(String(obj)));
|
||||
}
|
||||
if (!isDate(obj) && !isRegExp(obj)) {
|
||||
var ys = arrObjKeys(obj, inspect);
|
||||
var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
|
||||
var protoTag = obj instanceof Object ? '' : 'null prototype';
|
||||
var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
|
||||
var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
|
||||
var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
|
||||
if (ys.length === 0) { return tag + '{}'; }
|
||||
if (indent) {
|
||||
return tag + '{' + indentedJoin(ys, indent) + '}';
|
||||
}
|
||||
return tag + '{ ' + $join.call(ys, ', ') + ' }';
|
||||
}
|
||||
return String(obj);
|
||||
};
|
||||
|
||||
function wrapQuotes(s, defaultStyle, opts) {
|
||||
var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
|
||||
return quoteChar + s + quoteChar;
|
||||
}
|
||||
|
||||
function quote(s) {
|
||||
return $replace.call(String(s), /"/g, '"');
|
||||
}
|
||||
|
||||
function isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||||
function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||||
function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||||
function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||||
function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||||
function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||||
function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
|
||||
|
||||
// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
|
||||
function isSymbol(obj) {
|
||||
if (hasShammedSymbols) {
|
||||
return obj && typeof obj === 'object' && obj instanceof Symbol;
|
||||
}
|
||||
if (typeof obj === 'symbol') {
|
||||
return true;
|
||||
}
|
||||
if (!obj || typeof obj !== 'object' || !symToString) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
symToString.call(obj);
|
||||
return true;
|
||||
} catch (e) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isBigInt(obj) {
|
||||
if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
bigIntValueOf.call(obj);
|
||||
return true;
|
||||
} catch (e) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
|
||||
function has(obj, key) {
|
||||
return hasOwn.call(obj, key);
|
||||
}
|
||||
|
||||
function toStr(obj) {
|
||||
return objectToString.call(obj);
|
||||
}
|
||||
|
||||
function nameOf(f) {
|
||||
if (f.name) { return f.name; }
|
||||
var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
|
||||
if (m) { return m[1]; }
|
||||
return null;
|
||||
}
|
||||
|
||||
function indexOf(xs, x) {
|
||||
if (xs.indexOf) { return xs.indexOf(x); }
|
||||
for (var i = 0, l = xs.length; i < l; i++) {
|
||||
if (xs[i] === x) { return i; }
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
function isMap(x) {
|
||||
if (!mapSize || !x || typeof x !== 'object') {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
mapSize.call(x);
|
||||
try {
|
||||
setSize.call(x);
|
||||
} catch (s) {
|
||||
return true;
|
||||
}
|
||||
return x instanceof Map; // core-js workaround, pre-v2.5.0
|
||||
} catch (e) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isWeakMap(x) {
|
||||
if (!weakMapHas || !x || typeof x !== 'object') {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
weakMapHas.call(x, weakMapHas);
|
||||
try {
|
||||
weakSetHas.call(x, weakSetHas);
|
||||
} catch (s) {
|
||||
return true;
|
||||
}
|
||||
return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
|
||||
} catch (e) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isWeakRef(x) {
|
||||
if (!weakRefDeref || !x || typeof x !== 'object') {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
weakRefDeref.call(x);
|
||||
return true;
|
||||
} catch (e) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isSet(x) {
|
||||
if (!setSize || !x || typeof x !== 'object') {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
setSize.call(x);
|
||||
try {
|
||||
mapSize.call(x);
|
||||
} catch (m) {
|
||||
return true;
|
||||
}
|
||||
return x instanceof Set; // core-js workaround, pre-v2.5.0
|
||||
} catch (e) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isWeakSet(x) {
|
||||
if (!weakSetHas || !x || typeof x !== 'object') {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
weakSetHas.call(x, weakSetHas);
|
||||
try {
|
||||
weakMapHas.call(x, weakMapHas);
|
||||
} catch (s) {
|
||||
return true;
|
||||
}
|
||||
return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
|
||||
} catch (e) {}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isElement(x) {
|
||||
if (!x || typeof x !== 'object') { return false; }
|
||||
if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
|
||||
return true;
|
||||
}
|
||||
return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
|
||||
}
|
||||
|
||||
function inspectString(str, opts) {
|
||||
if (str.length > opts.maxStringLength) {
|
||||
var remaining = str.length - opts.maxStringLength;
|
||||
var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
|
||||
return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
|
||||
}
|
||||
// eslint-disable-next-line no-control-regex
|
||||
var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
|
||||
return wrapQuotes(s, 'single', opts);
|
||||
}
|
||||
|
||||
function lowbyte(c) {
|
||||
var n = c.charCodeAt(0);
|
||||
var x = {
|
||||
8: 'b',
|
||||
9: 't',
|
||||
10: 'n',
|
||||
12: 'f',
|
||||
13: 'r'
|
||||
}[n];
|
||||
if (x) { return '\\' + x; }
|
||||
return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
|
||||
}
|
||||
|
||||
function markBoxed(str) {
|
||||
return 'Object(' + str + ')';
|
||||
}
|
||||
|
||||
function weakCollectionOf(type) {
|
||||
return type + ' { ? }';
|
||||
}
|
||||
|
||||
function collectionOf(type, size, entries, indent) {
|
||||
var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
|
||||
return type + ' (' + size + ') {' + joinedEntries + '}';
|
||||
}
|
||||
|
||||
function singleLineValues(xs) {
|
||||
for (var i = 0; i < xs.length; i++) {
|
||||
if (indexOf(xs[i], '\n') >= 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function getIndent(opts, depth) {
|
||||
var baseIndent;
|
||||
if (opts.indent === '\t') {
|
||||
baseIndent = '\t';
|
||||
} else if (typeof opts.indent === 'number' && opts.indent > 0) {
|
||||
baseIndent = $join.call(Array(opts.indent + 1), ' ');
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
base: baseIndent,
|
||||
prev: $join.call(Array(depth + 1), baseIndent)
|
||||
};
|
||||
}
|
||||
|
||||
function indentedJoin(xs, indent) {
|
||||
if (xs.length === 0) { return ''; }
|
||||
var lineJoiner = '\n' + indent.prev + indent.base;
|
||||
return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
|
||||
}
|
||||
|
||||
function arrObjKeys(obj, inspect) {
|
||||
var isArr = isArray(obj);
|
||||
var xs = [];
|
||||
if (isArr) {
|
||||
xs.length = obj.length;
|
||||
for (var i = 0; i < obj.length; i++) {
|
||||
xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
|
||||
}
|
||||
}
|
||||
var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
|
||||
var symMap;
|
||||
if (hasShammedSymbols) {
|
||||
symMap = {};
|
||||
for (var k = 0; k < syms.length; k++) {
|
||||
symMap['$' + syms[k]] = syms[k];
|
||||
}
|
||||
}
|
||||
|
||||
for (var key in obj) { // eslint-disable-line no-restricted-syntax
|
||||
if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
||||
if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
|
||||
if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
|
||||
// this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
|
||||
continue; // eslint-disable-line no-restricted-syntax, no-continue
|
||||
} else if ($test.call(/[^\w$]/, key)) {
|
||||
xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
|
||||
} else {
|
||||
xs.push(key + ': ' + inspect(obj[key], obj));
|
||||
}
|
||||
}
|
||||
if (typeof gOPS === 'function') {
|
||||
for (var j = 0; j < syms.length; j++) {
|
||||
if (isEnumerable.call(obj, syms[j])) {
|
||||
xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
return xs;
|
||||
}
|
20
node_modules/object-inspect/package-support.json
generated
vendored
Normal file
20
node_modules/object-inspect/package-support.json
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"version": "*",
|
||||
"target": {
|
||||
"node": "all"
|
||||
},
|
||||
"response": {
|
||||
"type": "time-permitting"
|
||||
},
|
||||
"backing": {
|
||||
"npm-funding": true,
|
||||
"donations": [
|
||||
"https://github.com/ljharb",
|
||||
"https://tidelift.com/funding/github/npm/object-inspect"
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
94
node_modules/object-inspect/package.json
generated
vendored
Normal file
94
node_modules/object-inspect/package.json
generated
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
{
|
||||
"name": "object-inspect",
|
||||
"version": "1.12.2",
|
||||
"description": "string representations of objects in node and the browser",
|
||||
"main": "index.js",
|
||||
"sideEffects": false,
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^21.0.0",
|
||||
"aud": "^2.0.0",
|
||||
"auto-changelog": "^2.4.0",
|
||||
"core-js": "^2.6.12",
|
||||
"error-cause": "^1.0.4",
|
||||
"es-value-fixtures": "^1.4.1",
|
||||
"eslint": "=8.8.0",
|
||||
"for-each": "^0.3.3",
|
||||
"functions-have-names": "^1.2.3",
|
||||
"has-tostringtag": "^1.0.0",
|
||||
"make-arrow-function": "^1.2.0",
|
||||
"mock-property": "^1.0.0",
|
||||
"npmignore": "^0.3.0",
|
||||
"nyc": "^10.3.2",
|
||||
"safe-publish-latest": "^2.0.0",
|
||||
"string.prototype.repeat": "^1.0.0",
|
||||
"tape": "^5.5.3"
|
||||
},
|
||||
"scripts": {
|
||||
"prepack": "npmignore --auto --commentLines=autogenerated",
|
||||
"prepublish": "not-in-publish || npm run prepublishOnly",
|
||||
"prepublishOnly": "safe-publish-latest",
|
||||
"pretest": "npm run lint",
|
||||
"lint": "eslint .",
|
||||
"test": "npm run tests-only && npm run test:corejs",
|
||||
"tests-only": "nyc tape 'test/*.js'",
|
||||
"test:corejs": "nyc tape test-core-js.js 'test/*.js'",
|
||||
"posttest": "npx aud --production",
|
||||
"version": "auto-changelog && git add CHANGELOG.md",
|
||||
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
||||
},
|
||||
"testling": {
|
||||
"files": [
|
||||
"test/*.js",
|
||||
"test/browser/*.js"
|
||||
],
|
||||
"browsers": [
|
||||
"ie/6..latest",
|
||||
"chrome/latest",
|
||||
"firefox/latest",
|
||||
"safari/latest",
|
||||
"opera/latest",
|
||||
"iphone/latest",
|
||||
"ipad/latest",
|
||||
"android/latest"
|
||||
]
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/inspect-js/object-inspect.git"
|
||||
},
|
||||
"homepage": "https://github.com/inspect-js/object-inspect",
|
||||
"keywords": [
|
||||
"inspect",
|
||||
"util.inspect",
|
||||
"object",
|
||||
"stringify",
|
||||
"pretty"
|
||||
],
|
||||
"author": {
|
||||
"name": "James Halliday",
|
||||
"email": "mail@substack.net",
|
||||
"url": "http://substack.net"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
},
|
||||
"license": "MIT",
|
||||
"browser": {
|
||||
"./util.inspect.js": false
|
||||
},
|
||||
"auto-changelog": {
|
||||
"output": "CHANGELOG.md",
|
||||
"template": "keepachangelog",
|
||||
"unreleased": false,
|
||||
"commitLimit": false,
|
||||
"backfillLimit": false,
|
||||
"hideCredit": true
|
||||
},
|
||||
"publishConfig": {
|
||||
"ignore": [
|
||||
".github/workflows",
|
||||
"./test-core-js.js"
|
||||
]
|
||||
},
|
||||
"support": true
|
||||
}
|
86
node_modules/object-inspect/readme.markdown
generated
vendored
Normal file
86
node_modules/object-inspect/readme.markdown
generated
vendored
Normal file
@ -0,0 +1,86 @@
|
||||
# object-inspect <sup>[![Version Badge][2]][1]</sup>
|
||||
|
||||
string representations of objects in node and the browser
|
||||
|
||||
[![github actions][actions-image]][actions-url]
|
||||
[![coverage][codecov-image]][codecov-url]
|
||||
[![dependency status][5]][6]
|
||||
[![dev dependency status][7]][8]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][11]][1]
|
||||
|
||||
# example
|
||||
|
||||
## circular
|
||||
|
||||
``` js
|
||||
var inspect = require('object-inspect');
|
||||
var obj = { a: 1, b: [3,4] };
|
||||
obj.c = obj;
|
||||
console.log(inspect(obj));
|
||||
```
|
||||
|
||||
## dom element
|
||||
|
||||
``` js
|
||||
var inspect = require('object-inspect');
|
||||
|
||||
var d = document.createElement('div');
|
||||
d.setAttribute('id', 'beep');
|
||||
d.innerHTML = '<b>wooo</b><i>iiiii</i>';
|
||||
|
||||
console.log(inspect([ d, { a: 3, b : 4, c: [5,6,[7,[8,[9]]]] } ]));
|
||||
```
|
||||
|
||||
output:
|
||||
|
||||
```
|
||||
[ <div id="beep">...</div>, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [ ... ] ] ] ] } ]
|
||||
```
|
||||
|
||||
# methods
|
||||
|
||||
``` js
|
||||
var inspect = require('object-inspect')
|
||||
```
|
||||
|
||||
## var s = inspect(obj, opts={})
|
||||
|
||||
Return a string `s` with the string representation of `obj` up to a depth of `opts.depth`.
|
||||
|
||||
Additional options:
|
||||
- `quoteStyle`: must be "single" or "double", if present. Default `'single'` for strings, `'double'` for HTML elements.
|
||||
- `maxStringLength`: must be `0`, a positive integer, `Infinity`, or `null`, if present. Default `Infinity`.
|
||||
- `customInspect`: When `true`, a custom inspect method function will be invoked (either undere the `util.inspect.custom` symbol, or the `inspect` property). When the string `'symbol'`, only the symbol method will be invoked. Default `true`.
|
||||
- `indent`: must be "\t", `null`, or a positive integer. Default `null`.
|
||||
- `numericSeparator`: must be a boolean, if present. Default `false`. If `true`, all numbers will be printed with numeric separators (eg, `1234.5678` will be printed as `'1_234.567_8'`)
|
||||
|
||||
# install
|
||||
|
||||
With [npm](https://npmjs.org) do:
|
||||
|
||||
```
|
||||
npm install object-inspect
|
||||
```
|
||||
|
||||
# license
|
||||
|
||||
MIT
|
||||
|
||||
[1]: https://npmjs.org/package/object-inspect
|
||||
[2]: https://versionbadg.es/inspect-js/object-inspect.svg
|
||||
[5]: https://david-dm.org/inspect-js/object-inspect.svg
|
||||
[6]: https://david-dm.org/inspect-js/object-inspect
|
||||
[7]: https://david-dm.org/inspect-js/object-inspect/dev-status.svg
|
||||
[8]: https://david-dm.org/inspect-js/object-inspect#info=devDependencies
|
||||
[11]: https://nodei.co/npm/object-inspect.png?downloads=true&stars=true
|
||||
[license-image]: https://img.shields.io/npm/l/object-inspect.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/object-inspect.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=object-inspect
|
||||
[codecov-image]: https://codecov.io/gh/inspect-js/object-inspect/branch/main/graphs/badge.svg
|
||||
[codecov-url]: https://app.codecov.io/gh/inspect-js/object-inspect/
|
||||
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/object-inspect
|
||||
[actions-url]: https://github.com/inspect-js/object-inspect/actions
|
26
node_modules/object-inspect/test-core-js.js
generated
vendored
Normal file
26
node_modules/object-inspect/test-core-js.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
'use strict';
|
||||
|
||||
require('core-js');
|
||||
|
||||
var inspect = require('./');
|
||||
var test = require('tape');
|
||||
|
||||
test('Maps', function (t) {
|
||||
t.equal(inspect(new Map([[1, 2]])), 'Map (1) {1 => 2}');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('WeakMaps', function (t) {
|
||||
t.equal(inspect(new WeakMap([[{}, 2]])), 'WeakMap { ? }');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('Sets', function (t) {
|
||||
t.equal(inspect(new Set([[1, 2]])), 'Set (1) {[ 1, 2 ]}');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('WeakSets', function (t) {
|
||||
t.equal(inspect(new WeakSet([[1, 2]])), 'WeakSet { ? }');
|
||||
t.end();
|
||||
});
|
58
node_modules/object-inspect/test/bigint.js
generated
vendored
Normal file
58
node_modules/object-inspect/test/bigint.js
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
'use strict';
|
||||
|
||||
var inspect = require('../');
|
||||
var test = require('tape');
|
||||
var hasToStringTag = require('has-tostringtag/shams')();
|
||||
|
||||
test('bigint', { skip: typeof BigInt === 'undefined' }, function (t) {
|
||||
t.test('primitives', function (st) {
|
||||
st.plan(3);
|
||||
|
||||
st.equal(inspect(BigInt(-256)), '-256n');
|
||||
st.equal(inspect(BigInt(0)), '0n');
|
||||
st.equal(inspect(BigInt(256)), '256n');
|
||||
});
|
||||
|
||||
t.test('objects', function (st) {
|
||||
st.plan(3);
|
||||
|
||||
st.equal(inspect(Object(BigInt(-256))), 'Object(-256n)');
|
||||
st.equal(inspect(Object(BigInt(0))), 'Object(0n)');
|
||||
st.equal(inspect(Object(BigInt(256))), 'Object(256n)');
|
||||
});
|
||||
|
||||
t.test('syntactic primitives', function (st) {
|
||||
st.plan(3);
|
||||
|
||||
/* eslint-disable no-new-func */
|
||||
st.equal(inspect(Function('return -256n')()), '-256n');
|
||||
st.equal(inspect(Function('return 0n')()), '0n');
|
||||
st.equal(inspect(Function('return 256n')()), '256n');
|
||||
});
|
||||
|
||||
t.test('toStringTag', { skip: !hasToStringTag }, function (st) {
|
||||
st.plan(1);
|
||||
|
||||
var faker = {};
|
||||
faker[Symbol.toStringTag] = 'BigInt';
|
||||
st.equal(
|
||||
inspect(faker),
|
||||
'{ [Symbol(Symbol.toStringTag)]: \'BigInt\' }',
|
||||
'object lying about being a BigInt inspects as an object'
|
||||
);
|
||||
});
|
||||
|
||||
t.test('numericSeparator', function (st) {
|
||||
st.equal(inspect(BigInt(0), { numericSeparator: false }), '0n', '0n, numericSeparator false');
|
||||
st.equal(inspect(BigInt(0), { numericSeparator: true }), '0n', '0n, numericSeparator true');
|
||||
|
||||
st.equal(inspect(BigInt(1234), { numericSeparator: false }), '1234n', '1234n, numericSeparator false');
|
||||
st.equal(inspect(BigInt(1234), { numericSeparator: true }), '1_234n', '1234n, numericSeparator true');
|
||||
st.equal(inspect(BigInt(-1234), { numericSeparator: false }), '-1234n', '1234n, numericSeparator false');
|
||||
st.equal(inspect(BigInt(-1234), { numericSeparator: true }), '-1_234n', '1234n, numericSeparator true');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
15
node_modules/object-inspect/test/browser/dom.js
generated
vendored
Normal file
15
node_modules/object-inspect/test/browser/dom.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
var inspect = require('../../');
|
||||
var test = require('tape');
|
||||
|
||||
test('dom element', function (t) {
|
||||
t.plan(1);
|
||||
|
||||
var d = document.createElement('div');
|
||||
d.setAttribute('id', 'beep');
|
||||
d.innerHTML = '<b>wooo</b><i>iiiii</i>';
|
||||
|
||||
t.equal(
|
||||
inspect([d, { a: 3, b: 4, c: [5, 6, [7, [8, [9]]]] }]),
|
||||
'[ <div id="beep">...</div>, { a: 3, b: 4, c: [ 5, 6, [ 7, [ 8, [Object] ] ] ] } ]'
|
||||
);
|
||||
});
|
16
node_modules/object-inspect/test/circular.js
generated
vendored
Normal file
16
node_modules/object-inspect/test/circular.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
var inspect = require('../');
|
||||
var test = require('tape');
|
||||
|
||||
test('circular', function (t) {
|
||||
t.plan(2);
|
||||
var obj = { a: 1, b: [3, 4] };
|
||||
obj.c = obj;
|
||||
t.equal(inspect(obj), '{ a: 1, b: [ 3, 4 ], c: [Circular] }');
|
||||
|
||||
var double = {};
|
||||
double.a = [double];
|
||||
double.b = {};
|
||||
double.b.inner = double.b;
|
||||
double.b.obj = double;
|
||||
t.equal(inspect(double), '{ a: [ [Circular] ], b: { inner: [Circular], obj: [Circular] } }');
|
||||
});
|
12
node_modules/object-inspect/test/deep.js
generated
vendored
Normal file
12
node_modules/object-inspect/test/deep.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
var inspect = require('../');
|
||||
var test = require('tape');
|
||||
|
||||
test('deep', function (t) {
|
||||
t.plan(4);
|
||||
var obj = [[[[[[500]]]]]];
|
||||
t.equal(inspect(obj), '[ [ [ [ [ [Array] ] ] ] ] ]');
|
||||
t.equal(inspect(obj, { depth: 4 }), '[ [ [ [ [Array] ] ] ] ]');
|
||||
t.equal(inspect(obj, { depth: 2 }), '[ [ [Array] ] ]');
|
||||
|
||||
t.equal(inspect([[[{ a: 1 }]]], { depth: 3 }), '[ [ [ [Object] ] ] ]');
|
||||
});
|
53
node_modules/object-inspect/test/element.js
generated
vendored
Normal file
53
node_modules/object-inspect/test/element.js
generated
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
var inspect = require('../');
|
||||
var test = require('tape');
|
||||
|
||||
test('element', function (t) {
|
||||
t.plan(3);
|
||||
var elem = {
|
||||
nodeName: 'div',
|
||||
attributes: [{ name: 'class', value: 'row' }],
|
||||
getAttribute: function (key) { return key; },
|
||||
childNodes: []
|
||||
};
|
||||
var obj = [1, elem, 3];
|
||||
t.deepEqual(inspect(obj), '[ 1, <div class="row"></div>, 3 ]');
|
||||
t.deepEqual(inspect(obj, { quoteStyle: 'single' }), "[ 1, <div class='row'></div>, 3 ]");
|
||||
t.deepEqual(inspect(obj, { quoteStyle: 'double' }), '[ 1, <div class="row"></div>, 3 ]');
|
||||
});
|
||||
|
||||
test('element no attr', function (t) {
|
||||
t.plan(1);
|
||||
var elem = {
|
||||
nodeName: 'div',
|
||||
getAttribute: function (key) { return key; },
|
||||
childNodes: []
|
||||
};
|
||||
var obj = [1, elem, 3];
|
||||
t.deepEqual(inspect(obj), '[ 1, <div></div>, 3 ]');
|
||||
});
|
||||
|
||||
test('element with contents', function (t) {
|
||||
t.plan(1);
|
||||
var elem = {
|
||||
nodeName: 'div',
|
||||
getAttribute: function (key) { return key; },
|
||||
childNodes: [{ nodeName: 'b' }]
|
||||
};
|
||||
var obj = [1, elem, 3];
|
||||
t.deepEqual(inspect(obj), '[ 1, <div>...</div>, 3 ]');
|
||||
});
|
||||
|
||||
test('element instance', function (t) {
|
||||
t.plan(1);
|
||||
var h = global.HTMLElement;
|
||||
global.HTMLElement = function (name, attr) {
|
||||
this.nodeName = name;
|
||||
this.attributes = attr;
|
||||
};
|
||||
global.HTMLElement.prototype.getAttribute = function () {};
|
||||
|
||||
var elem = new global.HTMLElement('div', []);
|
||||
var obj = [1, elem, 3];
|
||||
t.deepEqual(inspect(obj), '[ 1, <div></div>, 3 ]');
|
||||
global.HTMLElement = h;
|
||||
});
|
48
node_modules/object-inspect/test/err.js
generated
vendored
Normal file
48
node_modules/object-inspect/test/err.js
generated
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
var test = require('tape');
|
||||
var ErrorWithCause = require('error-cause/Error');
|
||||
|
||||
var inspect = require('../');
|
||||
|
||||
test('type error', function (t) {
|
||||
t.plan(1);
|
||||
var aerr = new TypeError();
|
||||
aerr.foo = 555;
|
||||
aerr.bar = [1, 2, 3];
|
||||
|
||||
var berr = new TypeError('tuv');
|
||||
berr.baz = 555;
|
||||
|
||||
var cerr = new SyntaxError();
|
||||
cerr.message = 'whoa';
|
||||
cerr['a-b'] = 5;
|
||||
|
||||
var withCause = new ErrorWithCause('foo', { cause: 'bar' });
|
||||
var withCausePlus = new ErrorWithCause('foo', { cause: 'bar' });
|
||||
withCausePlus.foo = 'bar';
|
||||
var withUndefinedCause = new ErrorWithCause('foo', { cause: undefined });
|
||||
var withEnumerableCause = new Error('foo');
|
||||
withEnumerableCause.cause = 'bar';
|
||||
|
||||
var obj = [
|
||||
new TypeError(),
|
||||
new TypeError('xxx'),
|
||||
aerr,
|
||||
berr,
|
||||
cerr,
|
||||
withCause,
|
||||
withCausePlus,
|
||||
withUndefinedCause,
|
||||
withEnumerableCause
|
||||
];
|
||||
t.equal(inspect(obj), '[ ' + [
|
||||
'[TypeError]',
|
||||
'[TypeError: xxx]',
|
||||
'{ [TypeError] foo: 555, bar: [ 1, 2, 3 ] }',
|
||||
'{ [TypeError: tuv] baz: 555 }',
|
||||
'{ [SyntaxError: whoa] message: \'whoa\', \'a-b\': 5 }',
|
||||
'cause' in Error.prototype ? '[Error: foo]' : '{ [Error: foo] [cause]: \'bar\' }',
|
||||
'{ [Error: foo] ' + ('cause' in Error.prototype ? '' : '[cause]: \'bar\', ') + 'foo: \'bar\' }',
|
||||
'cause' in Error.prototype ? '[Error: foo]' : '{ [Error: foo] [cause]: undefined }',
|
||||
'{ [Error: foo] cause: \'bar\' }'
|
||||
].join(', ') + ' ]');
|
||||
});
|
29
node_modules/object-inspect/test/fakes.js
generated
vendored
Normal file
29
node_modules/object-inspect/test/fakes.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
var inspect = require('../');
|
||||
var test = require('tape');
|
||||
var hasToStringTag = require('has-tostringtag/shams')();
|
||||
var forEach = require('for-each');
|
||||
|
||||
test('fakes', { skip: !hasToStringTag }, function (t) {
|
||||
forEach([
|
||||
'Array',
|
||||
'Boolean',
|
||||
'Date',
|
||||
'Error',
|
||||
'Number',
|
||||
'RegExp',
|
||||
'String'
|
||||
], function (expected) {
|
||||
var faker = {};
|
||||
faker[Symbol.toStringTag] = expected;
|
||||
|
||||
t.equal(
|
||||
inspect(faker),
|
||||
'{ [Symbol(Symbol.toStringTag)]: \'' + expected + '\' }',
|
||||
'faker masquerading as ' + expected + ' is not shown as one'
|
||||
);
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
76
node_modules/object-inspect/test/fn.js
generated
vendored
Normal file
76
node_modules/object-inspect/test/fn.js
generated
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
var inspect = require('../');
|
||||
var test = require('tape');
|
||||
var arrow = require('make-arrow-function')();
|
||||
var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames();
|
||||
|
||||
test('function', function (t) {
|
||||
t.plan(1);
|
||||
var obj = [1, 2, function f(n) { return n; }, 4];
|
||||
t.equal(inspect(obj), '[ 1, 2, [Function: f], 4 ]');
|
||||
});
|
||||
|
||||
test('function name', function (t) {
|
||||
t.plan(1);
|
||||
var f = (function () {
|
||||
return function () {};
|
||||
}());
|
||||
f.toString = function toStr() { return 'function xxx () {}'; };
|
||||
var obj = [1, 2, f, 4];
|
||||
t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)] { toString: [Function: toStr] }, 4 ]');
|
||||
});
|
||||
|
||||
test('anon function', function (t) {
|
||||
var f = (function () {
|
||||
return function () {};
|
||||
}());
|
||||
var obj = [1, 2, f, 4];
|
||||
t.equal(inspect(obj), '[ 1, 2, [Function (anonymous)], 4 ]');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('arrow function', { skip: !arrow }, function (t) {
|
||||
t.equal(inspect(arrow), '[Function (anonymous)]');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('truly nameless function', { skip: !arrow || !functionsHaveConfigurableNames }, function (t) {
|
||||
function f() {}
|
||||
Object.defineProperty(f, 'name', { value: false });
|
||||
t.equal(f.name, false);
|
||||
t.equal(
|
||||
inspect(f),
|
||||
'[Function: f]',
|
||||
'named function with falsy `.name` does not hide its original name'
|
||||
);
|
||||
|
||||
function g() {}
|
||||
Object.defineProperty(g, 'name', { value: true });
|
||||
t.equal(g.name, true);
|
||||
t.equal(
|
||||
inspect(g),
|
||||
'[Function: true]',
|
||||
'named function with truthy `.name` hides its original name'
|
||||
);
|
||||
|
||||
var anon = function () {}; // eslint-disable-line func-style
|
||||
Object.defineProperty(anon, 'name', { value: null });
|
||||
t.equal(anon.name, null);
|
||||
t.equal(
|
||||
inspect(anon),
|
||||
'[Function (anonymous)]',
|
||||
'anon function with falsy `.name` does not hide its anonymity'
|
||||
);
|
||||
|
||||
var anon2 = function () {}; // eslint-disable-line func-style
|
||||
Object.defineProperty(anon2, 'name', { value: 1 });
|
||||
t.equal(anon2.name, 1);
|
||||
t.equal(
|
||||
inspect(anon2),
|
||||
'[Function: 1]',
|
||||
'anon function with truthy `.name` hides its anonymity'
|
||||
);
|
||||
|
||||
t.end();
|
||||
});
|
15
node_modules/object-inspect/test/has.js
generated
vendored
Normal file
15
node_modules/object-inspect/test/has.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
var inspect = require('../');
|
||||
var test = require('tape');
|
||||
var mockProperty = require('mock-property');
|
||||
|
||||
test('when Object#hasOwnProperty is deleted', function (t) {
|
||||
t.plan(1);
|
||||
var arr = [1, , 3]; // eslint-disable-line no-sparse-arrays
|
||||
|
||||
t.teardown(mockProperty(Array.prototype, 1, { value: 2 })); // this is needed to account for "in" vs "hasOwnProperty"
|
||||
t.teardown(mockProperty(Object.prototype, 'hasOwnProperty', { 'delete': true }));
|
||||
|
||||
t.equal(inspect(arr), '[ 1, , 3 ]');
|
||||
});
|
15
node_modules/object-inspect/test/holes.js
generated
vendored
Normal file
15
node_modules/object-inspect/test/holes.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
var test = require('tape');
|
||||
var inspect = require('../');
|
||||
|
||||
var xs = ['a', 'b'];
|
||||
xs[5] = 'f';
|
||||
xs[7] = 'j';
|
||||
xs[8] = 'k';
|
||||
|
||||
test('holes', function (t) {
|
||||
t.plan(1);
|
||||
t.equal(
|
||||
inspect(xs),
|
||||
"[ 'a', 'b', , , , 'f', , 'j', 'k' ]"
|
||||
);
|
||||
});
|
271
node_modules/object-inspect/test/indent-option.js
generated
vendored
Normal file
271
node_modules/object-inspect/test/indent-option.js
generated
vendored
Normal file
@ -0,0 +1,271 @@
|
||||
var test = require('tape');
|
||||
var forEach = require('for-each');
|
||||
|
||||
var inspect = require('../');
|
||||
|
||||
test('bad indent options', function (t) {
|
||||
forEach([
|
||||
undefined,
|
||||
true,
|
||||
false,
|
||||
-1,
|
||||
1.2,
|
||||
Infinity,
|
||||
-Infinity,
|
||||
NaN
|
||||
], function (indent) {
|
||||
t['throws'](
|
||||
function () { inspect('', { indent: indent }); },
|
||||
TypeError,
|
||||
inspect(indent) + ' is invalid'
|
||||
);
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('simple object with indent', function (t) {
|
||||
t.plan(2);
|
||||
|
||||
var obj = { a: 1, b: 2 };
|
||||
|
||||
var expectedSpaces = [
|
||||
'{',
|
||||
' a: 1,',
|
||||
' b: 2',
|
||||
'}'
|
||||
].join('\n');
|
||||
var expectedTabs = [
|
||||
'{',
|
||||
' a: 1,',
|
||||
' b: 2',
|
||||
'}'
|
||||
].join('\n');
|
||||
|
||||
t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two');
|
||||
t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs');
|
||||
});
|
||||
|
||||
test('two deep object with indent', function (t) {
|
||||
t.plan(2);
|
||||
|
||||
var obj = { a: 1, b: { c: 3, d: 4 } };
|
||||
|
||||
var expectedSpaces = [
|
||||
'{',
|
||||
' a: 1,',
|
||||
' b: {',
|
||||
' c: 3,',
|
||||
' d: 4',
|
||||
' }',
|
||||
'}'
|
||||
].join('\n');
|
||||
var expectedTabs = [
|
||||
'{',
|
||||
' a: 1,',
|
||||
' b: {',
|
||||
' c: 3,',
|
||||
' d: 4',
|
||||
' }',
|
||||
'}'
|
||||
].join('\n');
|
||||
|
||||
t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two');
|
||||
t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs');
|
||||
});
|
||||
|
||||
test('simple array with all single line elements', function (t) {
|
||||
t.plan(2);
|
||||
|
||||
var obj = [1, 2, 3, 'asdf\nsdf'];
|
||||
|
||||
var expected = '[ 1, 2, 3, \'asdf\\nsdf\' ]';
|
||||
|
||||
t.equal(inspect(obj, { indent: 2 }), expected, 'two');
|
||||
t.equal(inspect(obj, { indent: '\t' }), expected, 'tabs');
|
||||
});
|
||||
|
||||
test('array with complex elements', function (t) {
|
||||
t.plan(2);
|
||||
|
||||
var obj = [1, { a: 1, b: { c: 1 } }, 'asdf\nsdf'];
|
||||
|
||||
var expectedSpaces = [
|
||||
'[',
|
||||
' 1,',
|
||||
' {',
|
||||
' a: 1,',
|
||||
' b: {',
|
||||
' c: 1',
|
||||
' }',
|
||||
' },',
|
||||
' \'asdf\\nsdf\'',
|
||||
']'
|
||||
].join('\n');
|
||||
var expectedTabs = [
|
||||
'[',
|
||||
' 1,',
|
||||
' {',
|
||||
' a: 1,',
|
||||
' b: {',
|
||||
' c: 1',
|
||||
' }',
|
||||
' },',
|
||||
' \'asdf\\nsdf\'',
|
||||
']'
|
||||
].join('\n');
|
||||
|
||||
t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two');
|
||||
t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs');
|
||||
});
|
||||
|
||||
test('values', function (t) {
|
||||
t.plan(2);
|
||||
var obj = [{}, [], { 'a-b': 5 }];
|
||||
|
||||
var expectedSpaces = [
|
||||
'[',
|
||||
' {},',
|
||||
' [],',
|
||||
' {',
|
||||
' \'a-b\': 5',
|
||||
' }',
|
||||
']'
|
||||
].join('\n');
|
||||
var expectedTabs = [
|
||||
'[',
|
||||
' {},',
|
||||
' [],',
|
||||
' {',
|
||||
' \'a-b\': 5',
|
||||
' }',
|
||||
']'
|
||||
].join('\n');
|
||||
|
||||
t.equal(inspect(obj, { indent: 2 }), expectedSpaces, 'two');
|
||||
t.equal(inspect(obj, { indent: '\t' }), expectedTabs, 'tabs');
|
||||
});
|
||||
|
||||
test('Map', { skip: typeof Map !== 'function' }, function (t) {
|
||||
var map = new Map();
|
||||
map.set({ a: 1 }, ['b']);
|
||||
map.set(3, NaN);
|
||||
|
||||
var expectedStringSpaces = [
|
||||
'Map (2) {',
|
||||
' { a: 1 } => [ \'b\' ],',
|
||||
' 3 => NaN',
|
||||
'}'
|
||||
].join('\n');
|
||||
var expectedStringTabs = [
|
||||
'Map (2) {',
|
||||
' { a: 1 } => [ \'b\' ],',
|
||||
' 3 => NaN',
|
||||
'}'
|
||||
].join('\n');
|
||||
var expectedStringTabsDoubleQuotes = [
|
||||
'Map (2) {',
|
||||
' { a: 1 } => [ "b" ],',
|
||||
' 3 => NaN',
|
||||
'}'
|
||||
].join('\n');
|
||||
|
||||
t.equal(
|
||||
inspect(map, { indent: 2 }),
|
||||
expectedStringSpaces,
|
||||
'Map keys are not indented (two)'
|
||||
);
|
||||
t.equal(
|
||||
inspect(map, { indent: '\t' }),
|
||||
expectedStringTabs,
|
||||
'Map keys are not indented (tabs)'
|
||||
);
|
||||
t.equal(
|
||||
inspect(map, { indent: '\t', quoteStyle: 'double' }),
|
||||
expectedStringTabsDoubleQuotes,
|
||||
'Map keys are not indented (tabs + double quotes)'
|
||||
);
|
||||
|
||||
t.equal(inspect(new Map(), { indent: 2 }), 'Map (0) {}', 'empty Map should show as empty (two)');
|
||||
t.equal(inspect(new Map(), { indent: '\t' }), 'Map (0) {}', 'empty Map should show as empty (tabs)');
|
||||
|
||||
var nestedMap = new Map();
|
||||
nestedMap.set(nestedMap, map);
|
||||
var expectedNestedSpaces = [
|
||||
'Map (1) {',
|
||||
' [Circular] => Map (2) {',
|
||||
' { a: 1 } => [ \'b\' ],',
|
||||
' 3 => NaN',
|
||||
' }',
|
||||
'}'
|
||||
].join('\n');
|
||||
var expectedNestedTabs = [
|
||||
'Map (1) {',
|
||||
' [Circular] => Map (2) {',
|
||||
' { a: 1 } => [ \'b\' ],',
|
||||
' 3 => NaN',
|
||||
' }',
|
||||
'}'
|
||||
].join('\n');
|
||||
t.equal(inspect(nestedMap, { indent: 2 }), expectedNestedSpaces, 'Map containing a Map should work (two)');
|
||||
t.equal(inspect(nestedMap, { indent: '\t' }), expectedNestedTabs, 'Map containing a Map should work (tabs)');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('Set', { skip: typeof Set !== 'function' }, function (t) {
|
||||
var set = new Set();
|
||||
set.add({ a: 1 });
|
||||
set.add(['b']);
|
||||
var expectedStringSpaces = [
|
||||
'Set (2) {',
|
||||
' {',
|
||||
' a: 1',
|
||||
' },',
|
||||
' [ \'b\' ]',
|
||||
'}'
|
||||
].join('\n');
|
||||
var expectedStringTabs = [
|
||||
'Set (2) {',
|
||||
' {',
|
||||
' a: 1',
|
||||
' },',
|
||||
' [ \'b\' ]',
|
||||
'}'
|
||||
].join('\n');
|
||||
t.equal(inspect(set, { indent: 2 }), expectedStringSpaces, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (two)');
|
||||
t.equal(inspect(set, { indent: '\t' }), expectedStringTabs, 'new Set([{ a: 1 }, ["b"]]) should show size and contents (tabs)');
|
||||
|
||||
t.equal(inspect(new Set(), { indent: 2 }), 'Set (0) {}', 'empty Set should show as empty (two)');
|
||||
t.equal(inspect(new Set(), { indent: '\t' }), 'Set (0) {}', 'empty Set should show as empty (tabs)');
|
||||
|
||||
var nestedSet = new Set();
|
||||
nestedSet.add(set);
|
||||
nestedSet.add(nestedSet);
|
||||
var expectedNestedSpaces = [
|
||||
'Set (2) {',
|
||||
' Set (2) {',
|
||||
' {',
|
||||
' a: 1',
|
||||
' },',
|
||||
' [ \'b\' ]',
|
||||
' },',
|
||||
' [Circular]',
|
||||
'}'
|
||||
].join('\n');
|
||||
var expectedNestedTabs = [
|
||||
'Set (2) {',
|
||||
' Set (2) {',
|
||||
' {',
|
||||
' a: 1',
|
||||
' },',
|
||||
' [ \'b\' ]',
|
||||
' },',
|
||||
' [Circular]',
|
||||
'}'
|
||||
].join('\n');
|
||||
t.equal(inspect(nestedSet, { indent: 2 }), expectedNestedSpaces, 'Set containing a Set should work (two)');
|
||||
t.equal(inspect(nestedSet, { indent: '\t' }), expectedNestedTabs, 'Set containing a Set should work (tabs)');
|
||||
|
||||
t.end();
|
||||
});
|
139
node_modules/object-inspect/test/inspect.js
generated
vendored
Normal file
139
node_modules/object-inspect/test/inspect.js
generated
vendored
Normal file
@ -0,0 +1,139 @@
|
||||
var test = require('tape');
|
||||
var hasSymbols = require('has-symbols/shams')();
|
||||
var utilInspect = require('../util.inspect');
|
||||
var repeat = require('string.prototype.repeat');
|
||||
|
||||
var inspect = require('..');
|
||||
|
||||
test('inspect', function (t) {
|
||||
t.plan(5);
|
||||
|
||||
var obj = [{ inspect: function xyzInspect() { return '!XYZ¡'; } }, []];
|
||||
var stringResult = '[ !XYZ¡, [] ]';
|
||||
var falseResult = '[ { inspect: [Function: xyzInspect] }, [] ]';
|
||||
|
||||
t.equal(inspect(obj), stringResult);
|
||||
t.equal(inspect(obj, { customInspect: true }), stringResult);
|
||||
t.equal(inspect(obj, { customInspect: 'symbol' }), falseResult);
|
||||
t.equal(inspect(obj, { customInspect: false }), falseResult);
|
||||
t['throws'](
|
||||
function () { inspect(obj, { customInspect: 'not a boolean or "symbol"' }); },
|
||||
TypeError,
|
||||
'`customInspect` must be a boolean or the string "symbol"'
|
||||
);
|
||||
});
|
||||
|
||||
test('inspect custom symbol', { skip: !hasSymbols || !utilInspect || !utilInspect.custom }, function (t) {
|
||||
t.plan(4);
|
||||
|
||||
var obj = { inspect: function stringInspect() { return 'string'; } };
|
||||
obj[utilInspect.custom] = function custom() { return 'symbol'; };
|
||||
|
||||
var symbolResult = '[ symbol, [] ]';
|
||||
var stringResult = '[ string, [] ]';
|
||||
var falseResult = '[ { inspect: [Function: stringInspect]' + (utilInspect.custom ? ', [' + inspect(utilInspect.custom) + ']: [Function: custom]' : '') + ' }, [] ]';
|
||||
|
||||
var symbolStringFallback = utilInspect.custom ? symbolResult : stringResult;
|
||||
var symbolFalseFallback = utilInspect.custom ? symbolResult : falseResult;
|
||||
|
||||
t.equal(inspect([obj, []]), symbolStringFallback);
|
||||
t.equal(inspect([obj, []], { customInspect: true }), symbolStringFallback);
|
||||
t.equal(inspect([obj, []], { customInspect: 'symbol' }), symbolFalseFallback);
|
||||
t.equal(inspect([obj, []], { customInspect: false }), falseResult);
|
||||
});
|
||||
|
||||
test('symbols', { skip: !hasSymbols }, function (t) {
|
||||
t.plan(2);
|
||||
|
||||
var obj = { a: 1 };
|
||||
obj[Symbol('test')] = 2;
|
||||
obj[Symbol.iterator] = 3;
|
||||
Object.defineProperty(obj, Symbol('non-enum'), {
|
||||
enumerable: false,
|
||||
value: 4
|
||||
});
|
||||
|
||||
if (typeof Symbol.iterator === 'symbol') {
|
||||
t.equal(inspect(obj), '{ a: 1, [Symbol(test)]: 2, [Symbol(Symbol.iterator)]: 3 }', 'object with symbols');
|
||||
t.equal(inspect([obj, []]), '[ { a: 1, [Symbol(test)]: 2, [Symbol(Symbol.iterator)]: 3 }, [] ]', 'object with symbols in array');
|
||||
} else {
|
||||
// symbol sham key ordering is unreliable
|
||||
t.match(
|
||||
inspect(obj),
|
||||
/^(?:{ a: 1, \[Symbol\(test\)\]: 2, \[Symbol\(Symbol.iterator\)\]: 3 }|{ a: 1, \[Symbol\(Symbol.iterator\)\]: 3, \[Symbol\(test\)\]: 2 })$/,
|
||||
'object with symbols (nondeterministic symbol sham key ordering)'
|
||||
);
|
||||
t.match(
|
||||
inspect([obj, []]),
|
||||
/^\[ (?:{ a: 1, \[Symbol\(test\)\]: 2, \[Symbol\(Symbol.iterator\)\]: 3 }|{ a: 1, \[Symbol\(Symbol.iterator\)\]: 3, \[Symbol\(test\)\]: 2 }), \[\] \]$/,
|
||||
'object with symbols in array (nondeterministic symbol sham key ordering)'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('maxStringLength', function (t) {
|
||||
t['throws'](
|
||||
function () { inspect('', { maxStringLength: -1 }); },
|
||||
TypeError,
|
||||
'maxStringLength must be >= 0, or Infinity, not negative'
|
||||
);
|
||||
|
||||
var str = repeat('a', 1e8);
|
||||
|
||||
t.equal(
|
||||
inspect([str], { maxStringLength: 10 }),
|
||||
'[ \'aaaaaaaaaa\'... 99999990 more characters ]',
|
||||
'maxStringLength option limits output'
|
||||
);
|
||||
|
||||
t.equal(
|
||||
inspect(['f'], { maxStringLength: null }),
|
||||
'[ \'\'... 1 more character ]',
|
||||
'maxStringLength option accepts `null`'
|
||||
);
|
||||
|
||||
t.equal(
|
||||
inspect([str], { maxStringLength: Infinity }),
|
||||
'[ \'' + str + '\' ]',
|
||||
'maxStringLength option accepts ∞'
|
||||
);
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('inspect options', { skip: !utilInspect.custom }, function (t) {
|
||||
var obj = {};
|
||||
obj[utilInspect.custom] = function () {
|
||||
return JSON.stringify(arguments);
|
||||
};
|
||||
t.equal(
|
||||
inspect(obj),
|
||||
utilInspect(obj, { depth: 5 }),
|
||||
'custom symbols will use node\'s inspect'
|
||||
);
|
||||
t.equal(
|
||||
inspect(obj, { depth: 2 }),
|
||||
utilInspect(obj, { depth: 2 }),
|
||||
'a reduced depth will be passed to node\'s inspect'
|
||||
);
|
||||
t.equal(
|
||||
inspect({ d1: obj }, { depth: 3 }),
|
||||
'{ d1: ' + utilInspect(obj, { depth: 2 }) + ' }',
|
||||
'deep objects will receive a reduced depth'
|
||||
);
|
||||
t.equal(
|
||||
inspect({ d1: obj }, { depth: 1 }),
|
||||
'{ d1: [Object] }',
|
||||
'unlike nodejs inspect, customInspect will not be used once the depth is exceeded.'
|
||||
);
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('inspect URL', { skip: typeof URL === 'undefined' }, function (t) {
|
||||
t.match(
|
||||
inspect(new URL('https://nodejs.org')),
|
||||
/nodejs\.org/, // Different environments stringify it differently
|
||||
'url can be inspected'
|
||||
);
|
||||
t.end();
|
||||
});
|
12
node_modules/object-inspect/test/lowbyte.js
generated
vendored
Normal file
12
node_modules/object-inspect/test/lowbyte.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
var test = require('tape');
|
||||
var inspect = require('../');
|
||||
|
||||
var obj = { x: 'a\r\nb', y: '\x05! \x1f \x12' };
|
||||
|
||||
test('interpolate low bytes', function (t) {
|
||||
t.plan(1);
|
||||
t.equal(
|
||||
inspect(obj),
|
||||
"{ x: 'a\\r\\nb', y: '\\x05! \\x1F \\x12' }"
|
||||
);
|
||||
});
|
58
node_modules/object-inspect/test/number.js
generated
vendored
Normal file
58
node_modules/object-inspect/test/number.js
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
var test = require('tape');
|
||||
var v = require('es-value-fixtures');
|
||||
var forEach = require('for-each');
|
||||
|
||||
var inspect = require('../');
|
||||
|
||||
test('negative zero', function (t) {
|
||||
t.equal(inspect(0), '0', 'inspect(0) === "0"');
|
||||
t.equal(inspect(Object(0)), 'Object(0)', 'inspect(Object(0)) === "Object(0)"');
|
||||
|
||||
t.equal(inspect(-0), '-0', 'inspect(-0) === "-0"');
|
||||
t.equal(inspect(Object(-0)), 'Object(-0)', 'inspect(Object(-0)) === "Object(-0)"');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('numericSeparator', function (t) {
|
||||
forEach(v.nonBooleans, function (nonBoolean) {
|
||||
t['throws'](
|
||||
function () { inspect(true, { numericSeparator: nonBoolean }); },
|
||||
TypeError,
|
||||
inspect(nonBoolean) + ' is not a boolean'
|
||||
);
|
||||
});
|
||||
|
||||
t.test('3 digit numbers', function (st) {
|
||||
var failed = false;
|
||||
for (var i = -999; i < 1000; i += 1) {
|
||||
var actual = inspect(i);
|
||||
var actualSepNo = inspect(i, { numericSeparator: false });
|
||||
var actualSepYes = inspect(i, { numericSeparator: true });
|
||||
var expected = String(i);
|
||||
if (actual !== expected || actualSepNo !== expected || actualSepYes !== expected) {
|
||||
failed = true;
|
||||
t.equal(actual, expected);
|
||||
t.equal(actualSepNo, expected);
|
||||
t.equal(actualSepYes, expected);
|
||||
}
|
||||
}
|
||||
|
||||
st.notOk(failed, 'all 3 digit numbers passed');
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.equal(inspect(1e3), '1000', '1000');
|
||||
t.equal(inspect(1e3, { numericSeparator: false }), '1000', '1000, numericSeparator false');
|
||||
t.equal(inspect(1e3, { numericSeparator: true }), '1_000', '1000, numericSeparator true');
|
||||
t.equal(inspect(-1e3), '-1000', '-1000');
|
||||
t.equal(inspect(-1e3, { numericSeparator: false }), '-1000', '-1000, numericSeparator false');
|
||||
t.equal(inspect(-1e3, { numericSeparator: true }), '-1_000', '-1000, numericSeparator true');
|
||||
|
||||
t.equal(inspect(1234.5678, { numericSeparator: true }), '1_234.567_8', 'fractional numbers get separators');
|
||||
t.equal(inspect(1234.56789, { numericSeparator: true }), '1_234.567_89', 'fractional numbers get separators');
|
||||
t.equal(inspect(1234.567891, { numericSeparator: true }), '1_234.567_891', 'fractional numbers get separators');
|
||||
|
||||
t.end();
|
||||
});
|
17
node_modules/object-inspect/test/quoteStyle.js
generated
vendored
Normal file
17
node_modules/object-inspect/test/quoteStyle.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
var inspect = require('../');
|
||||
var test = require('tape');
|
||||
|
||||
test('quoteStyle option', function (t) {
|
||||
t['throws'](function () { inspect(null, { quoteStyle: false }); }, 'false is not a valid value');
|
||||
t['throws'](function () { inspect(null, { quoteStyle: true }); }, 'true is not a valid value');
|
||||
t['throws'](function () { inspect(null, { quoteStyle: '' }); }, '"" is not a valid value');
|
||||
t['throws'](function () { inspect(null, { quoteStyle: {} }); }, '{} is not a valid value');
|
||||
t['throws'](function () { inspect(null, { quoteStyle: [] }); }, '[] is not a valid value');
|
||||
t['throws'](function () { inspect(null, { quoteStyle: 42 }); }, '42 is not a valid value');
|
||||
t['throws'](function () { inspect(null, { quoteStyle: NaN }); }, 'NaN is not a valid value');
|
||||
t['throws'](function () { inspect(null, { quoteStyle: function () {} }); }, 'a function is not a valid value');
|
||||
|
||||
t.end();
|
||||
});
|
40
node_modules/object-inspect/test/toStringTag.js
generated
vendored
Normal file
40
node_modules/object-inspect/test/toStringTag.js
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var hasToStringTag = require('has-tostringtag/shams')();
|
||||
|
||||
var inspect = require('../');
|
||||
|
||||
test('Symbol.toStringTag', { skip: !hasToStringTag }, function (t) {
|
||||
t.plan(4);
|
||||
|
||||
var obj = { a: 1 };
|
||||
t.equal(inspect(obj), '{ a: 1 }', 'object, no Symbol.toStringTag');
|
||||
|
||||
obj[Symbol.toStringTag] = 'foo';
|
||||
t.equal(inspect(obj), '{ a: 1, [Symbol(Symbol.toStringTag)]: \'foo\' }', 'object with Symbol.toStringTag');
|
||||
|
||||
t.test('null objects', { skip: 'toString' in { __proto__: null } }, function (st) {
|
||||
st.plan(2);
|
||||
|
||||
var dict = { __proto__: null, a: 1 };
|
||||
st.equal(inspect(dict), '[Object: null prototype] { a: 1 }', 'null object with Symbol.toStringTag');
|
||||
|
||||
dict[Symbol.toStringTag] = 'Dict';
|
||||
st.equal(inspect(dict), '[Dict: null prototype] { a: 1, [Symbol(Symbol.toStringTag)]: \'Dict\' }', 'null object with Symbol.toStringTag');
|
||||
});
|
||||
|
||||
t.test('instances', function (st) {
|
||||
st.plan(4);
|
||||
|
||||
function C() {
|
||||
this.a = 1;
|
||||
}
|
||||
st.equal(Object.prototype.toString.call(new C()), '[object Object]', 'instance, no toStringTag, Object.prototype.toString');
|
||||
st.equal(inspect(new C()), 'C { a: 1 }', 'instance, no toStringTag');
|
||||
|
||||
C.prototype[Symbol.toStringTag] = 'Class!';
|
||||
st.equal(Object.prototype.toString.call(new C()), '[object Class!]', 'instance, with toStringTag, Object.prototype.toString');
|
||||
st.equal(inspect(new C()), 'C [Class!] { a: 1 }', 'instance, with toStringTag');
|
||||
});
|
||||
});
|
12
node_modules/object-inspect/test/undef.js
generated
vendored
Normal file
12
node_modules/object-inspect/test/undef.js
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
var test = require('tape');
|
||||
var inspect = require('../');
|
||||
|
||||
var obj = { a: 1, b: [3, 4, undefined, null], c: undefined, d: null };
|
||||
|
||||
test('undef and null', function (t) {
|
||||
t.plan(1);
|
||||
t.equal(
|
||||
inspect(obj),
|
||||
'{ a: 1, b: [ 3, 4, undefined, null ], c: undefined, d: null }'
|
||||
);
|
||||
});
|
211
node_modules/object-inspect/test/values.js
generated
vendored
Normal file
211
node_modules/object-inspect/test/values.js
generated
vendored
Normal file
@ -0,0 +1,211 @@
|
||||
'use strict';
|
||||
|
||||
var inspect = require('../');
|
||||
var test = require('tape');
|
||||
var mockProperty = require('mock-property');
|
||||
var hasSymbols = require('has-symbols/shams')();
|
||||
var hasToStringTag = require('has-tostringtag/shams')();
|
||||
|
||||
test('values', function (t) {
|
||||
t.plan(1);
|
||||
var obj = [{}, [], { 'a-b': 5 }];
|
||||
t.equal(inspect(obj), '[ {}, [], { \'a-b\': 5 } ]');
|
||||
});
|
||||
|
||||
test('arrays with properties', function (t) {
|
||||
t.plan(1);
|
||||
var arr = [3];
|
||||
arr.foo = 'bar';
|
||||
var obj = [1, 2, arr];
|
||||
obj.baz = 'quux';
|
||||
obj.index = -1;
|
||||
t.equal(inspect(obj), '[ 1, 2, [ 3, foo: \'bar\' ], baz: \'quux\', index: -1 ]');
|
||||
});
|
||||
|
||||
test('has', function (t) {
|
||||
t.plan(1);
|
||||
t.teardown(mockProperty(Object.prototype, 'hasOwnProperty', { 'delete': true }));
|
||||
|
||||
t.equal(inspect({ a: 1, b: 2 }), '{ a: 1, b: 2 }');
|
||||
});
|
||||
|
||||
test('indexOf seen', function (t) {
|
||||
t.plan(1);
|
||||
var xs = [1, 2, 3, {}];
|
||||
xs.push(xs);
|
||||
|
||||
var seen = [];
|
||||
seen.indexOf = undefined;
|
||||
|
||||
t.equal(
|
||||
inspect(xs, {}, 0, seen),
|
||||
'[ 1, 2, 3, {}, [Circular] ]'
|
||||
);
|
||||
});
|
||||
|
||||
test('seen seen', function (t) {
|
||||
t.plan(1);
|
||||
var xs = [1, 2, 3];
|
||||
|
||||
var seen = [xs];
|
||||
seen.indexOf = undefined;
|
||||
|
||||
t.equal(
|
||||
inspect(xs, {}, 0, seen),
|
||||
'[Circular]'
|
||||
);
|
||||
});
|
||||
|
||||
test('seen seen seen', function (t) {
|
||||
t.plan(1);
|
||||
var xs = [1, 2, 3];
|
||||
|
||||
var seen = [5, xs];
|
||||
seen.indexOf = undefined;
|
||||
|
||||
t.equal(
|
||||
inspect(xs, {}, 0, seen),
|
||||
'[Circular]'
|
||||
);
|
||||
});
|
||||
|
||||
test('symbols', { skip: !hasSymbols }, function (t) {
|
||||
var sym = Symbol('foo');
|
||||
t.equal(inspect(sym), 'Symbol(foo)', 'Symbol("foo") should be "Symbol(foo)"');
|
||||
if (typeof sym === 'symbol') {
|
||||
// Symbol shams are incapable of differentiating boxed from unboxed symbols
|
||||
t.equal(inspect(Object(sym)), 'Object(Symbol(foo))', 'Object(Symbol("foo")) should be "Object(Symbol(foo))"');
|
||||
}
|
||||
|
||||
t.test('toStringTag', { skip: !hasToStringTag }, function (st) {
|
||||
st.plan(1);
|
||||
|
||||
var faker = {};
|
||||
faker[Symbol.toStringTag] = 'Symbol';
|
||||
st.equal(
|
||||
inspect(faker),
|
||||
'{ [Symbol(Symbol.toStringTag)]: \'Symbol\' }',
|
||||
'object lying about being a Symbol inspects as an object'
|
||||
);
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('Map', { skip: typeof Map !== 'function' }, function (t) {
|
||||
var map = new Map();
|
||||
map.set({ a: 1 }, ['b']);
|
||||
map.set(3, NaN);
|
||||
var expectedString = 'Map (2) {' + inspect({ a: 1 }) + ' => ' + inspect(['b']) + ', 3 => NaN}';
|
||||
t.equal(inspect(map), expectedString, 'new Map([[{ a: 1 }, ["b"]], [3, NaN]]) should show size and contents');
|
||||
t.equal(inspect(new Map()), 'Map (0) {}', 'empty Map should show as empty');
|
||||
|
||||
var nestedMap = new Map();
|
||||
nestedMap.set(nestedMap, map);
|
||||
t.equal(inspect(nestedMap), 'Map (1) {[Circular] => ' + expectedString + '}', 'Map containing a Map should work');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('WeakMap', { skip: typeof WeakMap !== 'function' }, function (t) {
|
||||
var map = new WeakMap();
|
||||
map.set({ a: 1 }, ['b']);
|
||||
var expectedString = 'WeakMap { ? }';
|
||||
t.equal(inspect(map), expectedString, 'new WeakMap([[{ a: 1 }, ["b"]]]) should not show size or contents');
|
||||
t.equal(inspect(new WeakMap()), 'WeakMap { ? }', 'empty WeakMap should not show as empty');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('Set', { skip: typeof Set !== 'function' }, function (t) {
|
||||
var set = new Set();
|
||||
set.add({ a: 1 });
|
||||
set.add(['b']);
|
||||
var expectedString = 'Set (2) {' + inspect({ a: 1 }) + ', ' + inspect(['b']) + '}';
|
||||
t.equal(inspect(set), expectedString, 'new Set([{ a: 1 }, ["b"]]) should show size and contents');
|
||||
t.equal(inspect(new Set()), 'Set (0) {}', 'empty Set should show as empty');
|
||||
|
||||
var nestedSet = new Set();
|
||||
nestedSet.add(set);
|
||||
nestedSet.add(nestedSet);
|
||||
t.equal(inspect(nestedSet), 'Set (2) {' + expectedString + ', [Circular]}', 'Set containing a Set should work');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('WeakSet', { skip: typeof WeakSet !== 'function' }, function (t) {
|
||||
var map = new WeakSet();
|
||||
map.add({ a: 1 });
|
||||
var expectedString = 'WeakSet { ? }';
|
||||
t.equal(inspect(map), expectedString, 'new WeakSet([{ a: 1 }]) should not show size or contents');
|
||||
t.equal(inspect(new WeakSet()), 'WeakSet { ? }', 'empty WeakSet should not show as empty');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('WeakRef', { skip: typeof WeakRef !== 'function' }, function (t) {
|
||||
var ref = new WeakRef({ a: 1 });
|
||||
var expectedString = 'WeakRef { ? }';
|
||||
t.equal(inspect(ref), expectedString, 'new WeakRef({ a: 1 }) should not show contents');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('FinalizationRegistry', { skip: typeof FinalizationRegistry !== 'function' }, function (t) {
|
||||
var registry = new FinalizationRegistry(function () {});
|
||||
var expectedString = 'FinalizationRegistry [FinalizationRegistry] {}';
|
||||
t.equal(inspect(registry), expectedString, 'new FinalizationRegistry(function () {}) should work normallys');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('Strings', function (t) {
|
||||
var str = 'abc';
|
||||
|
||||
t.equal(inspect(str), "'" + str + "'", 'primitive string shows as such');
|
||||
t.equal(inspect(str, { quoteStyle: 'single' }), "'" + str + "'", 'primitive string shows as such, single quoted');
|
||||
t.equal(inspect(str, { quoteStyle: 'double' }), '"' + str + '"', 'primitive string shows as such, double quoted');
|
||||
t.equal(inspect(Object(str)), 'Object(' + inspect(str) + ')', 'String object shows as such');
|
||||
t.equal(inspect(Object(str), { quoteStyle: 'single' }), 'Object(' + inspect(str, { quoteStyle: 'single' }) + ')', 'String object shows as such, single quoted');
|
||||
t.equal(inspect(Object(str), { quoteStyle: 'double' }), 'Object(' + inspect(str, { quoteStyle: 'double' }) + ')', 'String object shows as such, double quoted');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('Numbers', function (t) {
|
||||
var num = 42;
|
||||
|
||||
t.equal(inspect(num), String(num), 'primitive number shows as such');
|
||||
t.equal(inspect(Object(num)), 'Object(' + inspect(num) + ')', 'Number object shows as such');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('Booleans', function (t) {
|
||||
t.equal(inspect(true), String(true), 'primitive true shows as such');
|
||||
t.equal(inspect(Object(true)), 'Object(' + inspect(true) + ')', 'Boolean object true shows as such');
|
||||
|
||||
t.equal(inspect(false), String(false), 'primitive false shows as such');
|
||||
t.equal(inspect(Object(false)), 'Object(' + inspect(false) + ')', 'Boolean false object shows as such');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('Date', function (t) {
|
||||
var now = new Date();
|
||||
t.equal(inspect(now), String(now), 'Date shows properly');
|
||||
t.equal(inspect(new Date(NaN)), 'Invalid Date', 'Invalid Date shows properly');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('RegExps', function (t) {
|
||||
t.equal(inspect(/a/g), '/a/g', 'regex shows properly');
|
||||
t.equal(inspect(new RegExp('abc', 'i')), '/abc/i', 'new RegExp shows properly');
|
||||
|
||||
var match = 'abc abc'.match(/[ab]+/);
|
||||
delete match.groups; // for node < 10
|
||||
t.equal(inspect(match), '[ \'ab\', index: 0, input: \'abc abc\' ]', 'RegExp match object shows properly');
|
||||
|
||||
t.end();
|
||||
});
|
1
node_modules/object-inspect/util.inspect.js
generated
vendored
Normal file
1
node_modules/object-inspect/util.inspect.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('util').inspect;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user