Upgrade minimist to 1.2.6
This CL updates minimist to 1.2.6 to fix a critical security
vulnerability: https://nvd.nist.gov/vuln/detail/CVE-2021-44906
The fix was made by running:
`npm run install-deps audit fix --audit-level=critical`
Bug: none
Change-Id: I51103b525d9969e03000d55af86cebdabc7e0366
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3591079
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Brandon Walderman <brwalder@microsoft.com>
diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json
index cd00758..e2571b2 100644
--- a/node_modules/.package-lock.json
+++ b/node_modules/.package-lock.json
@@ -537,6 +537,15 @@
"integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==",
"dev": true
},
+ "node_modules/@socket.io/base64-arraybuffer": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@socket.io/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
+ "integrity": "sha512-dOlCBKnDw4iShaIsH/bxujKTM18+2TOAsYz+KSc11Am38H4q5Xw8Bbz97ZYdrVNM+um3p7w86Bvvmcn9q+5+eQ==",
+ "dev": true,
+ "engines": {
+ "node": ">= 0.6.0"
+ }
+ },
"node_modules/@trysound/sax": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/@trysound/sax/-/sax-0.2.0.tgz",
@@ -804,6 +813,16 @@
"integrity": "sha512-sPMaZm2M7ZBaVnajY1WFszcl+6CR/daMt77dD8PpMH1wRKinRMDV40U55VmObJ58Oehu7K2JxmSonkm8BlbfxA==",
"dev": true
},
+ "node_modules/@types/yauzl": {
+ "version": "2.9.1",
+ "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.1.tgz",
+ "integrity": "sha512-A1b8SU4D10uoPjwb0lnHmmu8wZhR9d+9o2PKBQT2jU5YPTKsxac6M2qGAdY7VcL+dHHhARVUDmeg0rOrcd9EjA==",
+ "dev": true,
+ "optional": true,
+ "dependencies": {
+ "@types/node": "*"
+ }
+ },
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "5.20.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.20.0.tgz",
@@ -1294,15 +1313,6 @@
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"dev": true
},
- "node_modules/base64-arraybuffer": {
- "version": "1.0.1",
- "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.1.tgz",
- "integrity": "sha512-vFIUq7FdLtjZMhATwDul5RZWv2jpXQ09Pd6jcVEOvIsqCWTRFD/ONHNfyOS8dA/Ippi5dsIgpyKWKZaAKZltbA==",
- "dev": true,
- "engines": {
- "node": ">= 0.6.0"
- }
- },
"node_modules/base64-js": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
@@ -1984,9 +1994,9 @@
"dev": true
},
"node_modules/date-format": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/date-format/-/date-format-3.0.0.tgz",
- "integrity": "sha512-eyTcpKOcamdhWJXj56DpQMo1ylSQpcGtGKXcU0Tb97+K56/CF5amAqqqNj0+KvA0iw2ynxtHWFsPDSClCxe48w==",
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.7.tgz",
+ "integrity": "sha512-k5xqlzDGIfv2N/DHR/BR8Kc4N9CRy9ReuDkmdxeX/jNfit94QXd36emWMm40ZOEDKNm/c91yV9EO3uGPkR7wWQ==",
"dev": true,
"engines": {
"node": ">=4.0"
@@ -2209,9 +2219,9 @@
}
},
"node_modules/engine.io": {
- "version": "6.1.0",
- "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.1.0.tgz",
- "integrity": "sha512-ErhZOVu2xweCjEfYcTdkCnEYUiZgkAcBBAhW4jbIvNG8SLU3orAqoJCiytZjYF7eTpVmmCrLDjLIEaPlUAs1uw==",
+ "version": "6.1.3",
+ "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.1.3.tgz",
+ "integrity": "sha512-rqs60YwkvWTLLnfazqgZqLa/aKo+9cueVfEi/dZ8PyGyaf8TLOxj++4QMIgeG3Gn0AhrWiFXvghsoY9L9h25GA==",
"dev": true,
"dependencies": {
"@types/cookie": "^0.4.1",
@@ -2222,7 +2232,7 @@
"cookie": "~0.4.1",
"cors": "~2.8.5",
"debug": "~4.3.1",
- "engine.io-parser": "~5.0.0",
+ "engine.io-parser": "~5.0.3",
"ws": "~8.2.3"
},
"engines": {
@@ -2230,12 +2240,12 @@
}
},
"node_modules/engine.io-parser": {
- "version": "5.0.2",
- "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.2.tgz",
- "integrity": "sha512-wuiO7qO/OEkPJSFueuATIXtrxF7/6GTbAO9QLv7nnbjwZ5tYhLm9zxvLwxstRs0dcT0KUlWTjtIOs1T86jt12g==",
+ "version": "5.0.3",
+ "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.3.tgz",
+ "integrity": "sha512-BtQxwF27XUNnSafQLvDi0dQ8s3i6VgzSoQMJacpIcGNrlUdfHSKbgm3jmjCVvQluGzqwujQMPAoMai3oYSTurg==",
"dev": true,
"dependencies": {
- "base64-arraybuffer": "~1.0.1"
+ "@socket.io/base64-arraybuffer": "~1.0.2"
},
"engines": {
"node": ">=10.0.0"
@@ -2358,6 +2368,19 @@
"esbuild-windows-arm64": "0.14.13"
}
},
+ "node_modules/esbuild-linux-64": {
+ "version": "0.14.13",
+ "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.13.tgz",
+ "integrity": "sha512-P6OFAfcoUvE7g9h/0UKm3qagvTovwqpCF1wbFLWe/BcCY8BS1bR/+SxUjCeKX2BcpIsg4/43ezHDE/ntg/iOpw==",
+ "cpu": [
+ "x64"
+ ],
+ "dev": true,
+ "optional": true,
+ "os": [
+ "linux"
+ ]
+ },
"node_modules/escalade": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
@@ -3257,25 +3280,30 @@
"node": "^10.12.0 || >=12.0.0"
}
},
- "node_modules/flat-cache/node_modules/flatted": {
+ "node_modules/flatted": {
"version": "3.2.5",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz",
"integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==",
"dev": true
},
- "node_modules/flatted": {
- "version": "2.0.2",
- "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz",
- "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==",
- "dev": true
- },
"node_modules/follow-redirects": {
- "version": "1.13.2",
- "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.2.tgz",
- "integrity": "sha512-6mPTgLxYm3r6Bkkg0vNM0HTjfGrOEtsfbhagQvbxDEsEkpNhw582upBaoRZylzen6krEmxXJgt9Ju6HiI4O7BA==",
+ "version": "1.14.9",
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz",
+ "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==",
"dev": true,
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://github.com/sponsors/RubenVerborgh"
+ }
+ ],
"engines": {
"node": ">=4.0"
+ },
+ "peerDependenciesMeta": {
+ "debug": {
+ "optional": true
+ }
}
},
"node_modules/fs-constants": {
@@ -3285,17 +3313,17 @@
"dev": true
},
"node_modules/fs-extra": {
- "version": "8.1.0",
- "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
- "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
+ "version": "10.1.0",
+ "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz",
+ "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
"dev": true,
"dependencies": {
"graceful-fs": "^4.2.0",
- "jsonfile": "^4.0.0",
- "universalify": "^0.1.0"
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
},
"engines": {
- "node": ">=6 <7 || >=8"
+ "node": ">=12"
}
},
"node_modules/fs.realpath": {
@@ -4291,11 +4319,14 @@
}
},
"node_modules/jsonfile": {
- "version": "4.0.0",
- "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
- "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
+ "version": "6.1.0",
+ "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
+ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
"dev": true,
"dependencies": {
+ "universalify": "^2.0.0"
+ },
+ "optionalDependencies": {
"graceful-fs": "^4.1.6"
}
},
@@ -4665,21 +4696,38 @@
}
},
"node_modules/log4js": {
- "version": "6.3.0",
- "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.3.0.tgz",
- "integrity": "sha512-Mc8jNuSFImQUIateBFwdOQcmC6Q5maU0VVvdC2R6XMb66/VnT+7WS4D/0EeNMZu1YODmJe5NIn2XftCzEocUgw==",
+ "version": "6.4.5",
+ "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.5.tgz",
+ "integrity": "sha512-43RJcYZ7nfUxpPO2woTl8CJ0t5+gucLJZ43mtp2PlInT+LygCp/bl6hNJtKulCJ+++fQsjIv4EO3Mp611PfeLQ==",
"dev": true,
"dependencies": {
- "date-format": "^3.0.0",
- "debug": "^4.1.1",
- "flatted": "^2.0.1",
- "rfdc": "^1.1.4",
- "streamroller": "^2.2.4"
+ "date-format": "^4.0.7",
+ "debug": "^4.3.4",
+ "flatted": "^3.2.5",
+ "rfdc": "^1.3.0",
+ "streamroller": "^3.0.7"
},
"engines": {
"node": ">=8.0"
}
},
+ "node_modules/log4js/node_modules/debug": {
+ "version": "4.3.4",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
+ "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
+ "dev": true,
+ "dependencies": {
+ "ms": "2.1.2"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
"node_modules/lower-case": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/lower-case/-/lower-case-1.1.4.tgz",
@@ -4943,9 +4991,9 @@
}
},
"node_modules/minimist": {
- "version": "1.2.5",
- "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
- "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
+ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
"dev": true
},
"node_modules/minimist-options": {
@@ -5282,9 +5330,9 @@
"dev": true
},
"node_modules/nth-check": {
- "version": "2.0.0",
- "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.0.tgz",
- "integrity": "sha512-i4sc/Kj8htBrAiH1viZ0TgU8Y5XqCaV/FziYK6TBczxmeKm3AEFWqqF3195yKudrarqy7Zu80Ra5dobFjn9X/Q==",
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.0.1.tgz",
+ "integrity": "sha512-it1vE95zF6dTT9lBsYbxvqh0Soy4SPowchj0UBGj/V6cTPnXXtQOPUbhZ6CmGzAD/rW22LQK6E96pcdJXk4A4w==",
"dev": true,
"dependencies": {
"boolbase": "^1.0.0"
@@ -5563,9 +5611,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/path-to-regexp": {
@@ -6093,9 +6141,9 @@
}
},
"node_modules/rfdc": {
- "version": "1.2.0",
- "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.2.0.tgz",
- "integrity": "sha512-ijLyszTMmUrXvjSooucVQwimGUk84eRcmCuLV8Xghe3UO85mjUtRAHRyoMM6XtyqbECaXuBWx18La3523sXINA==",
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz",
+ "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==",
"dev": true
},
"node_modules/rimraf": {
@@ -6516,26 +6564,34 @@
}
},
"node_modules/streamroller": {
- "version": "2.2.4",
- "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-2.2.4.tgz",
- "integrity": "sha512-OG79qm3AujAM9ImoqgWEY1xG4HX+Lw+yY6qZj9R1K2mhF5bEmQ849wvrb+4vt4jLMLzwXttJlQbOdPOQVRv7DQ==",
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.7.tgz",
+ "integrity": "sha512-kh68kwiDGuIPiPDWwRbEC5us+kfARP1e9AsQiaLaSqGrctOvMn0mtL8iNY3r4/o5nIoYi3gPI1jexguZsXDlxw==",
"dev": true,
"dependencies": {
- "date-format": "^2.1.0",
- "debug": "^4.1.1",
- "fs-extra": "^8.1.0"
+ "date-format": "^4.0.7",
+ "debug": "^4.3.4",
+ "fs-extra": "^10.0.1"
},
"engines": {
"node": ">=8.0"
}
},
- "node_modules/streamroller/node_modules/date-format": {
- "version": "2.1.0",
- "resolved": "https://registry.npmjs.org/date-format/-/date-format-2.1.0.tgz",
- "integrity": "sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA==",
+ "node_modules/streamroller/node_modules/debug": {
+ "version": "4.3.4",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
+ "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
"dev": true,
+ "dependencies": {
+ "ms": "2.1.2"
+ },
"engines": {
- "node": ">=4.0"
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
}
},
"node_modules/string_decoder": {
@@ -7201,12 +7257,12 @@
}
},
"node_modules/universalify": {
- "version": "0.1.2",
- "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
- "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==",
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
+ "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"dev": true,
"engines": {
- "node": ">= 4.0.0"
+ "node": ">= 10.0.0"
}
},
"node_modules/unpipe": {
diff --git a/node_modules/base64-arraybuffer/LICENSE b/node_modules/@socket.io/base64-arraybuffer/LICENSE
similarity index 100%
rename from node_modules/base64-arraybuffer/LICENSE
rename to node_modules/@socket.io/base64-arraybuffer/LICENSE
diff --git a/node_modules/base64-arraybuffer/README.md b/node_modules/@socket.io/base64-arraybuffer/README.md
similarity index 93%
rename from node_modules/base64-arraybuffer/README.md
rename to node_modules/@socket.io/base64-arraybuffer/README.md
index 4d6ae71..fd718f1 100644
--- a/node_modules/base64-arraybuffer/README.md
+++ b/node_modules/@socket.io/base64-arraybuffer/README.md
@@ -4,6 +4,8 @@
[](https://www.npmjs.org/package/base64-arraybuffer)
[](https://www.npmjs.org/package/base64-arraybuffer)
+Forked from https://github.com/niklasvh/base64-arraybuffer
+
Encode/decode base64 data into ArrayBuffers
### Installing
diff --git a/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js b/node_modules/@socket.io/base64-arraybuffer/dist/base64-arraybuffer.es5.js
similarity index 96%
rename from node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js
rename to node_modules/@socket.io/base64-arraybuffer/dist/base64-arraybuffer.es5.js
index 285857c..4346610 100644
--- a/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js
+++ b/node_modules/@socket.io/base64-arraybuffer/dist/base64-arraybuffer.es5.js
@@ -1,6 +1,6 @@
/*
* base64-arraybuffer 1.0.1 <https://github.com/niklasvh/base64-arraybuffer>
- * Copyright (c) 2021 Niklas von Hertzen <https://hertzen.com>
+ * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
* Released under MIT License
*/
var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
diff --git a/node_modules/@socket.io/base64-arraybuffer/dist/base64-arraybuffer.es5.js.map b/node_modules/@socket.io/base64-arraybuffer/dist/base64-arraybuffer.es5.js.map
new file mode 100644
index 0000000..b34fd27
--- /dev/null
+++ b/node_modules/@socket.io/base64-arraybuffer/dist/base64-arraybuffer.es5.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"base64-arraybuffer.es5.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAAA,IAAM,KAAK,GAAG,kEAAkE,CAAC;AAEjF;AACA,IAAM,MAAM,GAAG,OAAO,UAAU,KAAK,WAAW,GAAG,EAAE,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;AAC5E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;IACnC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACnC;IAEY,MAAM,GAAG,UAAC,WAAwB;IAC3C,IAAI,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,EACnC,CAAC,EACD,GAAG,GAAG,KAAK,CAAC,MAAM,EAClB,MAAM,GAAG,EAAE,CAAC;IAEhB,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7D,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;KACtC;IAED,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE;QACf,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;KACzD;SAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE;QACtB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;KAC1D;IAED,OAAO,MAAM,CAAC;AAClB,EAAE;IAEW,MAAM,GAAG,UAAC,MAAc;IACjC,IAAI,YAAY,GAAG,MAAM,CAAC,MAAM,GAAG,IAAI,EACnC,GAAG,GAAG,MAAM,CAAC,MAAM,EACnB,CAAC,EACD,CAAC,GAAG,CAAC,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,CAAC;IAEb,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;QACnC,YAAY,EAAE,CAAC;QACf,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;YACnC,YAAY,EAAE,CAAC;SAClB;KACJ;IAED,IAAM,WAAW,GAAG,IAAI,WAAW,CAAC,YAAY,CAAC,EAC7C,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;IAExC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;QACzB,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACxC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC5C,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC5C,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAE5C,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC;QAC/C,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,GAAG,EAAE,KAAK,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC;QACtD,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,GAAG,CAAC,KAAK,CAAC,KAAK,QAAQ,GAAG,EAAE,CAAC,CAAC;KACxD;IAED,OAAO,WAAW,CAAC;AACvB;;;;"}
\ No newline at end of file
diff --git a/node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js b/node_modules/@socket.io/base64-arraybuffer/dist/base64-arraybuffer.umd.js
similarity index 97%
rename from node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js
rename to node_modules/@socket.io/base64-arraybuffer/dist/base64-arraybuffer.umd.js
index 7fa6e0b..fd873c2 100644
--- a/node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js
+++ b/node_modules/@socket.io/base64-arraybuffer/dist/base64-arraybuffer.umd.js
@@ -1,6 +1,6 @@
/*
* base64-arraybuffer 1.0.1 <https://github.com/niklasvh/base64-arraybuffer>
- * Copyright (c) 2021 Niklas von Hertzen <https://hertzen.com>
+ * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
* Released under MIT License
*/
(function (global, factory) {
diff --git a/node_modules/@socket.io/base64-arraybuffer/dist/base64-arraybuffer.umd.js.map b/node_modules/@socket.io/base64-arraybuffer/dist/base64-arraybuffer.umd.js.map
new file mode 100644
index 0000000..05a3cc0
--- /dev/null
+++ b/node_modules/@socket.io/base64-arraybuffer/dist/base64-arraybuffer.umd.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"base64-arraybuffer.umd.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;IAAA,IAAM,KAAK,GAAG,kEAAkE,CAAC;IAEjF;IACA,IAAM,MAAM,GAAG,OAAO,UAAU,KAAK,WAAW,GAAG,EAAE,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IAC5E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KACnC;QAEY,MAAM,GAAG,UAAC,WAAwB;QAC3C,IAAI,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,EACnC,CAAC,EACD,GAAG,GAAG,KAAK,CAAC,MAAM,EAClB,MAAM,GAAG,EAAE,CAAC;QAEhB,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;YACzB,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC7D,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;SACtC;QAED,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE;YACf,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;SACzD;aAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE;YACtB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;SAC1D;QAED,OAAO,MAAM,CAAC;IAClB,EAAE;QAEW,MAAM,GAAG,UAAC,MAAc;QACjC,IAAI,YAAY,GAAG,MAAM,CAAC,MAAM,GAAG,IAAI,EACnC,GAAG,GAAG,MAAM,CAAC,MAAM,EACnB,CAAC,EACD,CAAC,GAAG,CAAC,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,CAAC;QAEb,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;YACnC,YAAY,EAAE,CAAC;YACf,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;gBACnC,YAAY,EAAE,CAAC;aAClB;SACJ;QAED,IAAM,WAAW,GAAG,IAAI,WAAW,CAAC,YAAY,CAAC,EAC7C,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;QAExC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;YACzB,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;YACxC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC5C,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC5C,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAE5C,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC;YAC/C,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,GAAG,EAAE,KAAK,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC;YACtD,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,GAAG,CAAC,KAAK,CAAC,KAAK,QAAQ,GAAG,EAAE,CAAC,CAAC;SACxD;QAED,OAAO,WAAW,CAAC;IACvB;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/node_modules/base64-arraybuffer/dist/lib/index.js b/node_modules/@socket.io/base64-arraybuffer/dist/lib/index.js
similarity index 99%
rename from node_modules/base64-arraybuffer/dist/lib/index.js
rename to node_modules/@socket.io/base64-arraybuffer/dist/lib/index.js
index 79fa4b7..11c7d94 100644
--- a/node_modules/base64-arraybuffer/dist/lib/index.js
+++ b/node_modules/@socket.io/base64-arraybuffer/dist/lib/index.js
@@ -45,4 +45,4 @@
return arraybuffer;
};
exports.decode = decode;
-//# sourceMappingURL=index.js.map
\ No newline at end of file
+//# sourceMappingURL=index.js.map
diff --git a/node_modules/base64-arraybuffer/dist/lib/index.js.map b/node_modules/@socket.io/base64-arraybuffer/dist/lib/index.js.map
similarity index 100%
rename from node_modules/base64-arraybuffer/dist/lib/index.js.map
rename to node_modules/@socket.io/base64-arraybuffer/dist/lib/index.js.map
diff --git a/node_modules/base64-arraybuffer/dist/types/index.d.ts b/node_modules/@socket.io/base64-arraybuffer/dist/types/index.d.ts
similarity index 100%
rename from node_modules/base64-arraybuffer/dist/types/index.d.ts
rename to node_modules/@socket.io/base64-arraybuffer/dist/types/index.d.ts
diff --git a/node_modules/base64-arraybuffer/package.json b/node_modules/@socket.io/base64-arraybuffer/package.json
similarity index 81%
rename from node_modules/base64-arraybuffer/package.json
rename to node_modules/@socket.io/base64-arraybuffer/package.json
index 5671ca8..9de33b5 100644
--- a/node_modules/base64-arraybuffer/package.json
+++ b/node_modules/@socket.io/base64-arraybuffer/package.json
@@ -1,11 +1,11 @@
{
- "name": "base64-arraybuffer",
+ "name": "@socket.io/base64-arraybuffer",
"description": "Encode/decode base64 data into ArrayBuffers",
"main": "dist/base64-arraybuffer.umd.js",
"module": "dist/base64-arraybuffer.es5.js",
"typings": "dist/types/index.d.ts",
- "version": "1.0.1",
- "homepage": "https://github.com/niklasvh/base64-arraybuffer",
+ "version": "1.0.2",
+ "homepage": "https://github.com/socketio/base64-arraybuffer",
"author": {
"name": "Niklas von Hertzen",
"email": "niklasvh@gmail.com",
@@ -13,10 +13,10 @@
},
"repository": {
"type": "git",
- "url": "https://github.com/niklasvh/base64-arraybuffer"
+ "url": "https://github.com/socketio/base64-arraybuffer"
},
"bugs": {
- "url": "https://github.com/niklasvh/base64-arraybuffer/issues"
+ "url": "https://github.com/socketio/base64-arraybuffer/issues"
},
"license": "MIT",
"engines": {
@@ -50,5 +50,9 @@
"tslint-config-prettier": "^1.18.0",
"typescript": "^4.3.5"
},
- "keywords": []
+ "keywords": [],
+ "files": [
+ "src/",
+ "dist/"
+ ]
}
diff --git a/node_modules/@socket.io/base64-arraybuffer/src/index.ts b/node_modules/@socket.io/base64-arraybuffer/src/index.ts
new file mode 100644
index 0000000..2de9733
--- /dev/null
+++ b/node_modules/@socket.io/base64-arraybuffer/src/index.ts
@@ -0,0 +1,63 @@
+const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
+
+// Use a lookup table to find the index.
+const lookup = typeof Uint8Array === 'undefined' ? [] : new Uint8Array(256);
+for (let i = 0; i < chars.length; i++) {
+ lookup[chars.charCodeAt(i)] = i;
+}
+
+export const encode = (arraybuffer: ArrayBuffer): string => {
+ let bytes = new Uint8Array(arraybuffer),
+ i,
+ len = bytes.length,
+ base64 = '';
+
+ for (i = 0; i < len; i += 3) {
+ base64 += chars[bytes[i] >> 2];
+ base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];
+ base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];
+ base64 += chars[bytes[i + 2] & 63];
+ }
+
+ if (len % 3 === 2) {
+ base64 = base64.substring(0, base64.length - 1) + '=';
+ } else if (len % 3 === 1) {
+ base64 = base64.substring(0, base64.length - 2) + '==';
+ }
+
+ return base64;
+};
+
+export const decode = (base64: string): ArrayBuffer => {
+ let bufferLength = base64.length * 0.75,
+ len = base64.length,
+ i,
+ p = 0,
+ encoded1,
+ encoded2,
+ encoded3,
+ encoded4;
+
+ if (base64[base64.length - 1] === '=') {
+ bufferLength--;
+ if (base64[base64.length - 2] === '=') {
+ bufferLength--;
+ }
+ }
+
+ const arraybuffer = new ArrayBuffer(bufferLength),
+ bytes = new Uint8Array(arraybuffer);
+
+ for (i = 0; i < len; i += 4) {
+ encoded1 = lookup[base64.charCodeAt(i)];
+ encoded2 = lookup[base64.charCodeAt(i + 1)];
+ encoded3 = lookup[base64.charCodeAt(i + 2)];
+ encoded4 = lookup[base64.charCodeAt(i + 3)];
+
+ bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);
+ bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);
+ bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);
+ }
+
+ return arraybuffer;
+};
diff --git a/node_modules/@types/yauzl/LICENSE b/node_modules/@types/yauzl/LICENSE
new file mode 100644
index 0000000..2107107
--- /dev/null
+++ b/node_modules/@types/yauzl/LICENSE
@@ -0,0 +1,21 @@
+ MIT License
+
+ Copyright (c) Microsoft Corporation. All rights reserved.
+
+ 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
diff --git a/node_modules/@types/yauzl/README.md b/node_modules/@types/yauzl/README.md
new file mode 100644
index 0000000..f38f9c0
--- /dev/null
+++ b/node_modules/@types/yauzl/README.md
@@ -0,0 +1,16 @@
+# Installation
+> `npm install --save @types/yauzl`
+
+# Summary
+This package contains type definitions for yauzl (https://github.com/thejoshwolfe/yauzl).
+
+# Details
+Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yauzl
+
+Additional Details
+ * Last updated: Wed, 02 Jan 2019 20:27:45 GMT
+ * Dependencies: @types/node
+ * Global values: none
+
+# Credits
+These definitions were written by Florian Keller <https://github.com/ffflorian>.
diff --git a/node_modules/@types/yauzl/index.d.ts b/node_modules/@types/yauzl/index.d.ts
new file mode 100644
index 0000000..11c1849
--- /dev/null
+++ b/node_modules/@types/yauzl/index.d.ts
@@ -0,0 +1,98 @@
+// Type definitions for yauzl 2.9
+// Project: https://github.com/thejoshwolfe/yauzl
+// Definitions by: Florian Keller <https://github.com/ffflorian>
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+
+/// <reference types="node" />
+
+import { EventEmitter } from 'events';
+import { Readable } from 'stream';
+
+export abstract class RandomAccessReader extends EventEmitter {
+ _readStreamForRange(start: number, end: number): void;
+ createReadStream(options: { start: number; end: number }): void;
+ read(buffer: Buffer, offset: number, length: number, position: number, callback: (err?: Error) => void): void;
+ close(callback: (err?: Error) => void): void;
+}
+
+export class Entry {
+ comment: string;
+ compressedSize: number;
+ compressionMethod: number;
+ crc32: number;
+ externalFileAttributes: number;
+ extraFieldLength: number;
+ extraFields: Array<{ id: number; data: Buffer }>;
+ fileCommentLength: number;
+ fileName: string;
+ fileNameLength: number;
+ generalPurposeBitFlag: number;
+ internalFileAttributes: number;
+ lastModFileDate: number;
+ lastModFileTime: number;
+ relativeOffsetOfLocalHeader: number;
+ uncompressedSize: number;
+ versionMadeBy: number;
+ versionNeededToExtract: number;
+
+ getLastModDate(): Date;
+ isEncrypted(): boolean;
+ isCompressed(): boolean;
+}
+
+export interface ZipFileOptions {
+ decompress: boolean | null;
+ decrypt: boolean | null;
+ start: number | null;
+ end: number | null;
+}
+
+export class ZipFile extends EventEmitter {
+ autoClose: boolean;
+ comment: string;
+ decodeStrings: boolean;
+ emittedError: boolean;
+ entriesRead: number;
+ entryCount: number;
+ fileSize: number;
+ isOpen: boolean;
+ lazyEntries: boolean;
+ readEntryCursor: boolean;
+ validateEntrySizes: boolean;
+
+ constructor(
+ reader: RandomAccessReader,
+ centralDirectoryOffset: number,
+ fileSize: number,
+ entryCount: number,
+ comment: string,
+ autoClose: boolean,
+ lazyEntries: boolean,
+ decodeStrings: boolean,
+ validateEntrySizes: boolean,
+ );
+
+ openReadStream(entry: Entry, options: ZipFileOptions, callback: (err?: Error, stream?: Readable) => void): void;
+ openReadStream(entry: Entry, callback: (err?: Error, stream?: Readable) => void): void;
+ close(): void;
+ readEntry(): void;
+}
+
+export interface Options {
+ autoClose?: boolean;
+ lazyEntries?: boolean;
+ decodeStrings?: boolean;
+ validateEntrySizes?: boolean;
+ strictFileNames?: boolean;
+}
+
+export function open(path: string, options: Options, callback?: (err?: Error, zipfile?: ZipFile) => void): void;
+export function open(path: string, callback?: (err?: Error, zipfile?: ZipFile) => void): void;
+export function fromFd(fd: number, options: Options, callback?: (err?: Error, zipfile?: ZipFile) => void): void;
+export function fromFd(fd: number, callback?: (err?: Error, zipfile?: ZipFile) => void): void;
+export function fromBuffer(buffer: Buffer, options: Options, callback?: (err?: Error, zipfile?: ZipFile) => void): void;
+export function fromBuffer(buffer: Buffer, callback?: (err?: Error, zipfile?: ZipFile) => void): void;
+export function fromRandomAccessReader(reader: RandomAccessReader, totalSize: number, options: Options, callback: (err?: Error, zipfile?: ZipFile) => void): void;
+export function fromRandomAccessReader(reader: RandomAccessReader, totalSize: number, callback: (err?: Error, zipfile?: ZipFile) => void): void;
+export function dosDateTimeToDate(date: number, time: number): Date;
+export function validateFileName(fileName: string): string | null;
diff --git a/node_modules/@types/yauzl/package.json b/node_modules/@types/yauzl/package.json
new file mode 100644
index 0000000..736b4c6
--- /dev/null
+++ b/node_modules/@types/yauzl/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "@types/yauzl",
+ "version": "2.9.1",
+ "description": "TypeScript definitions for yauzl",
+ "license": "MIT",
+ "contributors": [
+ {
+ "name": "Florian Keller",
+ "url": "https://github.com/ffflorian",
+ "githubUsername": "ffflorian"
+ }
+ ],
+ "main": "",
+ "types": "index",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
+ },
+ "scripts": {},
+ "dependencies": {
+ "@types/node": "*"
+ },
+ "typesPublisherContentHash": "78f765e4caa71766b61010d584b87ea4cf34e0bac10cac6b16d722d8a8456073",
+ "typeScriptVersion": "2.0"
+}
diff --git a/node_modules/base64-arraybuffer/CHANGELOG.md b/node_modules/base64-arraybuffer/CHANGELOG.md
deleted file mode 100644
index 4a304a0..0000000
--- a/node_modules/base64-arraybuffer/CHANGELOG.md
+++ /dev/null
@@ -1,19 +0,0 @@
-# Changelog
-
-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.
-
-## [1.0.1](https://github.com/niklasvh/base64-arraybuffer/compare/v1.0.0...v1.0.1) (2021-08-10)
-
-
-### fix
-
-* make lib loadable on ie9 (#30) ([a618d14](https://github.com/niklasvh/base64-arraybuffer/commit/a618d14d323f4eb230321a3609bfbc9f23f430c0)), closes [#30](https://github.com/niklasvh/base64-arraybuffer/issues/30)
-
-
-
-# [1.0.0](https://github.com/niklasvh/base64-arraybuffer/compare/v0.2.0...v1.0.0) (2021-08-10)
-
-
-### docs
-
-* update readme (#29) ([0a0253d](https://github.com/niklasvh/base64-arraybuffer/commit/0a0253dcc2e3f01a1f6d04fa81d578f714fce27f)), closes [#29](https://github.com/niklasvh/base64-arraybuffer/issues/29)
diff --git a/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js.map b/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js.map
deleted file mode 100644
index 142c152..0000000
--- a/node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"base64-arraybuffer.es5.js","sources":["../../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAAA,IAAM,KAAK,GAAG,kEAAkE,CAAC;AAEjF;AACA,IAAM,MAAM,GAAG,OAAO,UAAU,KAAK,WAAW,GAAG,EAAE,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;AAC5E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;IACnC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CACnC;IAEY,MAAM,GAAG,UAAC,WAAwB;IAC3C,IAAI,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,EACnC,CAAC,EACD,GAAG,GAAG,KAAK,CAAC,MAAM,EAClB,MAAM,GAAG,EAAE,CAAC;IAEhB,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;QACzB,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC7D,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;KACtC;IAED,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE;QACf,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;KACzD;SAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE;QACtB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;KAC1D;IAED,OAAO,MAAM,CAAC;AAClB,EAAE;IAEW,MAAM,GAAG,UAAC,MAAc;IACjC,IAAI,YAAY,GAAG,MAAM,CAAC,MAAM,GAAG,IAAI,EACnC,GAAG,GAAG,MAAM,CAAC,MAAM,EACnB,CAAC,EACD,CAAC,GAAG,CAAC,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,CAAC;IAEb,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;QACnC,YAAY,EAAE,CAAC;QACf,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;YACnC,YAAY,EAAE,CAAC;SAClB;KACJ;IAED,IAAM,WAAW,GAAG,IAAI,WAAW,CAAC,YAAY,CAAC,EAC7C,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;IAExC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;QACzB,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QACxC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC5C,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC5C,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAE5C,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC;QAC/C,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,GAAG,EAAE,KAAK,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC;QACtD,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,GAAG,CAAC,KAAK,CAAC,KAAK,QAAQ,GAAG,EAAE,CAAC,CAAC;KACxD;IAED,OAAO,WAAW,CAAC;AACvB;;;;"}
\ No newline at end of file
diff --git a/node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js.map b/node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js.map
deleted file mode 100644
index 1fafdef..0000000
--- a/node_modules/base64-arraybuffer/dist/base64-arraybuffer.umd.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"file":"base64-arraybuffer.umd.js","sources":["../../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;IAAA,IAAM,KAAK,GAAG,kEAAkE,CAAC;IAEjF;IACA,IAAM,MAAM,GAAG,OAAO,UAAU,KAAK,WAAW,GAAG,EAAE,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC;IAC5E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;KACnC;QAEY,MAAM,GAAG,UAAC,WAAwB;QAC3C,IAAI,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,EACnC,CAAC,EACD,GAAG,GAAG,KAAK,CAAC,MAAM,EAClB,MAAM,GAAG,EAAE,CAAC;QAEhB,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;YACzB,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YAC/B,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC7D,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;SACtC;QAED,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE;YACf,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;SACzD;aAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE;YACtB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;SAC1D;QAED,OAAO,MAAM,CAAC;IAClB,EAAE;QAEW,MAAM,GAAG,UAAC,MAAc;QACjC,IAAI,YAAY,GAAG,MAAM,CAAC,MAAM,GAAG,IAAI,EACnC,GAAG,GAAG,MAAM,CAAC,MAAM,EACnB,CAAC,EACD,CAAC,GAAG,CAAC,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,CAAC;QAEb,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;YACnC,YAAY,EAAE,CAAC;YACf,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE;gBACnC,YAAY,EAAE,CAAC;aAClB;SACJ;QAED,IAAM,WAAW,GAAG,IAAI,WAAW,CAAC,YAAY,CAAC,EAC7C,KAAK,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;QAExC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE;YACzB,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;YACxC,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC5C,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC5C,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAE5C,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC;YAC/C,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,GAAG,EAAE,KAAK,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC;YACtD,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,GAAG,CAAC,KAAK,CAAC,KAAK,QAAQ,GAAG,EAAE,CAAC,CAAC;SACxD;QAED,OAAO,WAAW,CAAC;IACvB;;;;;;;;;;;"}
\ No newline at end of file
diff --git a/node_modules/base64-arraybuffer/rollup.config.ts b/node_modules/base64-arraybuffer/rollup.config.ts
deleted file mode 100644
index 4d44ff7..0000000
--- a/node_modules/base64-arraybuffer/rollup.config.ts
+++ /dev/null
@@ -1,40 +0,0 @@
-import resolve from '@rollup/plugin-node-resolve';
-import commonjs from '@rollup/plugin-commonjs';
-import sourceMaps from 'rollup-plugin-sourcemaps';
-import typescript from '@rollup/plugin-typescript';
-import json from 'rollup-plugin-json';
-
-const pkg = require('./package.json');
-
-const banner = `/*
- * ${pkg.name} ${pkg.version} <${pkg.homepage}>
- * Copyright (c) ${(new Date()).getFullYear()} ${pkg.author.name} <${pkg.author.url}>
- * Released under ${pkg.license} License
- */`;
-
-export default {
- input: `src/index.ts`,
- output: [
- { file: pkg.main, name: pkg.name, format: 'umd', banner, sourcemap: true },
- { file: pkg.module, format: 'esm', banner, sourcemap: true },
- ],
- external: [],
- watch: {
- include: 'src/**',
- },
- plugins: [
- // Allow node_modules resolution, so you can use 'external' to control
- // which external modules to include in the bundle
- // https://github.com/rollup/rollup-plugin-node-resolve#usage
- resolve(),
- // Allow json resolution
- json(),
- // Compile TypeScript files
- typescript(),
- // Allow bundling cjs modules (unlike webpack, rollup doesn't understand cjs)
- commonjs(),
-
- // Resolve source maps to the original source
- sourceMaps(),
- ],
-}
diff --git a/node_modules/date-format/.eslintrc b/node_modules/date-format/.eslintrc
deleted file mode 100644
index 54dbae8..0000000
--- a/node_modules/date-format/.eslintrc
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "extends": [
- "eslint:recommended"
- ],
- "env": {
- "node": true,
- "mocha": true
- },
- "plugins": [
- "mocha"
- ]
-}
diff --git a/node_modules/date-format/.travis.yml b/node_modules/date-format/.travis.yml
deleted file mode 100644
index 19b7cc8..0000000
--- a/node_modules/date-format/.travis.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-language: node_js
-sudo: false
-node_js:
- - "10"
- - "8"
- - "6"
diff --git a/node_modules/date-format/CHANGELOG.md b/node_modules/date-format/CHANGELOG.md
new file mode 100644
index 0000000..8793a90
--- /dev/null
+++ b/node_modules/date-format/CHANGELOG.md
@@ -0,0 +1,65 @@
+# date-format Changelog
+
+## 4.0.7
+
+- [chore(dep): updated dependencies](https://github.com/nomiddlename/date-format/pull/57) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(dev): bump eslint-plugin-mocha from 10.0.3 to 10.0.4
+ - updated package-lock.json
+- [chore(dep): updated dependencies](https://github.com/nomiddlename/date-format/pull/54) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(dev): bump eslint from 8.11.0 to 8.13.0
+ - package-lock.json
+
+## 4.0.6
+
+- [chore(dep): updated dependencies](https://github.com/nomiddlename/date-format/pull/52) - thanks [@peteriman](https://github.com/peteriman)
+ - package-lock.json
+
+## 4.0.5
+
+- [chore(test): better test coverage instead of ignoring](https://github.com/nomiddlename/date-format/pull/48) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(dep): updated dependencies](https://github.com/nomiddlename/date-format/pull/49) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(dev): eslint from 8.10.0 to 8.11.0
+ - chore(dev): mocha from 9.2.1 to 9.2.2
+ - package-lock.json
+- [chore(docs): updated README.md with badges](https://github.com/nomiddlename/date-format/pull/50) thanks [@peteriman](https://github.com/peteriman)
+
+## 4.0.4
+
+- Updated dependencies - thanks [@peteriman](https://github.com/peteriman)
+ - [chore(dev): eslint from 8.8.0 to 8.10.0 and mocha from 9.2.0 to 9.2.1](https://github.com/nomiddlename/date-format/pull/46)
+ - [chore(dev): eslint from 8.7.0 to 8.8.0 and mocha from 9.1.4 to 9.2.0](https://github.com/nomiddlename/date-format/pull/45)
+ - [package-lock.json](https://github.com/nomiddlename/date-format/pull/44)
+
+## 4.0.3
+
+- [100% test coverage](https://github.com/nomiddlename/date-format/pull/42) - thanks [@peteriman](https://github.com/peteriman)
+- Updated dependencies - thanks [@peteriman](https://github.com/peteriman)
+ - [chore(dev): eslint from 8.6.0 to 8.7.0 and mocha from 9.1.3 to 9.1.4](https://github.com/nomiddlename/date-format/pull/41)
+
+## 4.0.2
+
+- [Not to publish misc files to NPM](https://github.com/nomiddlename/date-format/pull/39) - thanks [@peteriman](https://github.com/peteriman)
+- CHANGELOG.md
+ - [Removed "log4js" from title of CHANGELOG.md](https://github.com/nomiddlename/date-format/pull/37) - thanks [@joshuabremerdexcom](https://github.com/joshuabremerdexcom)
+ - [Added "date-format" to title of CHANGELOG.md](https://github.com/nomiddlename/date-format/commit/64a95d0386853692d7d65174f94a0751e775f7ce#diff-06572a96a58dc510037d5efa622f9bec8519bc1beab13c9f251e97e657a9d4ed) - thanks [@peteriman](https://github.com/peteriman)
+- Updated dependencies - thanks [@peteriman](https://github.com/peteriman)
+ - [chore(dev): eslint-plugin-mocha from 5.3.0 to 10.0.3](https://github.com/nomiddlename/date-format/pull/38)
+
+## 4.0.1
+
+- is exactly the same as 4.0.0 and is a re-published 4.0.0 to npm
+
+## 4.0.0
+
+- [Fix timezone format to include colon separator](https://github.com/nomiddlename/date-format/pull/27) - thanks [@peteriman](https://github.com/peteriman)
+ - [test: have a test case for timezone with colon](https://github.com/nomiddlename/date-format/pull/32) - thanks [@peteriman](https://github.com/peteriman)
+- [Docs: Updated README.md with more examples and expected output](https://github.com/nomiddlename/date-format/pull/33) - thanks [@peteriman](https://github.com/peteriman)
+- Updated dependencies
+ - [should-util from 1.0.0 to 1.0.1](https://github.com/nomiddlename/date-format/pull/31) - thanks [@peteriman](https://github.com/peteriman)
+ - [chore(dev): eslint from 5.16.0 to 8.6.0 and mocha from 5.2.0 to 9.1.3](https://github.com/nomiddlename/date-format/pull/30) - thanks [@peteriman](https://github.com/peteriman)
+ - [acorn from 6.2.0 to 6.4.2](https://github.com/nomiddlename/date-format/pull/29) - thanks [@Dependabot](https://github.com/dependabot)
+ - [lodash from 4.17.14 to 4.17.21](https://github.com/nomiddlename/date-format/pull/26) - thanks [@Dependabot](https://github.com/dependabot)
+
+## Previous versions
+
+Change information for older versions can be found by looking at the milestones in github.
diff --git a/node_modules/date-format/README.md b/node_modules/date-format/README.md
index cca25e0..3eee99f 100644
--- a/node_modules/date-format/README.md
+++ b/node_modules/date-format/README.md
@@ -1,6 +1,8 @@
-date-format
+date-format [](https://github.com/nomiddlename/date-format/actions/workflows/codeql-analysis.yml) [](https://github.com/nomiddlename/date-format/actions/workflows/node.js.yml)
===========
+[](https://nodei.co/npm/date-format/)
+
node.js formatting of Date objects as strings. Probably exactly the same as some other library out there.
```sh
@@ -15,18 +17,28 @@
```javascript
var format = require('date-format');
-format.asString(); //defaults to ISO8601 format and current date.
-format.asString(new Date()); //defaults to ISO8601 format
-format.asString('hh:mm:ss.SSS', new Date()); //just the time
+format.asString(); // defaults to ISO8601 format and current date
+format.asString(new Date()); // defaults to ISO8601 format
+format.asString('hh:mm:ss.SSS', new Date()); // just the time
+format.asString(format.ISO8601_WITH_TZ_OFFSET_FORMAT, new Date()); // in ISO8601 with timezone
```
or
```javascript
var format = require('date-format');
-format(); //defaults to ISO8601 format and current date.
-format(new Date());
-format('hh:mm:ss.SSS', new Date());
+format(); // defaults to ISO8601 format and current date
+format(new Date()); // defaults to ISO8601 format
+format('hh:mm:ss.SSS', new Date()); // just the time
+format(format.ISO8601_WITH_TZ_OFFSET_FORMAT, new Date()); // in ISO8601 with timezone
+```
+
+**output:**
+```javascript
+2017-03-14T14:10:20.391
+2017-03-14T14:10:20.391
+14:10:20.391
+2017-03-14T14:10:20.391+11:00
```
Format string can be anything, but the following letters will be replaced (and leading zeroes added if necessary):
@@ -38,11 +50,11 @@
* mm - `date.getMinutes()`
* ss - `date.getSeconds()`
* SSS - `date.getMilliseconds()`
-* O - timezone offset in +hm format (note that time will be in UTC if displaying offset)
+* O - timezone offset in ±hh:mm format (note that time will still be local if displaying offset)
Built-in formats:
* `format.ISO8601_FORMAT` - `2017-03-14T14:10:20.391` (local time used)
-* `format.ISO8601_WITH_TZ_OFFSET_FORMAT` - `2017-03-14T03:10:20.391+1100` (UTC + TZ used)
+* `format.ISO8601_WITH_TZ_OFFSET_FORMAT` - `2017-03-14T14:10:20.391+11:00` (local + TZ used)
* `format.DATETIME_FORMAT` - `14 03 2017 14:10:20.391` (local time used)
* `format.ABSOLUTETIME_FORMAT` - `14:10:20.391` (local time used)
@@ -54,5 +66,8 @@
var format = require('date-format');
// pass in the format of the string as first argument
format.parse(format.ISO8601_FORMAT, '2017-03-14T14:10:20.391');
+format.parse(format.ISO8601_WITH_TZ_OFFSET_FORMAT, '2017-03-14T14:10:20.391+1100');
+format.parse(format.ISO8601_WITH_TZ_OFFSET_FORMAT, '2017-03-14T14:10:20.391+11:00');
+format.parse(format.ISO8601_WITH_TZ_OFFSET_FORMAT, '2017-03-14T03:10:20.391Z');
// returns Date
```
diff --git a/node_modules/date-format/lib/index.js b/node_modules/date-format/lib/index.js
index 9f8de68..15ec55a 100644
--- a/node_modules/date-format/lib/index.js
+++ b/node_modules/date-format/lib/index.js
@@ -21,13 +21,9 @@
var os = Math.abs(timezoneOffset);
var h = String(Math.floor(os / 60));
var m = String(os % 60);
- if (h.length === 1) {
- h = "0" + h;
- }
- if (m.length === 1) {
- m = "0" + m;
- }
- return timezoneOffset < 0 ? "+" + h + m : "-" + h + m;
+ h = ("0" + h).slice(-2);
+ m = ("0" + m).slice(-2);
+ return timezoneOffset === 0 ? "Z" : (timezoneOffset < 0 ? "+" : "-") + h + ":" + m;
}
function asString(format, date) {
@@ -126,11 +122,14 @@
},
{
pattern: /O/,
- regexp: "[+-]\\d{3,4}|Z",
+ regexp: "[+-]\\d{1,2}:?\\d{2}?|Z",
fn: function(date, value) {
if (value === "Z") {
value = 0;
}
+ else {
+ value = value.replace(":", "");
+ }
var offset = Math.abs(value);
var timezoneOffset = (value > 0 ? -1 : 1 ) * ((offset % 100) + Math.floor(offset / 100) * 60);
// Per ISO8601 standard: UTC = local time - offset
diff --git a/node_modules/date-format/package.json b/node_modules/date-format/package.json
index 4a527a2..6af0173 100644
--- a/node_modules/date-format/package.json
+++ b/node_modules/date-format/package.json
@@ -1,8 +1,12 @@
{
"name": "date-format",
- "version": "3.0.0",
+ "version": "4.0.7",
"description": "Formatting Date objects as strings since 2013",
"main": "lib/index.js",
+ "files": [
+ "lib",
+ "CHANGELOG.md"
+ ],
"repository": {
"type": "git",
"url": "https://github.com/nomiddlename/date-format.git"
@@ -13,7 +17,7 @@
"scripts": {
"lint": "eslint lib/* test/*",
"pretest": "eslint lib/* test/*",
- "test": "mocha"
+ "test": "nyc --check-coverage mocha"
},
"keywords": [
"date",
@@ -25,9 +29,18 @@
"readmeFilename": "README.md",
"gitHead": "bf59015ab6c9e86454b179374f29debbdb403522",
"devDependencies": {
- "eslint": "^5.16.0",
- "eslint-plugin-mocha": "^5.3.0",
- "mocha": "^5.2.0",
+ "eslint": "^8.13.0",
+ "eslint-plugin-mocha": "^10.0.4",
+ "mocha": "^9.2.2",
+ "nyc": "^15.1.0",
"should": "^13.2.3"
+ },
+ "nyc": {
+ "include": [
+ "lib/**"
+ ],
+ "branches": 100,
+ "lines": 100,
+ "functions": 100
}
}
diff --git a/node_modules/date-format/test/date_format-test.js b/node_modules/date-format/test/date_format-test.js
deleted file mode 100644
index 9bb228a..0000000
--- a/node_modules/date-format/test/date_format-test.js
+++ /dev/null
@@ -1,61 +0,0 @@
-'use strict';
-
-require('should');
-
-var dateFormat = require('../lib');
-
-function createFixedDate() {
- return new Date(2010, 0, 11, 14, 31, 30, 5);
-}
-
-describe('date_format', function() {
- var date = createFixedDate();
-
- it('should default to now when a date is not provided', function() {
- dateFormat.asString(dateFormat.DATETIME_FORMAT).should.not.be.empty();
- });
-
- it('should be usable directly without calling asString', function() {
- dateFormat(dateFormat.DATETIME_FORMAT, date).should.eql('11 01 2010 14:31:30.005');
- });
-
- it('should format a date as string using a pattern', function() {
- dateFormat.asString(dateFormat.DATETIME_FORMAT, date).should.eql('11 01 2010 14:31:30.005');
- });
-
- it('should default to the ISO8601 format', function() {
- dateFormat.asString(date).should.eql('2010-01-11T14:31:30.005');
- });
-
- it('should provide a ISO8601 with timezone offset format', function() {
- var tzDate = createFixedDate();
- tzDate.getTimezoneOffset = function () {
- return -660;
- };
-
- // when tz offset is in the pattern, the date should be in local time
- dateFormat.asString(dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT, tzDate)
- .should.eql('2010-01-11T14:31:30.005+1100');
-
- tzDate = createFixedDate();
- tzDate.getTimezoneOffset = function () {
- return 120;
- };
-
- dateFormat.asString(dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT, tzDate)
- .should.eql('2010-01-11T14:31:30.005-0200');
- });
-
- it('should provide a just-the-time format', function() {
- dateFormat.asString(dateFormat.ABSOLUTETIME_FORMAT, date).should.eql('14:31:30.005');
- });
-
- it('should provide a custom format', function() {
- var customDate = createFixedDate();
- customDate.getTimezoneOffset = function () {
- return 120;
- };
-
- dateFormat.asString('O.SSS.ss.mm.hh.dd.MM.yy', customDate).should.eql('-0200.005.30.31.14.11.01.10');
- });
-});
diff --git a/node_modules/date-format/test/parse-test.js b/node_modules/date-format/test/parse-test.js
deleted file mode 100644
index 9f72982..0000000
--- a/node_modules/date-format/test/parse-test.js
+++ /dev/null
@@ -1,220 +0,0 @@
-"use strict";
-
-require("should");
-var dateFormat = require("../lib");
-
-describe("dateFormat.parse", function() {
- it("should require a pattern", function() {
- (function() {
- dateFormat.parse();
- }.should.throw(/pattern must be supplied/));
- (function() {
- dateFormat.parse(null);
- }.should.throw(/pattern must be supplied/));
- (function() {
- dateFormat.parse("");
- }.should.throw(/pattern must be supplied/));
- });
-
- describe("with a pattern that has no replacements", function() {
- it("should return a new date when the string matches", function() {
- dateFormat.parse("cheese", "cheese").should.be.a.Date();
- });
-
- it("should throw if the string does not match", function() {
- (function() {
- dateFormat.parse("cheese", "biscuits");
- }.should.throw(/String 'biscuits' could not be parsed as 'cheese'/));
- });
- });
-
- describe("with a full pattern", function() {
- var pattern = "yyyy-MM-dd hh:mm:ss.SSSO";
-
- it("should return the correct date if the string matches", function() {
- var testDate = new Date();
- testDate.setUTCFullYear(2018);
- testDate.setUTCMonth(8);
- testDate.setUTCDate(13);
- testDate.setUTCHours(18);
- testDate.setUTCMinutes(10);
- testDate.setUTCSeconds(12);
- testDate.setUTCMilliseconds(392);
-
- dateFormat
- .parse(pattern, "2018-09-14 04:10:12.392+1000")
- .getTime()
- .should.eql(testDate.getTime())
- ;
- });
-
- it("should throw if the string does not match", function() {
- (function() {
- dateFormat.parse(pattern, "biscuits");
- }.should.throw(
- /String 'biscuits' could not be parsed as 'yyyy-MM-dd hh:mm:ss.SSSO'/
- ));
- });
- });
-
- describe("with a partial pattern", function() {
- var testDate = new Date();
- dateFormat.now = function() {
- return testDate;
- };
-
- /**
- * If there's no timezone in the format, then we verify against the local date
- */
- function verifyLocalDate(actual, expected) {
- actual.getFullYear().should.eql(expected.year || testDate.getFullYear());
- actual.getMonth().should.eql(expected.month || testDate.getMonth());
- actual.getDate().should.eql(expected.day || testDate.getDate());
- actual.getHours().should.eql(expected.hours || testDate.getHours());
- actual.getMinutes().should.eql(expected.minutes || testDate.getMinutes());
- actual.getSeconds().should.eql(expected.seconds || testDate.getSeconds());
- actual
- .getMilliseconds()
- .should.eql(expected.milliseconds || testDate.getMilliseconds());
- }
-
- /**
- * If a timezone is specified, let's verify against the UTC time it is supposed to be
- */
- function verifyDate(actual, expected) {
- actual.getUTCFullYear().should.eql(expected.year || testDate.getUTCFullYear());
- actual.getUTCMonth().should.eql(expected.month || testDate.getUTCMonth());
- actual.getUTCDate().should.eql(expected.day || testDate.getUTCDate());
- actual.getUTCHours().should.eql(expected.hours || testDate.getUTCHours());
- actual.getUTCMinutes().should.eql(expected.minutes || testDate.getUTCMinutes());
- actual.getUTCSeconds().should.eql(expected.seconds || testDate.getUTCSeconds());
- actual
- .getMilliseconds()
- .should.eql(expected.milliseconds || testDate.getMilliseconds());
- }
-
- it("should return a date with missing values defaulting to current time", function() {
- var date = dateFormat.parse("yyyy-MM", "2015-09");
- verifyLocalDate(date, { year: 2015, month: 8 });
- });
-
- it("should use a passed in date for missing values", function() {
- var missingValueDate = new Date(2010, 1, 8, 22, 30, 12, 100);
- var date = dateFormat.parse("yyyy-MM", "2015-09", missingValueDate);
- verifyLocalDate(date, {
- year: 2015,
- month: 8,
- day: 8,
- hours: 22,
- minutes: 30,
- seconds: 12,
- milliseconds: 100
- });
- });
-
- it("should handle variations on the same pattern", function() {
- var date = dateFormat.parse("MM-yyyy", "09-2015");
- verifyLocalDate(date, { year: 2015, month: 8 });
-
- date = dateFormat.parse("yyyy MM", "2015 09");
- verifyLocalDate(date, { year: 2015, month: 8 });
-
- date = dateFormat.parse("MM, yyyy.", "09, 2015.");
- verifyLocalDate(date, { year: 2015, month: 8 });
- });
-
- describe("should match all the date parts", function() {
- it("works with dd", function() {
- var date = dateFormat.parse("dd", "21");
- verifyLocalDate(date, { day: 21 });
- });
-
- it("works with hh", function() {
- var date = dateFormat.parse("hh", "12");
- verifyLocalDate(date, { hours: 12 });
- });
-
- it("works with mm", function() {
- var date = dateFormat.parse("mm", "34");
- verifyLocalDate(date, { minutes: 34 });
- });
-
- it("works with ss", function() {
- var date = dateFormat.parse("ss", "59");
- verifyLocalDate(date, { seconds: 59 });
- });
-
- it("works with ss.SSS", function() {
- var date = dateFormat.parse("ss.SSS", "23.452");
- verifyLocalDate(date, { seconds: 23, milliseconds: 452 });
- });
-
- it("works with hh:mm O (+1000)", function() {
- var date = dateFormat.parse("hh:mm O", "05:23 +1000");
- verifyDate(date, { hours: 19, minutes: 23 });
- });
-
- it("works with hh:mm O (-200)", function() {
- var date = dateFormat.parse("hh:mm O", "05:23 -200");
- verifyDate(date, { hours: 7, minutes: 23 });
- });
-
- it("works with hh:mm O (+0930)", function() {
- var date = dateFormat.parse("hh:mm O", "05:23 +0930");
- verifyDate(date, { hours: 19, minutes: 53 });
- });
- });
- });
-
- describe("with a date formatted by this library", function() {
- describe("should format and then parse back to the same date", function() {
- function testDateInitWithUTC() {
- var td = new Date();
- td.setUTCFullYear(2018);
- td.setUTCMonth(8);
- td.setUTCDate(13);
- td.setUTCHours(18);
- td.setUTCMinutes(10);
- td.setUTCSeconds(12);
- td.setUTCMilliseconds(392);
- return td;
- }
-
- it("works with ISO8601_WITH_TZ_OFFSET_FORMAT", function() {
- // For this test case to work, the date object must be initialized with
- // UTC timezone
- var td = testDateInitWithUTC();
- var d = dateFormat(dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT, td);
- dateFormat.parse(dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT, d)
- .should.eql(td);
- });
-
- it("works with ISO8601_FORMAT", function() {
- var td = new Date();
- var d = dateFormat(dateFormat.ISO8601_FORMAT, td);
- var actual = dateFormat.parse(dateFormat.ISO8601_FORMAT, d);
- actual.should.eql(td);
- });
-
- it("works with DATETIME_FORMAT", function() {
- var testDate = new Date();
- dateFormat
- .parse(
- dateFormat.DATETIME_FORMAT,
- dateFormat(dateFormat.DATETIME_FORMAT, testDate)
- )
- .should.eql(testDate);
- });
-
- it("works with ABSOLUTETIME_FORMAT", function() {
- var testDate = new Date();
- dateFormat
- .parse(
- dateFormat.ABSOLUTETIME_FORMAT,
- dateFormat(dateFormat.ABSOLUTETIME_FORMAT, testDate)
- )
- .should.eql(testDate);
- });
- });
- });
-});
diff --git a/node_modules/engine.io-parser/CHANGELOG.md b/node_modules/engine.io-parser/CHANGELOG.md
deleted file mode 100644
index 63421c7..0000000
--- a/node_modules/engine.io-parser/CHANGELOG.md
+++ /dev/null
@@ -1,133 +0,0 @@
-## [5.0.2](https://github.com/socketio/engine.io-parser/compare/5.0.1...5.0.2) (2021-11-14)
-
-
-### Bug Fixes
-
-* add package name in nested package.json ([7e27159](https://github.com/socketio/engine.io-parser/commit/7e271596c3305fb4e4a9fbdcc7fd442e8ff71200))
-* fix vite build for CommonJS users ([5f22ed0](https://github.com/socketio/engine.io-parser/commit/5f22ed0527cc80aa0cac415dfd12db2f94f0a855))
-
-
-
-## [5.0.1](https://github.com/socketio/engine.io-parser/compare/5.0.0...5.0.1) (2021-10-15)
-
-
-### Bug Fixes
-
-* fix vite build ([900346e](https://github.com/socketio/engine.io-parser/commit/900346ea34ddc178d80eaabc8ea516d929457855))
-
-
-
-# [5.0.0](https://github.com/socketio/engine.io-parser/compare/4.0.3...5.0.0) (2021-10-04)
-
-This release includes the migration to TypeScript. The major bump is due to the new "exports" field in the package.json file.
-
-See also: https://nodejs.org/api/packages.html#packages_package_entry_points
-
-## [4.0.3](https://github.com/socketio/engine.io-parser/compare/4.0.2...4.0.3) (2021-08-29)
-
-
-### Bug Fixes
-
-* respect the offset and length of TypedArray objects ([6d7dd76](https://github.com/socketio/engine.io-parser/commit/6d7dd76130690afda6c214d5c04305d2bbc4eb4d))
-
-
-## [4.0.2](https://github.com/socketio/engine.io-parser/compare/4.0.1...4.0.2) (2020-12-07)
-
-
-### Bug Fixes
-
-* add base64-arraybuffer as prod dependency ([2ccdeb2](https://github.com/socketio/engine.io-parser/commit/2ccdeb277955bed8742a29f2dcbbf57ca95eb12a))
-
-
-## [2.2.1](https://github.com/socketio/engine.io-parser/compare/2.2.0...2.2.1) (2020-09-30)
-
-
-## [4.0.1](https://github.com/socketio/engine.io-parser/compare/4.0.0...4.0.1) (2020-09-10)
-
-
-### Bug Fixes
-
-* use a terser-compatible representation of the separator ([886f9ea](https://github.com/socketio/engine.io-parser/commit/886f9ea7c4e717573152c31320f6fb6c6664061b))
-
-
-# [4.0.0](https://github.com/socketio/engine.io-parser/compare/v4.0.0-alpha.1...4.0.0) (2020-09-08)
-
-This major release contains the necessary changes for the version 4 of the Engine.IO protocol. More information about the new version can be found [there](https://github.com/socketio/engine.io-protocol#difference-between-v3-and-v4).
-
-Encoding changes between v3 and v4:
-
-- encodePacket with string
- - input: `{ type: "message", data: "hello" }`
- - output in v3: `"4hello"`
- - output in v4: `"4hello"`
-
-- encodePacket with binary
- - input: `{ type: 'message', data: <Buffer 01 02 03> }`
- - output in v3: `<Buffer 04 01 02 03>`
- - output in v4: `<Buffer 01 02 03>`
-
-- encodePayload with strings
- - input: `[ { type: 'message', data: 'hello' }, { type: 'message', data: '€€€' } ]`
- - output in v3: `"6:4hello4:4€€€"`
- - output in v4: `"4hello\x1e4€€€"`
-
-- encodePayload with string and binary
- - input: `[ { type: 'message', data: 'hello' }, { type: 'message', data: <Buffer 01 02 03> } ]`
- - output in v3: `<Buffer 00 06 ff 34 68 65 6c 6c 6f 01 04 ff 04 01 02 03>`
- - output in v4: `"4hello\x1ebAQID"`
-
-Please note that the parser is now dependency-free! This should help reduce the size of the browser bundle.
-
-### Bug Fixes
-
-* keep track of the buffer initial length ([8edf2d1](https://github.com/socketio/engine.io-parser/commit/8edf2d1478026da442f519c2d2521af43ba01832))
-
-
-### Features
-
-* restore the upgrade mechanism ([6efedfa](https://github.com/socketio/engine.io-parser/commit/6efedfa0f3048506a4ba99e70674ddf4c0732e0c))
-
-
-
-# [4.0.0-alpha.1](https://github.com/socketio/engine.io-parser/compare/v4.0.0-alpha.0...v4.0.0-alpha.1) (2020-05-19)
-
-
-### Features
-
-* implement the version 4 of the protocol ([cab7db0](https://github.com/socketio/engine.io-parser/commit/cab7db0404e0a69f86a05ececd62c8c31f4d97d5))
-
-
-
-# [4.0.0-alpha.0](https://github.com/socketio/engine.io-parser/compare/2.2.0...v4.0.0-alpha.0) (2020-02-04)
-
-
-### Bug Fixes
-
-* properly decode binary packets ([5085373](https://github.com/socketio/engine.io-parser/commit/50853738e0c6c16f9cee0d7887651155f4b78240))
-
-
-### Features
-
-* remove packet type when encoding binary packets ([a947ae5](https://github.com/socketio/engine.io-parser/commit/a947ae59a2844e4041db58ff36b270d1528b3bee))
-
-
-### BREAKING CHANGES
-
-* the packet containing binary data will now be sent without any transformation
-
-Protocol v3: { type: 'message', data: <Buffer 01 02 03> } => <Buffer 04 01 02 03>
-Protocol v4: { type: 'message', data: <Buffer 01 02 03> } => <Buffer 01 02 03>
-
-
-
-# [2.2.0](https://github.com/socketio/engine.io-parser/compare/2.1.3...2.2.0) (2019-09-13)
-
-
-* [refactor] Use `Buffer.allocUnsafe` instead of `new Buffer` (#104) ([aedf8eb](https://github.com/socketio/engine.io-parser/commit/aedf8eb29e8bf6aeb5c6cc68965d986c4c958ae2)), closes [#104](https://github.com/socketio/engine.io-parser/issues/104)
-
-
-### BREAKING CHANGES
-
-* drop support for Node.js 4 (since Buffer.allocUnsafe was added in v5.10.0)
-
-Reference: https://nodejs.org/docs/latest/api/buffer.html#buffer_class_method_buffer_allocunsafe_size
diff --git a/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js b/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js
index 9246825..e85a136 100644
--- a/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js
+++ b/node_modules/engine.io-parser/build/cjs/decodePacket.browser.js
@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const commons_js_1 = require("./commons.js");
-const base64_arraybuffer_1 = require("base64-arraybuffer");
+const base64_arraybuffer_1 = require("@socket.io/base64-arraybuffer");
const withNativeArrayBuffer = typeof ArrayBuffer === "function";
const decodePacket = (encodedPacket, binaryType) => {
if (typeof encodedPacket !== "string") {
diff --git a/node_modules/engine.io-parser/build/cjs/decodePacket.js b/node_modules/engine.io-parser/build/cjs/decodePacket.js
index 6d62ba9..2dbe0f8 100644
--- a/node_modules/engine.io-parser/build/cjs/decodePacket.js
+++ b/node_modules/engine.io-parser/build/cjs/decodePacket.js
@@ -38,7 +38,7 @@
return data; // assuming the data is already a Buffer
}
};
-const toArrayBuffer = buffer => {
+const toArrayBuffer = (buffer) => {
const arrayBuffer = new ArrayBuffer(buffer.length);
const view = new Uint8Array(arrayBuffer);
for (let i = 0; i < buffer.length; i++) {
diff --git a/node_modules/engine.io-parser/build/esm/commons.d.ts b/node_modules/engine.io-parser/build/esm/commons.d.ts
index 9c3bde1..b0b0941 100644
--- a/node_modules/engine.io-parser/build/esm/commons.d.ts
+++ b/node_modules/engine.io-parser/build/esm/commons.d.ts
@@ -1,7 +1,15 @@
+/// <reference types="node" />
declare const PACKET_TYPES: any;
declare const PACKET_TYPES_REVERSE: any;
-declare const ERROR_PACKET: {
- type: string;
- data: string;
-};
+declare const ERROR_PACKET: Packet;
export { PACKET_TYPES, PACKET_TYPES_REVERSE, ERROR_PACKET };
+export declare type PacketType = "open" | "close" | "ping" | "pong" | "message" | "upgrade" | "noop" | "error";
+export declare type RawData = string | Buffer | ArrayBuffer | ArrayBufferView | Blob;
+export interface Packet {
+ type: PacketType;
+ options?: {
+ compress: boolean;
+ };
+ data?: RawData;
+}
+export declare type BinaryType = "nodebuffer" | "arraybuffer" | "blob";
diff --git a/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts b/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts
index 8c928e1..e4045d6 100644
--- a/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts
+++ b/node_modules/engine.io-parser/build/esm/decodePacket.browser.d.ts
@@ -1,11 +1,3 @@
-declare const decodePacket: (encodedPacket: any, binaryType: any) => {
- type: string;
- data: any;
-} | {
- type: any;
- data: string;
-} | {
- type: any;
- data?: undefined;
-};
+import { Packet, BinaryType, RawData } from "./commons.js";
+declare const decodePacket: (encodedPacket: RawData, binaryType?: BinaryType) => Packet;
export default decodePacket;
diff --git a/node_modules/engine.io-parser/build/esm/decodePacket.browser.js b/node_modules/engine.io-parser/build/esm/decodePacket.browser.js
index a4c3f64..b1dae76 100644
--- a/node_modules/engine.io-parser/build/esm/decodePacket.browser.js
+++ b/node_modules/engine.io-parser/build/esm/decodePacket.browser.js
@@ -1,5 +1,5 @@
import { ERROR_PACKET, PACKET_TYPES_REVERSE } from "./commons.js";
-import { decode } from "base64-arraybuffer";
+import { decode } from "@socket.io/base64-arraybuffer";
const withNativeArrayBuffer = typeof ArrayBuffer === "function";
const decodePacket = (encodedPacket, binaryType) => {
if (typeof encodedPacket !== "string") {
diff --git a/node_modules/engine.io-parser/build/esm/decodePacket.d.ts b/node_modules/engine.io-parser/build/esm/decodePacket.d.ts
index 9f5ec24..e4045d6 100644
--- a/node_modules/engine.io-parser/build/esm/decodePacket.d.ts
+++ b/node_modules/engine.io-parser/build/esm/decodePacket.d.ts
@@ -1,11 +1,3 @@
-declare const decodePacket: (encodedPacket: any, binaryType?: any) => {
- type: string;
- data: any;
-} | {
- type: any;
- data: string;
-} | {
- type: any;
- data?: undefined;
-};
+import { Packet, BinaryType, RawData } from "./commons.js";
+declare const decodePacket: (encodedPacket: RawData, binaryType?: BinaryType) => Packet;
export default decodePacket;
diff --git a/node_modules/engine.io-parser/build/esm/decodePacket.js b/node_modules/engine.io-parser/build/esm/decodePacket.js
index cf976fd..58ca8eb 100644
--- a/node_modules/engine.io-parser/build/esm/decodePacket.js
+++ b/node_modules/engine.io-parser/build/esm/decodePacket.js
@@ -36,7 +36,7 @@
return data; // assuming the data is already a Buffer
}
};
-const toArrayBuffer = buffer => {
+const toArrayBuffer = (buffer) => {
const arrayBuffer = new ArrayBuffer(buffer.length);
const view = new Uint8Array(arrayBuffer);
for (let i = 0; i < buffer.length; i++) {
diff --git a/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts b/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts
index d0ef015..9ca28c8 100644
--- a/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts
+++ b/node_modules/engine.io-parser/build/esm/encodePacket.browser.d.ts
@@ -1,5 +1,3 @@
-declare const encodePacket: ({ type, data }: {
- type: any;
- data: any;
-}, supportsBinary: any, callback: any) => any;
+import { Packet, RawData } from "./commons.js";
+declare const encodePacket: ({ type, data }: Packet, supportsBinary: boolean, callback: (encodedPacket: RawData) => void) => void;
export default encodePacket;
diff --git a/node_modules/engine.io-parser/build/esm/encodePacket.d.ts b/node_modules/engine.io-parser/build/esm/encodePacket.d.ts
index d0ef015..9ca28c8 100644
--- a/node_modules/engine.io-parser/build/esm/encodePacket.d.ts
+++ b/node_modules/engine.io-parser/build/esm/encodePacket.d.ts
@@ -1,5 +1,3 @@
-declare const encodePacket: ({ type, data }: {
- type: any;
- data: any;
-}, supportsBinary: any, callback: any) => any;
+import { Packet, RawData } from "./commons.js";
+declare const encodePacket: ({ type, data }: Packet, supportsBinary: boolean, callback: (encodedPacket: RawData) => void) => void;
export default encodePacket;
diff --git a/node_modules/engine.io-parser/build/esm/index.d.ts b/node_modules/engine.io-parser/build/esm/index.d.ts
index e610fdd..c912c54 100644
--- a/node_modules/engine.io-parser/build/esm/index.d.ts
+++ b/node_modules/engine.io-parser/build/esm/index.d.ts
@@ -1,6 +1,7 @@
import encodePacket from "./encodePacket.js";
import decodePacket from "./decodePacket.js";
-declare const encodePayload: (packets: any, callback: any) => void;
-declare const decodePayload: (encodedPayload: any, binaryType?: any) => any[];
+import { Packet, PacketType, RawData, BinaryType } from "./commons";
+declare const encodePayload: (packets: Packet[], callback: (encodedPayload: string) => void) => void;
+declare const decodePayload: (encodedPayload: string, binaryType?: BinaryType) => Packet[];
export declare const protocol = 4;
-export { encodePacket, encodePayload, decodePacket, decodePayload };
+export { encodePacket, encodePayload, decodePacket, decodePayload, Packet, PacketType, RawData, BinaryType };
diff --git a/node_modules/engine.io-parser/package.json b/node_modules/engine.io-parser/package.json
index cb80112..cd8def4 100644
--- a/node_modules/engine.io-parser/package.json
+++ b/node_modules/engine.io-parser/package.json
@@ -2,7 +2,7 @@
"name": "engine.io-parser",
"description": "Parser for the client for the realtime Engine",
"license": "MIT",
- "version": "5.0.2",
+ "version": "5.0.3",
"main": "./build/cjs/index.js",
"module": "./build/esm/index.js",
"exports": {
@@ -31,7 +31,7 @@
"zuul-ngrok": "4.0.0"
},
"dependencies": {
- "base64-arraybuffer": "~1.0.1"
+ "@socket.io/base64-arraybuffer": "~1.0.2"
},
"scripts": {
"compile": "rimraf ./build && tsc && tsc -p tsconfig.esm.json && ./postcompile.sh",
diff --git a/node_modules/engine.io/CHANGELOG.md b/node_modules/engine.io/CHANGELOG.md
deleted file mode 100644
index 57d5b61..0000000
--- a/node_modules/engine.io/CHANGELOG.md
+++ /dev/null
@@ -1,323 +0,0 @@
-# [6.1.0](https://github.com/socketio/engine.io/compare/6.0.0...6.1.0) (2021-11-08)
-
-
-### Bug Fixes
-
-* fix payload encoding for v3 clients ([ed50fc3](https://github.com/socketio/engine.io/commit/ed50fc346b9c58459bf4e6fe5c45e8d34faac8da))
-
-
-### Features
-
-* add an implementation based on uWebSockets.js ([271e2df](https://github.com/socketio/engine.io/commit/271e2df94d39bbd13c33cab98cdd5915f9d28536))
-
-
-### Performance Improvements
-
-* refresh ping timer ([#628](https://github.com/socketio/engine.io/issues/628)) ([37474c7](https://github.com/socketio/engine.io/commit/37474c7e67be7c5f25f9ca2d4ea99f3a256bd2de))
-
-
-
-## [6.0.1](https://github.com/socketio/engine.io/compare/6.0.0...6.0.1) (2021-11-06)
-
-
-### Bug Fixes
-
-* fix payload encoding for v3 clients ([3f42262](https://github.com/socketio/engine.io/commit/3f42262fd27a77a7383cdbb44ede7c6211a9782b))
-
-
-
-# [6.0.0](https://github.com/socketio/engine.io/compare/5.2.0...6.0.0) (2021-10-08)
-
-The codebase was migrated to TypeScript ([c0d6eaa](https://github.com/socketio/engine.io/commit/c0d6eaa1ba1291946dc8425d5f533d5f721862dd))
-
-An ES module wrapper was also added ([401f4b6](https://github.com/socketio/engine.io/commit/401f4b60693fb6702c942692ce42e5bb701d81d7)).
-
-Please note that the communication protocol was not updated, so a v5 client will be able to reach a v6 server (and vice-versa).
-
-Reference: https://github.com/socketio/engine.io-protocol
-
-### BREAKING CHANGES
-
-- the default export was removed, so the following code won't work anymore:
-
-```js
-const eioServer = require("engine.io")(httpServer);
-```
-
-Please use this instead:
-
-```js
-const { Server } = require("engine.io");
-const eioServer = new Server(httpServer);
-```
-
-### Dependencies
-
-`ws` version: `~8.2.3` (bumped from `~7.4.2`)
-
-# [5.2.0](https://github.com/socketio/engine.io/compare/5.1.1...5.2.0) (2021-08-29)
-
-No change on the server-side, this matches the client release.
-
-
-## [5.1.1](https://github.com/socketio/engine.io/compare/5.1.0...5.1.1) (2021-05-16)
-
-
-### Bug Fixes
-
-* properly close the websocket connection upon handshake error ([4360686](https://github.com/socketio/engine.io/commit/43606865e5299747cbb31f3ed9baf4567502a879))
-
-
-# [5.1.0](https://github.com/socketio/engine.io/compare/5.0.0...5.1.0) (2021-05-04)
-
-
-### Features
-
-* add a "connection_error" event ([7096e98](https://github.com/socketio/engine.io/commit/7096e98a02295a62c8ea2aa56461d4875887092d))
-* add the "initial_headers" and "headers" events ([2527543](https://github.com/socketio/engine.io/commit/252754353a0e88eb036ebb3082e9d6a9a5f497db))
-
-
-### Performance Improvements
-
-* **websocket:** add a "wsPreEncoded" writing option ([7706b12](https://github.com/socketio/engine.io/commit/7706b123df914777d19c8179b45ab6932f82916c))
-* **websocket:** fix write back-pressure ([#618](https://github.com/socketio/engine.io/issues/618)) ([ad5306a](https://github.com/socketio/engine.io/commit/ad5306aeaedf06ac7a49f791e1b76e55c35a564e))
-
-
-# [5.0.0](https://github.com/socketio/engine.io/compare/4.1.1...5.0.0) (2021-03-10)
-
-
-### Bug Fixes
-
-* set default protocol version to 3 ([#616](https://github.com/socketio/engine.io/issues/616)) ([868d891](https://github.com/socketio/engine.io/commit/868d89111de0ab5bd0e147ecaff7983afbf5d087))
-
-
-### Features
-
-* increase the default value of pingTimeout ([5a7fa13](https://github.com/socketio/engine.io/commit/5a7fa132c442bc1e7eefa1cf38168ee951575ded))
-* remove dynamic require() with wsEngine ([edb7343](https://github.com/socketio/engine.io/commit/edb734316f143bf0f1bbc344e966d18e2676b934))
-
-
-### BREAKING CHANGES
-
-* the syntax of the "wsEngine" option is updated
-
-Before:
-
-```js
-const eioServer = require("engine.io")(httpServer, {
- wsEngine: "eiows"
-});
-```
-
-After:
-
-```js
-const eioServer = require("engine.io")(httpServer, {
- wsEngine: require("eiows").Server
-});
-```
-
-
-## [4.1.1](https://github.com/socketio/engine.io/compare/4.1.0...4.1.1) (2021-02-02)
-
-
-### Bug Fixes
-
-* do not reset the ping timer after upgrade ([ff2b8ab](https://github.com/socketio/engine.io/commit/ff2b8aba48ebcb0de5626d3b76fddc94c398395f)), closes [/github.com/socketio/socket.io-client-swift/pull/1309#issuecomment-768475704](https://github.com//github.com/socketio/socket.io-client-swift/pull/1309/issues/issuecomment-768475704)
-
-
-# [4.1.0](https://github.com/socketio/engine.io/compare/4.0.6...4.1.0) (2021-01-14)
-
-
-### Features
-
-* add support for v3.x clients ([663d326](https://github.com/socketio/engine.io/commit/663d326d18de598318bd2120b2b70cd51adf8955))
-
-
-## [4.0.6](https://github.com/socketio/engine.io/compare/4.0.5...4.0.6) (2021-01-04)
-
-
-### Bug Fixes
-
-* correctly pass the options when using the Server constructor ([#610](https://github.com/socketio/engine.io/issues/610)) ([cec2750](https://github.com/socketio/engine.io/commit/cec27502f5b55c8a2ff289db34019629bf6a97ca))
-
-
-
-# [3.5.0](https://github.com/socketio/engine.io/compare/3.4.2...3.5.0) (2020-12-30)
-
-
-### Features
-
-* add support for all cookie options ([19cc582](https://github.com/socketio/engine.io/commit/19cc58264a06dca47ed401fbaca32dcdb80a903b)), closes [/github.com/jshttp/cookie#options-1](https://github.com//github.com/jshttp/cookie/issues/options-1)
-* disable perMessageDeflate by default ([5ad2736](https://github.com/socketio/engine.io/commit/5ad273601eb66c7b318542f87026837bf9dddd21))
-
-
-
-## [4.0.5](https://github.com/socketio/engine.io/compare/4.0.4...4.0.5) (2020-12-07)
-
-No change on the server-side, this matches the client release.
-
-## [4.0.4](https://github.com/socketio/engine.io/compare/4.0.3...4.0.4) (2020-11-17)
-
-No change on the server-side, this matches the client release.
-
-## [4.0.3](https://github.com/socketio/engine.io/compare/4.0.2...4.0.3) (2020-11-17)
-
-No change on the server-side, this matches the client release.
-
-## [4.0.2](https://github.com/socketio/engine.io/compare/4.0.1...4.0.2) (2020-11-09)
-
-
-### Bug Fixes
-
-* add extension in the package.json main entry ([#608](https://github.com/socketio/engine.io/issues/608)) ([17b8c2f](https://github.com/socketio/engine.io/commit/17b8c2f199e7a307b6d6294b8599abacb3ec56e7))
-
-
-## [4.0.1](https://github.com/socketio/engine.io/compare/4.0.0...4.0.1) (2020-10-21)
-
-
-### Bug Fixes
-
-* do not overwrite CORS headers upon error ([fe093ba](https://github.com/socketio/engine.io/commit/fe093bae1adce99e01dfdd3ce7542957785098b5))
-
-
-
-# [4.0.0](https://github.com/socketio/engine.io/compare/v4.0.0-alpha.1...4.0.0) (2020-09-10)
-
-More details about this release in the blog post: https://socket.io/blog/engine-io-4-release/
-
-### Bug Fixes
-
-* ignore errors when forcefully closing the socket ([#601](https://github.com/socketio/engine.io/issues/601)) ([dcdbccb](https://github.com/socketio/engine.io/commit/dcdbccb3dd8a7b7db057d23925356034fcd35d48))
-* remove implicit require of uws ([82cdca2](https://github.com/socketio/engine.io/commit/82cdca23bab0ed69b61b60961900d456a3065e6a))
-
-
-### Features
-
-* disable perMessageDeflate by default ([078527a](https://github.com/socketio/engine.io/commit/078527a384b70dc46d99083fa218be5d45213e51))
-
-#### Links
-
-- Diff: [v4.0.0-alpha.1...4.0.0](https://github.com/socketio/engine.io/compare/v4.0.0-alpha.1...4.0.0)
-- Full diff: [3.4.0...4.0.0](https://github.com/socketio/engine.io/compare/3.4.0...4.0.0)
-- Client release: [4.0.0](https://github.com/socketio/engine.io-client/releases/tag/4.0.0)
-- ws version: [^7.1.2](https://github.com/websockets/ws/releases/tag/7.1.2)
-
-
-## [3.4.2](https://github.com/socketio/engine.io/compare/3.4.1...3.4.2) (2020-06-04)
-
-
-### Bug Fixes
-
-* remove explicit require of uws ([85e544a](https://github.com/socketio/engine.io/commit/85e544afd95a5890761a613263a5eba0c9a18a93))
-
-#### Links
-
-- Diff: [3.4.1...3.4.2](https://github.com/socketio/engine.io/compare/3.4.1...3.4.2)
-- Client release: -
-- ws version: [^7.1.2](https://github.com/websockets/ws/releases/tag/7.1.2)
-
-
-
-## [3.4.1](https://github.com/socketio/engine.io/compare/3.4.0...3.4.1) (2020-04-17)
-
-
-### Bug Fixes
-
-* ignore errors when forcefully closing the socket ([da851ec](https://github.com/socketio/engine.io/commit/da851ec4ec89d96df2ee5c711f328b5d795423e9))
-* use SameSite=Strict by default ([001ca62](https://github.com/socketio/engine.io/commit/001ca62cc4a8f511f3b2fbd9e4493ad274a6a0e5))
-
-#### Links
-
-- Diff: [3.4.0...3.4.1](https://github.com/socketio/engine.io/compare/3.4.0...3.4.1)
-- Client release: [3.4.1](https://github.com/socketio/engine.io-client/releases/tag/3.4.1)
-- ws version: [^7.1.2](https://github.com/websockets/ws/releases/tag/7.1.2)
-
-
-
-# [4.0.0-alpha.1](https://github.com/socketio/engine.io/compare/v4.0.0-alpha.0...v4.0.0-alpha.1) (2020-02-12)
-
-#### Links
-
-- Diff: [v4.0.0-alpha.0...v4.0.0-alpha.1](https://github.com/socketio/engine.io-client/compare/v4.0.0-alpha.0...v4.0.0-alpha.1)
-- Client release: [v4.0.0-alpha.1](https://github.com/socketio/engine.io-client/releases/tag/v4.0.0-alpha.1)
-- ws version: [^7.1.2](https://github.com/websockets/ws/releases/tag/7.1.2)
-
-
-
-# [4.0.0-alpha.0](https://github.com/socketio/engine.io/compare/3.4.0...v4.0.0-alpha.0) (2020-02-12)
-
-
-### Features
-
-* decrease the default value of maxHttpBufferSize ([734f9d1](https://github.com/socketio/engine.io/commit/734f9d1268840722c41219e69eb58318e0b2ac6b))
-* disable cookie by default and add sameSite attribute ([a374471](https://github.com/socketio/engine.io/commit/a374471d06e3681a769766a1d068898182f9305f)), closes [/github.com/jshttp/cookie#options-1](https://github.com//github.com/jshttp/cookie/issues/options-1)
-* generateId method can now return a Promise ([f3c291f](https://github.com/socketio/engine.io/commit/f3c291fa613a9d50c924d74293035737fdace4f2))
-* reverse the ping-pong mechanism ([31ff875](https://github.com/socketio/engine.io/commit/31ff87593f231b86dc47ec5761936439ebd53c20))
-* use the cors module to handle cross-origin requests ([61b9492](https://github.com/socketio/engine.io/commit/61b949259ed966ef6fc8bfd61f14d1a2ef06d319))
-
-
-### BREAKING CHANGES
-
-* the handlePreflightRequest option is removed by the change.
-
-Before:
-
-```
-new Server({
- handlePreflightRequest: (req, res) => {
- res.writeHead(200, {
- "Access-Control-Allow-Origin": 'https://example.com',
- "Access-Control-Allow-Methods": 'GET',
- "Access-Control-Allow-Headers": 'Authorization',
- "Access-Control-Allow-Credentials": true
- });
- res.end();
- }
-})
-```
-
-After:
-
-```
-new Server({
- cors: {
- origin: "https://example.com",
- methods: ["GET"],
- allowedHeaders: ["Authorization"],
- credentials: true
- }
-})
-```
-* the syntax has changed from
-
-```
-new Server({
- cookieName: "test",
- cookieHttpOnly: false,
- cookiePath: "/custom"
-})
-```
-
-to
-
-```
-new Server({
- cookie: {
- name: "test",
- httpOnly: false,
- path: "/custom"
- }
-})
-```
-
-All other options (domain, maxAge, sameSite, ...) are now supported.
-
-* v3.x clients will not be able to connect anymore (they will send a ping packet and timeout while waiting for a pong packet).
-
-#### Links
-
-- Diff: [3.4.0...v4.0.0-alpha.0](https://github.com/socketio/engine.io-client/compare/3.4.0...v4.0.0-alpha.0)
-- Client release: [v4.0.0-alpha.0](https://github.com/socketio/engine.io-client/releases/tag/v4.0.0-alpha.0)
-- ws version: [^7.1.2](https://github.com/websockets/ws/releases/tag/7.1.2)
-
diff --git a/node_modules/engine.io/build/server.d.ts b/node_modules/engine.io/build/server.d.ts
index 46d8070..8284787 100644
--- a/node_modules/engine.io/build/server.d.ts
+++ b/node_modules/engine.io/build/server.d.ts
@@ -2,7 +2,7 @@
import { EventEmitter } from "events";
import { IncomingMessage, Server as HttpServer } from "http";
import { CookieSerializeOptions } from "cookie";
-import { CorsOptions } from "cors";
+import { CorsOptions, CorsOptionsDelegate } from "cors";
declare type Transport = "polling" | "websocket";
export interface AttachOptions {
/**
@@ -92,7 +92,7 @@
/**
* the options that will be forwarded to the cors module
*/
- cors?: CorsOptions;
+ cors?: CorsOptions | CorsOptionsDelegate;
/**
* whether to enable compatibility with Socket.IO v2 clients
* @default false
diff --git a/node_modules/engine.io/build/server.js b/node_modules/engine.io/build/server.js
index f03ed0f..52cb46f 100644
--- a/node_modules/engine.io/build/server.js
+++ b/node_modules/engine.io/build/server.js
@@ -117,6 +117,12 @@
method: req.method
});
}
+ if (transport === "websocket" && !upgrade) {
+ debug("invalid transport upgrade");
+ return fn(Server.errors.BAD_REQUEST, {
+ name: "TRANSPORT_HANDSHAKE_ERROR"
+ });
+ }
if (!this.opts.allowRequest)
return fn();
return this.opts.allowRequest(req, (message, success) => {
@@ -441,8 +447,6 @@
}
}
else {
- // transport error handling takes over
- websocket.removeListener("error", onUpgradeError);
const closeConnection = (errorCode, errorContext) => abortUpgrade(socket, errorCode, errorContext);
this.handshake(req._query.transport, req, closeConnection);
}
diff --git a/node_modules/engine.io/build/socket.d.ts b/node_modules/engine.io/build/socket.d.ts
index 9f952f7..d35d7e2 100644
--- a/node_modules/engine.io/build/socket.d.ts
+++ b/node_modules/engine.io/build/socket.d.ts
@@ -96,7 +96,7 @@
/**
* Sends a message packet.
*
- * @param {String} message
+ * @param {Object} data
* @param {Object} options
* @param {Function} callback
* @return {Socket} for chaining
@@ -107,9 +107,11 @@
/**
* Sends a packet.
*
- * @param {String} packet type
- * @param {String} optional, data
+ * @param {String} type - packet type
+ * @param {String} data
* @param {Object} options
+ * @param {Function} callback
+ *
* @api private
*/
private sendPacket;
diff --git a/node_modules/engine.io/build/socket.js b/node_modules/engine.io/build/socket.js
index 1c75488..095a72b 100644
--- a/node_modules/engine.io/build/socket.js
+++ b/node_modules/engine.io/build/socket.js
@@ -3,6 +3,7 @@
exports.Socket = void 0;
const events_1 = require("events");
const debug_1 = require("debug");
+const timers_1 = require("timers");
const debug = (0, debug_1.default)("engine:socket");
class Socket extends events_1.EventEmitter {
/**
@@ -133,7 +134,7 @@
* @api private
*/
schedulePing() {
- this.pingIntervalTimer = setTimeout(() => {
+ this.pingIntervalTimer = (0, timers_1.setTimeout)(() => {
debug("writing ping packet - expecting pong within %sms", this.server.opts.pingTimeout);
this.sendPacket("ping");
this.resetPingTimeout(this.server.opts.pingTimeout);
@@ -145,8 +146,8 @@
* @api private
*/
resetPingTimeout(timeout) {
- clearTimeout(this.pingTimeoutTimer);
- this.pingTimeoutTimer = setTimeout(() => {
+ (0, timers_1.clearTimeout)(this.pingTimeoutTimer);
+ this.pingTimeoutTimer = (0, timers_1.setTimeout)(() => {
if (this.readyState === "closed")
return;
this.onClose("ping timeout");
@@ -187,7 +188,7 @@
debug('might upgrade socket transport from "%s" to "%s"', this.transport.name, transport.name);
this.upgrading = true;
// set transport upgrade timer
- this.upgradeTimeoutTimer = setTimeout(() => {
+ this.upgradeTimeoutTimer = (0, timers_1.setTimeout)(() => {
debug("client did not complete upgrade - closing transport");
cleanup();
if ("open" === transport.readyState) {
@@ -233,7 +234,7 @@
this.upgrading = false;
clearInterval(this.checkIntervalTimer);
this.checkIntervalTimer = null;
- clearTimeout(this.upgradeTimeoutTimer);
+ (0, timers_1.clearTimeout)(this.upgradeTimeoutTimer);
this.upgradeTimeoutTimer = null;
transport.removeListener("packet", onPacket);
transport.removeListener("close", onTransportClose);
@@ -275,7 +276,7 @@
});
// ensure transport won't stay open
this.transport.close();
- clearTimeout(this.pingTimeoutTimer);
+ (0, timers_1.clearTimeout)(this.pingTimeoutTimer);
}
/**
* Called upon transport considered closed.
@@ -286,11 +287,11 @@
if ("closed" !== this.readyState) {
this.readyState = "closed";
// clear timers
- clearTimeout(this.pingIntervalTimer);
- clearTimeout(this.pingTimeoutTimer);
+ (0, timers_1.clearTimeout)(this.pingIntervalTimer);
+ (0, timers_1.clearTimeout)(this.pingTimeoutTimer);
clearInterval(this.checkIntervalTimer);
this.checkIntervalTimer = null;
- clearTimeout(this.upgradeTimeoutTimer);
+ (0, timers_1.clearTimeout)(this.upgradeTimeoutTimer);
// clean writeBuffer in next tick, so developers can still
// grab the writeBuffer on 'close' event
process.nextTick(() => {
@@ -336,7 +337,7 @@
/**
* Sends a message packet.
*
- * @param {String} message
+ * @param {Object} data
* @param {Object} options
* @param {Function} callback
* @return {Socket} for chaining
@@ -353,9 +354,11 @@
/**
* Sends a packet.
*
- * @param {String} packet type
- * @param {String} optional, data
+ * @param {String} type - packet type
+ * @param {String} data
* @param {Object} options
+ * @param {Function} callback
+ *
* @api private
*/
sendPacket(type, data, options, callback) {
@@ -368,8 +371,8 @@
if ("closing" !== this.readyState && "closed" !== this.readyState) {
debug('sending packet "%s" (%s)', type, data);
const packet = {
- type: type,
- options: options
+ type,
+ options
};
if (data)
packet.data = data;
diff --git a/node_modules/engine.io/build/transport.d.ts b/node_modules/engine.io/build/transport.d.ts
index bcfe0dd..dba2740 100644
--- a/node_modules/engine.io/build/transport.d.ts
+++ b/node_modules/engine.io/build/transport.d.ts
@@ -1,6 +1,7 @@
/// <reference types="node" />
import { EventEmitter } from "events";
import { IncomingMessage } from "http";
+import { Packet } from "engine.io-parser";
export declare abstract class Transport extends EventEmitter {
sid: string;
writable: boolean;
@@ -54,7 +55,7 @@
* @param {Object} packet
* @api protected
*/
- protected onPacket(packet: any): void;
+ protected onPacket(packet: Packet): void;
/**
* Called with the encoded packet data.
*
diff --git a/node_modules/engine.io/build/transports-uws/polling.d.ts b/node_modules/engine.io/build/transports-uws/polling.d.ts
index 3a74e94..1709d4e 100644
--- a/node_modules/engine.io/build/transports-uws/polling.d.ts
+++ b/node_modules/engine.io/build/transports-uws/polling.d.ts
@@ -41,6 +41,12 @@
*/
onDataRequest(req: any, res: any): void;
/**
+ * Cleanup request.
+ *
+ * @api private
+ */
+ private onDataRequestCleanup;
+ /**
* Processes the incoming data payload.
*
* @param {String} encoded payload
diff --git a/node_modules/engine.io/build/transports-uws/polling.js b/node_modules/engine.io/build/transports-uws/polling.js
index ece8ae4..1513e37 100644
--- a/node_modules/engine.io/build/transports-uws/polling.js
+++ b/node_modules/engine.io/build/transports-uws/polling.js
@@ -98,53 +98,80 @@
res.end();
return;
}
+ const expectedContentLength = Number(req.headers["content-length"]);
+ if (!expectedContentLength) {
+ this.onError("content-length header required");
+ res.writeStatus("411 Length Required").end();
+ return;
+ }
+ if (expectedContentLength > this.maxHttpBufferSize) {
+ this.onError("payload too large");
+ res.writeStatus("413 Payload Too Large").end();
+ return;
+ }
const isBinary = "application/octet-stream" === req.headers["content-type"];
if (isBinary && this.protocol === 4) {
return this.onError("invalid content");
}
this.dataReq = req;
this.dataRes = res;
- let chunks = [];
- let contentLength = 0;
- const cleanup = () => {
- this.dataReq = this.dataRes = chunks = null;
- };
- const onClose = () => {
- cleanup();
- this.onError("data request connection closed prematurely");
- };
+ let buffer;
+ let offset = 0;
const headers = {
// text/html is required instead of text/plain to avoid an
// unwanted download dialog on certain user-agents (GH-43)
"Content-Type": "text/html"
};
this.headers(req, headers);
- Object.keys(headers).forEach(key => {
+ for (let key in headers) {
res.writeHeader(key, String(headers[key]));
- });
- const onEnd = () => {
- this.onData(Buffer.concat(chunks).toString());
- if (this.readyState !== "closing") {
- res.end("ok");
- }
- cleanup();
+ }
+ const onEnd = buffer => {
+ this.onData(buffer.toString());
+ this.onDataRequestCleanup();
+ res.end("ok");
};
- res.onAborted(onClose);
- res.onData((chunk, isLast) => {
- chunks.push(Buffer.from(chunk));
- contentLength += Buffer.byteLength(chunk);
- if (contentLength > this.maxHttpBufferSize) {
- this.onError("payload too large");
- res.writeStatus("413 Payload Too Large");
- res.end();
+ res.onAborted(() => {
+ this.onDataRequestCleanup();
+ this.onError("data request connection closed prematurely");
+ });
+ res.onData((arrayBuffer, isLast) => {
+ const totalLength = offset + arrayBuffer.byteLength;
+ if (totalLength > expectedContentLength) {
+ this.onError("content-length mismatch");
+ res.close(); // calls onAborted
return;
}
- if (isLast) {
- onEnd();
+ if (!buffer) {
+ if (isLast) {
+ onEnd(Buffer.from(arrayBuffer));
+ return;
+ }
+ buffer = Buffer.allocUnsafe(expectedContentLength);
}
+ Buffer.from(arrayBuffer).copy(buffer, offset);
+ if (isLast) {
+ if (totalLength != expectedContentLength) {
+ this.onError("content-length mismatch");
+ res.writeStatus("400 Content-Length Mismatch").end();
+ this.onDataRequestCleanup();
+ return;
+ }
+ onEnd(buffer);
+ return;
+ }
+ offset = totalLength;
});
}
/**
+ * Cleanup request.
+ *
+ * @api private
+ */
+ onDataRequestCleanup() {
+ this.dataReq = this.dataRes = null;
+ }
+ /**
* Processes the incoming data payload.
*
* @param {String} encoded payload
diff --git a/node_modules/engine.io/build/userver.d.ts b/node_modules/engine.io/build/userver.d.ts
index bab77b9..9cc615a 100644
--- a/node_modules/engine.io/build/userver.d.ts
+++ b/node_modules/engine.io/build/userver.d.ts
@@ -1,4 +1,21 @@
import { AttachOptions, BaseServer } from "./server";
+export interface uOptions {
+ /**
+ * What permessage-deflate compression to use. uWS.DISABLED, uWS.SHARED_COMPRESSOR or any of the uWS.DEDICATED_COMPRESSOR_xxxKB.
+ * @default uWS.DISABLED
+ */
+ compression?: number;
+ /**
+ * Maximum amount of seconds that may pass without sending or getting a message. Connection is closed if this timeout passes. Resolution (granularity) for timeouts are typically 4 seconds, rounded to closest. Disable by using 0.
+ * @default 120
+ */
+ idleTimeout?: number;
+ /**
+ * Maximum length of allowed backpressure per socket when publishing or sending messages. Slow receivers with too high backpressure will be skipped until they catch up or timeout.
+ * @default 1024 * 1024
+ */
+ maxBackpressure?: number;
+}
export declare class uServer extends BaseServer {
protected init(): void;
protected cleanup(): void;
@@ -14,7 +31,7 @@
* @param app
* @param options
*/
- attach(app: any, options?: AttachOptions): void;
+ attach(app: any, options?: AttachOptions & uOptions): void;
private handleRequest;
private handleUpgrade;
private abortRequest;
diff --git a/node_modules/engine.io/build/userver.js b/node_modules/engine.io/build/userver.js
index 0a302e3..ad42fde 100644
--- a/node_modules/engine.io/build/userver.js
+++ b/node_modules/engine.io/build/userver.js
@@ -24,6 +24,9 @@
req.connection = {
remoteAddress: Buffer.from(res.getRemoteAddressAsText()).toString()
};
+ res.onAborted(() => {
+ debug("response has been aborted");
+ });
}
createTransport(transportName, req) {
return new transports_uws_1.default[transportName](req);
@@ -39,6 +42,9 @@
.any(path, this.handleRequest.bind(this))
//
.ws(path, {
+ compression: options.compression,
+ idleTimeout: options.idleTimeout,
+ maxBackpressure: options.maxBackpressure,
maxPayloadLength: this.opts.maxHttpBufferSize,
upgrade: this.handleUpgrade.bind(this),
open: ws => {
@@ -197,6 +203,9 @@
}
this.res.end(data);
}
+ onData(fn) {
+ this.res.onData(fn);
+ }
onAborted(fn) {
this.res.onAborted(fn);
}
diff --git a/node_modules/engine.io/package.json b/node_modules/engine.io/package.json
index 72d5fbd..4ec3901 100644
--- a/node_modules/engine.io/package.json
+++ b/node_modules/engine.io/package.json
@@ -1,6 +1,6 @@
{
"name": "engine.io",
- "version": "6.1.0",
+ "version": "6.1.3",
"description": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server",
"type": "commonjs",
"main": "./build/engine.io.js",
@@ -39,7 +39,7 @@
"cookie": "~0.4.1",
"cors": "~2.8.5",
"debug": "~4.3.1",
- "engine.io-parser": "~5.0.0",
+ "engine.io-parser": "~5.0.3",
"ws": "~8.2.3"
},
"devDependencies": {
diff --git a/node_modules/esbuild-linux-64/README.md b/node_modules/esbuild-linux-64/README.md
new file mode 100644
index 0000000..b2f1930
--- /dev/null
+++ b/node_modules/esbuild-linux-64/README.md
@@ -0,0 +1,3 @@
+# esbuild
+
+This is the Linux 64-bit binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild for details.
diff --git a/node_modules/esbuild-linux-64/bin/esbuild b/node_modules/esbuild-linux-64/bin/esbuild
new file mode 100755
index 0000000..ec42b87
--- /dev/null
+++ b/node_modules/esbuild-linux-64/bin/esbuild
Binary files differ
diff --git a/node_modules/esbuild-linux-64/package.json b/node_modules/esbuild-linux-64/package.json
new file mode 100644
index 0000000..f0ca7e6
--- /dev/null
+++ b/node_modules/esbuild-linux-64/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "esbuild-linux-64",
+ "version": "0.14.13",
+ "description": "The Linux 64-bit binary for esbuild, a JavaScript bundler.",
+ "repository": "https://github.com/evanw/esbuild",
+ "license": "MIT",
+ "preferUnplugged": false,
+ "os": [
+ "linux"
+ ],
+ "cpu": [
+ "x64"
+ ]
+}
diff --git a/node_modules/flat-cache/node_modules/flatted/.github/FUNDING.yml b/node_modules/flat-cache/node_modules/flatted/.github/FUNDING.yml
deleted file mode 100644
index d53abd3..0000000
--- a/node_modules/flat-cache/node_modules/flatted/.github/FUNDING.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-# These are supported funding model platforms
-
-github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
-patreon: # not working due missing www.
-open_collective: #
-ko_fi: # Replace with a single Ko-fi username
-tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
-custom: https://www.patreon.com/webreflection
diff --git a/node_modules/flat-cache/node_modules/flatted/LICENSE b/node_modules/flat-cache/node_modules/flatted/LICENSE
deleted file mode 100644
index 506dc47..0000000
--- a/node_modules/flat-cache/node_modules/flatted/LICENSE
+++ /dev/null
@@ -1,15 +0,0 @@
-ISC License
-
-Copyright (c) 2018-2020, Andrea Giammarchi, @WebReflection
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
diff --git a/node_modules/flat-cache/node_modules/flatted/README.md b/node_modules/flat-cache/node_modules/flatted/README.md
deleted file mode 100644
index 2e466b6..0000000
--- a/node_modules/flat-cache/node_modules/flatted/README.md
+++ /dev/null
@@ -1,111 +0,0 @@
-# flatted
-
-[](https://www.npmjs.com/package/flatted) [](https://coveralls.io/github/WebReflection/flatted?branch=main) [](https://travis-ci.com/WebReflection/flatted) [](https://opensource.org/licenses/ISC) 
-
-
-
-<sup>**Social Media Photo by [Matt Seymour](https://unsplash.com/@mattseymour) on [Unsplash](https://unsplash.com/)**</sup>
-
-## Announcement 📣
-
-There is a standard approach to recursion and more data-types than what JSON allows, and it's part of the [Structured Clone polyfill](https://github.com/ungap/structured-clone/#readme).
-
-Beside acting as a polyfill, its `@ungap/structured-clone/json` export provides both `stringify` and `parse`, and it's been tested for being faster than *flatted*, but its produced output is also smaller than *flatted* in general.
-
-The *@ungap/structured-clone* module is, in short, a drop in replacement for *flatted*, but it's not compatible with *flatted* specialized syntax.
-
-However, if recursion, as well as more data-types, are what you are after, or interesting for your projects/use cases, consider switching to this new module whenever you can 👍
-
-- - -
-
-A super light (0.5K) and fast circular JSON parser, directly from the creator of [CircularJSON](https://github.com/WebReflection/circular-json/#circularjson).
-
-Now available also for **[PHP](./php/flatted.php)**.
-
-```js
-npm i flatted
-```
-
-Usable via [CDN](https://unpkg.com/flatted) or as regular module.
-
-```js
-// ESM
-import {parse, stringify, toJSON, fromJSON} from 'flatted';
-
-// CJS
-const {parse, stringify, toJSON, fromJSON} = require('flatted');
-
-const a = [{}];
-a[0].a = a;
-a.push(a);
-
-stringify(a); // [["1","0"],{"a":"0"}]
-```
-
-## toJSON and fromJSON
-
-If you'd like to implicitly survive JSON serialization, these two helpers helps:
-
-```js
-import {toJSON, fromJSON} from 'flatted';
-
-class RecursiveMap extends Map {
- static fromJSON(any) {
- return new this(fromJSON(any));
- }
- toJSON() {
- return toJSON([...this.entries()]);
- }
-}
-
-const recursive = new RecursiveMap;
-const same = {};
-same.same = same;
-recursive.set('same', same);
-
-const asString = JSON.stringify(recursive);
-const asMap = RecursiveMap.fromJSON(JSON.parse(asString));
-asMap.get('same') === asMap.get('same').same;
-// true
-```
-
-
-## Flatted VS JSON
-
-As it is for every other specialized format capable of serializing and deserializing circular data, you should never `JSON.parse(Flatted.stringify(data))`, and you should never `Flatted.parse(JSON.stringify(data))`.
-
-The only way this could work is to `Flatted.parse(Flatted.stringify(data))`, as it is also for _CircularJSON_ or any other, otherwise there's no granted data integrity.
-
-Also please note this project serializes and deserializes only data compatible with JSON, so that sockets, or anything else with internal classes different from those allowed by JSON standard, won't be serialized and unserialized as expected.
-
-
-### New in V1: Exact same JSON API
-
- * Added a [reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Syntax) parameter to `.parse(string, reviver)` and revive your own objects.
- * Added a [replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Syntax) and a `space` parameter to `.stringify(object, replacer, space)` for feature parity with JSON signature.
-
-
-### Compatibility
-All ECMAScript engines compatible with `Map`, `Set`, `Object.keys`, and `Array.prototype.reduce` will work, even if polyfilled.
-
-
-### How does it work ?
-While stringifying, all Objects, including Arrays, and strings, are flattened out and replaced as unique index. `*`
-
-Once parsed, all indexes will be replaced through the flattened collection.
-
-<sup><sub>`*` represented as string to avoid conflicts with numbers</sub></sup>
-
-```js
-// logic example
-var a = [{one: 1}, {two: '2'}];
-a[0].a = a;
-// a is the main object, will be at index '0'
-// {one: 1} is the second object, index '1'
-// {two: '2'} the third, in '2', and it has a string
-// which will be found at index '3'
-
-Flatted.stringify(a);
-// [["1","2"],{"one":1,"a":"0"},{"two":"3"},"2"]
-// a[one,two] {one: 1, a} {two: '2'} '2'
-```
diff --git a/node_modules/flat-cache/node_modules/flatted/SPECS.md b/node_modules/flat-cache/node_modules/flatted/SPECS.md
deleted file mode 100644
index c17dfb5..0000000
--- a/node_modules/flat-cache/node_modules/flatted/SPECS.md
+++ /dev/null
@@ -1,94 +0,0 @@
-# Flatted Specifications
-
-This document describes operations performed to produce, or parse, the flatted output.
-
-## stringify(any) => flattedString
-
-The output is always an `Array` that contains at index `0` the given value.
-
-If the value is an `Array` or an `Object`, per each property value passed through the callback, return the value as is if it's not an `Array`, an `Object`, or a `string`.
-
-In case it's an `Array`, an `Object`, or a `string`, return the index as `string`, associated through a `Map`.
-
-Giving the following example:
-
-```js
-flatted.stringify('a'); // ["a"]
-flatted.stringify(['a']); // [["1"],"a"]
-flatted.stringify(['a', 1, 'b']); // [["1",1,"2"],"a","b"]
-```
-
-There is an `input` containing `[array, "a", "b"]`, where the `array` has indexes `"1"` and `"2"` as strings, indexes that point respectively at `"a"` and `"b"` within the input `[array, "a", "b"]`.
-
-The exact same happens for objects.
-
-```js
-flatted.stringify('a'); // ["a"]
-flatted.stringify({a: 'a'}); // [{"a":"1"},"a"]
-flatted.stringify({a: 'a', n: 1, b: 'b'}); // [{"a":"1","n":1,"b":"2"},"a","b"]
-```
-
-Every object, string, or array, encountered during serialization will be stored once as stringified index.
-
-```js
-// per each property/value of the object/array
-if (any == null || !/object|string/.test(typeof any))
- return any;
-if (!map.has(any)) {
- const index = String(arr.length);
- arr.push(any);
- map.set(any, index);
-}
-return map.get(any);
-```
-
-This, performed before going through all properties, grants unique indexes per reference.
-
-The stringified indexes ensure there won't be conflicts with regularly stored numbers.
-
-## parse(flattedString) => any
-
-Everything that is a `string` is wrapped as `new String`, but strings in the array, from index `1` on, is kept as regular `string`.
-
-```js
-const input = JSON.parse('[{"a":"1"},"b"]', Strings).map(strings);
-// convert strings primitives into String instances
-function Strings(key, value) {
- return typeof value === 'string' ? new String(value) : value;
-}
-// converts String instances into strings primitives
-function strings(value) {
- return value instanceof String ? String(value) : value;
-}
-```
-
-The `input` array will have a regular `string` at index `1`, but its object at index `0` will have an `instanceof String` as `.a` property.
-
-That is the key to place back values from the rest of the array, so that per each property of the object at index `0`, if the value is an `instanceof` String, something not serializable via JSON, it means it can be used to retrieve the position of its value from the `input` array.
-
-If such `value` is an object and it hasn't been parsed yet, add it as parsed and go through all its properties/values.
-
-```js
-// outside any loop ...
-const parsed = new Set;
-
-// ... per each property/value ...
-if (value instanceof Primitive) {
- const tmp = input[parseInt(value)];
- if (typeof tmp === 'object' && !parsed.has(tmp)) {
- parsed.add(tmp);
- output[key] = tmp;
- if (typeof tmp === 'object' && tmp != null) {
- // perform this same logic per
- // each nested property/value ...
- }
- } else {
- output[key] = tmp;
- }
-} else
- output[key] = tmp;
-```
-
-As summary, the whole logic is based on polluting the de-serialization with a kind of variable that is unexpected, hence secure to use as directive to retrieve an index with a value.
-
-The usage of a `Map` and a `Set` to flag known references/strings as visited/stored makes **flatted** a rock solid, fast, and compact, solution.
diff --git a/node_modules/flat-cache/node_modules/flatted/cjs/index.js b/node_modules/flat-cache/node_modules/flatted/cjs/index.js
deleted file mode 100644
index c2c9486..0000000
--- a/node_modules/flat-cache/node_modules/flatted/cjs/index.js
+++ /dev/null
@@ -1,99 +0,0 @@
-'use strict';
-/*! (c) 2020 Andrea Giammarchi */
-
-const {parse: $parse, stringify: $stringify} = JSON;
-const {keys} = Object;
-
-const Primitive = String; // it could be Number
-const primitive = 'string'; // it could be 'number'
-
-const ignore = {};
-const object = 'object';
-
-const noop = (_, value) => value;
-
-const primitives = value => (
- value instanceof Primitive ? Primitive(value) : value
-);
-
-const Primitives = (_, value) => (
- typeof value === primitive ? new Primitive(value) : value
-);
-
-const revive = (input, parsed, output, $) => {
- const lazy = [];
- for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) {
- const k = ke[y];
- const value = output[k];
- if (value instanceof Primitive) {
- const tmp = input[value];
- if (typeof tmp === object && !parsed.has(tmp)) {
- parsed.add(tmp);
- output[k] = ignore;
- lazy.push({k, a: [input, parsed, tmp, $]});
- }
- else
- output[k] = $.call(output, k, tmp);
- }
- else if (output[k] !== ignore)
- output[k] = $.call(output, k, value);
- }
- for (let {length} = lazy, i = 0; i < length; i++) {
- const {k, a} = lazy[i];
- output[k] = $.call(output, k, revive.apply(null, a));
- }
- return output;
-};
-
-const set = (known, input, value) => {
- const index = Primitive(input.push(value) - 1);
- known.set(value, index);
- return index;
-};
-
-const parse = (text, reviver) => {
- const input = $parse(text, Primitives).map(primitives);
- const value = input[0];
- const $ = reviver || noop;
- const tmp = typeof value === object && value ?
- revive(input, new Set, value, $) :
- value;
- return $.call({'': tmp}, '', tmp);
-};
-exports.parse = parse;
-
-const stringify = (value, replacer, space) => {
- const $ = replacer && typeof replacer === object ?
- (k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) :
- (replacer || noop);
- const known = new Map;
- const input = [];
- const output = [];
- let i = +set(known, input, $.call({'': value}, '', value));
- let firstRun = !i;
- while (i < input.length) {
- firstRun = true;
- output[i] = $stringify(input[i++], replace, space);
- }
- return '[' + output.join(',') + ']';
- function replace(key, value) {
- if (firstRun) {
- firstRun = !firstRun;
- return value;
- }
- const after = $.call(this, key, value);
- switch (typeof after) {
- case object:
- if (after === null) return after;
- case primitive:
- return known.get(after) || set(known, input, after);
- }
- return after;
- }
-};
-exports.stringify = stringify;
-
-const toJSON = any => $parse(stringify(any));
-exports.toJSON = toJSON;
-const fromJSON = any => parse($stringify(any));
-exports.fromJSON = fromJSON;
diff --git a/node_modules/flat-cache/node_modules/flatted/esm/index.js b/node_modules/flat-cache/node_modules/flatted/esm/index.js
deleted file mode 100644
index 9a8c239..0000000
--- a/node_modules/flat-cache/node_modules/flatted/esm/index.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/*! (c) 2020 Andrea Giammarchi */
-
-const {parse: $parse, stringify: $stringify} = JSON;
-const {keys} = Object;
-
-const Primitive = String; // it could be Number
-const primitive = 'string'; // it could be 'number'
-
-const ignore = {};
-const object = 'object';
-
-const noop = (_, value) => value;
-
-const primitives = value => (
- value instanceof Primitive ? Primitive(value) : value
-);
-
-const Primitives = (_, value) => (
- typeof value === primitive ? new Primitive(value) : value
-);
-
-const revive = (input, parsed, output, $) => {
- const lazy = [];
- for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) {
- const k = ke[y];
- const value = output[k];
- if (value instanceof Primitive) {
- const tmp = input[value];
- if (typeof tmp === object && !parsed.has(tmp)) {
- parsed.add(tmp);
- output[k] = ignore;
- lazy.push({k, a: [input, parsed, tmp, $]});
- }
- else
- output[k] = $.call(output, k, tmp);
- }
- else if (output[k] !== ignore)
- output[k] = $.call(output, k, value);
- }
- for (let {length} = lazy, i = 0; i < length; i++) {
- const {k, a} = lazy[i];
- output[k] = $.call(output, k, revive.apply(null, a));
- }
- return output;
-};
-
-const set = (known, input, value) => {
- const index = Primitive(input.push(value) - 1);
- known.set(value, index);
- return index;
-};
-
-export const parse = (text, reviver) => {
- const input = $parse(text, Primitives).map(primitives);
- const value = input[0];
- const $ = reviver || noop;
- const tmp = typeof value === object && value ?
- revive(input, new Set, value, $) :
- value;
- return $.call({'': tmp}, '', tmp);
-};
-
-export const stringify = (value, replacer, space) => {
- const $ = replacer && typeof replacer === object ?
- (k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) :
- (replacer || noop);
- const known = new Map;
- const input = [];
- const output = [];
- let i = +set(known, input, $.call({'': value}, '', value));
- let firstRun = !i;
- while (i < input.length) {
- firstRun = true;
- output[i] = $stringify(input[i++], replace, space);
- }
- return '[' + output.join(',') + ']';
- function replace(key, value) {
- if (firstRun) {
- firstRun = !firstRun;
- return value;
- }
- const after = $.call(this, key, value);
- switch (typeof after) {
- case object:
- if (after === null) return after;
- case primitive:
- return known.get(after) || set(known, input, after);
- }
- return after;
- }
-};
-
-export const toJSON = any => $parse(stringify(any));
-export const fromJSON = any => parse($stringify(any));
diff --git a/node_modules/flat-cache/node_modules/flatted/index.js b/node_modules/flat-cache/node_modules/flatted/index.js
deleted file mode 100644
index 9cc9107..0000000
--- a/node_modules/flat-cache/node_modules/flatted/index.js
+++ /dev/null
@@ -1,127 +0,0 @@
-self.Flatted = (function (exports) {
- 'use strict';
-
-
-
- /*! (c) 2020 Andrea Giammarchi */
- var $parse = JSON.parse,
- $stringify = JSON.stringify;
- var keys = Object.keys;
- var Primitive = String; // it could be Number
-
- var primitive = 'string'; // it could be 'number'
-
- var ignore = {};
- var object = 'object';
-
- var noop = function noop(_, value) {
- return value;
- };
-
- var primitives = function primitives(value) {
- return value instanceof Primitive ? Primitive(value) : value;
- };
-
- var Primitives = function Primitives(_, value) {
- return typeof(value) === primitive ? new Primitive(value) : value;
- };
-
- var revive = function revive(input, parsed, output, $) {
- var lazy = [];
-
- for (var ke = keys(output), length = ke.length, y = 0; y < length; y++) {
- var k = ke[y];
- var value = output[k];
-
- if (value instanceof Primitive) {
- var tmp = input[value];
-
- if (typeof(tmp) === object && !parsed.has(tmp)) {
- parsed.add(tmp);
- output[k] = ignore;
- lazy.push({
- k: k,
- a: [input, parsed, tmp, $]
- });
- } else output[k] = $.call(output, k, tmp);
- } else if (output[k] !== ignore) output[k] = $.call(output, k, value);
- }
-
- for (var _length = lazy.length, i = 0; i < _length; i++) {
- var _lazy$i = lazy[i],
- _k = _lazy$i.k,
- a = _lazy$i.a;
- output[_k] = $.call(output, _k, revive.apply(null, a));
- }
-
- return output;
- };
-
- var set = function set(known, input, value) {
- var index = Primitive(input.push(value) - 1);
- known.set(value, index);
- return index;
- };
-
- var parse = function parse(text, reviver) {
- var input = $parse(text, Primitives).map(primitives);
- var value = input[0];
- var $ = reviver || noop;
- var tmp = typeof(value) === object && value ? revive(input, new Set(), value, $) : value;
- return $.call({
- '': tmp
- }, '', tmp);
- };
- var stringify = function stringify(value, replacer, space) {
- var $ = replacer && typeof(replacer) === object ? function (k, v) {
- return k === '' || -1 < replacer.indexOf(k) ? v : void 0;
- } : replacer || noop;
- var known = new Map();
- var input = [];
- var output = [];
- var i = +set(known, input, $.call({
- '': value
- }, '', value));
- var firstRun = !i;
-
- while (i < input.length) {
- firstRun = true;
- output[i] = $stringify(input[i++], replace, space);
- }
-
- return '[' + output.join(',') + ']';
-
- function replace(key, value) {
- if (firstRun) {
- firstRun = !firstRun;
- return value;
- }
-
- var after = $.call(this, key, value);
-
- switch (typeof(after)) {
- case object:
- if (after === null) return after;
-
- case primitive:
- return known.get(after) || set(known, input, after);
- }
-
- return after;
- }
- };
- var toJSON = function toJSON(any) {
- return $parse(stringify(any));
- };
- var fromJSON = function fromJSON(any) {
- return parse($stringify(any));
- };
-
- exports.fromJSON = fromJSON;
- exports.parse = parse;
- exports.stringify = stringify;
- exports.toJSON = toJSON;
-
- return exports;
-
-})({});
diff --git a/node_modules/flat-cache/node_modules/flatted/min.js b/node_modules/flat-cache/node_modules/flatted/min.js
deleted file mode 100644
index a822de2..0000000
--- a/node_modules/flat-cache/node_modules/flatted/min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-self.Flatted=function(n){"use strict";
-/*! (c) 2020 Andrea Giammarchi */var t=JSON.parse,r=JSON.stringify,e=Object.keys,u=String,a="string",f={},i="object",o=function(n,t){return t},c=function(n){return n instanceof u?u(n):n},l=function(n,t){return typeof t===a?new u(t):t},s=function n(t,r,a,o){for(var c=[],l=e(a),s=l.length,p=0;p<s;p++){var v=l[p],y=a[v];if(y instanceof u){var g=t[y];typeof g!==i||r.has(g)?a[v]=o.call(a,v,g):(r.add(g),a[v]=f,c.push({k:v,a:[t,r,g,o]}))}else a[v]!==f&&(a[v]=o.call(a,v,y))}for(var h=c.length,O=0;O<h;O++){var S=c[O],d=S.k,w=S.a;a[d]=o.call(a,d,n.apply(null,w))}return a},p=function(n,t,r){var e=u(t.push(r)-1);return n.set(r,e),e},v=function(n,r){var e=t(n,l).map(c),u=e[0],a=r||o,f=typeof u===i&&u?s(e,new Set,u,a):u;return a.call({"":f},"",f)},y=function(n,t,e){for(var u=t&&typeof t===i?function(n,r){return""===n||-1<t.indexOf(n)?r:void 0}:t||o,f=new Map,c=[],l=[],s=+p(f,c,u.call({"":n},"",n)),v=!s;s<c.length;)v=!0,l[s]=r(c[s++],y,e);return"["+l.join(",")+"]";function y(n,t){if(v)return v=!v,t;var r=u.call(this,n,t);switch(typeof r){case i:if(null===r)return r;case a:return f.get(r)||p(f,c,r)}return r}};return n.fromJSON=function(n){return v(r(n))},n.parse=v,n.stringify=y,n.toJSON=function(n){return t(y(n))},n}({});
\ No newline at end of file
diff --git a/node_modules/flat-cache/node_modules/flatted/package.json b/node_modules/flat-cache/node_modules/flatted/package.json
deleted file mode 100644
index b73bedb..0000000
--- a/node_modules/flat-cache/node_modules/flatted/package.json
+++ /dev/null
@@ -1,61 +0,0 @@
-{
- "name": "flatted",
- "version": "3.2.5",
- "description": "A super light and fast circular JSON parser.",
- "unpkg": "min.js",
- "types": "types.d.ts",
- "main": "./cjs/index.js",
- "scripts": {
- "build": "npm run cjs && npm run rollup:es && npm run rollup:babel && npm run min && npm run test && npm run size",
- "cjs": "ascjs esm cjs",
- "rollup:es": "rollup --config rollup/es.config.js && sed -i.bck 's/^var /self./' es.js && rm -rf es.js.bck",
- "rollup:babel": "rollup --config rollup/babel.config.js && sed -i.bck 's/^var /self./' index.js && rm -rf index.js.bck && drop-babel-typeof index.js",
- "min": "terser index.js -c -m -o min.js",
- "size": "cat index.js | wc -c;cat min.js | wc -c;gzip -c9 min.js | wc -c;cat min.js | brotli | wc -c; cat es.js | brotli | wc -c",
- "test": "c8 node test/index.js",
- "test:php": "php php/test.php",
- "coverage": "mkdir -p ./coverage; c8 report --reporter=text-lcov > ./coverage/lcov.info"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/WebReflection/flatted.git"
- },
- "keywords": [
- "circular",
- "JSON",
- "fast",
- "parser",
- "minimal"
- ],
- "author": "Andrea Giammarchi",
- "license": "ISC",
- "bugs": {
- "url": "https://github.com/WebReflection/flatted/issues"
- },
- "homepage": "https://github.com/WebReflection/flatted#readme",
- "devDependencies": {
- "@babel/core": "^7.16.0",
- "@babel/preset-env": "^7.16.0",
- "@ungap/structured-clone": "^0.3.4",
- "ascjs": "^5.0.1",
- "c8": "^7.10.0",
- "circular-json": "^0.5.9",
- "circular-json-es6": "^2.0.2",
- "drop-babel-typeof": "^1.0.3",
- "jsan": "^3.1.13",
- "rollup": "^2.59.0",
- "rollup-plugin-babel": "^4.4.0",
- "rollup-plugin-node-resolve": "^5.2.0",
- "rollup-plugin-terser": "^7.0.2",
- "terser": "^5.9.0"
- },
- "module": "./esm/index.js",
- "type": "module",
- "exports": {
- ".": {
- "import": "./esm/index.js",
- "default": "./cjs/index.js"
- },
- "./package.json": "./package.json"
- }
-}
diff --git a/node_modules/flat-cache/node_modules/flatted/types.d.ts b/node_modules/flat-cache/node_modules/flatted/types.d.ts
deleted file mode 100644
index d38b4a1..0000000
--- a/node_modules/flat-cache/node_modules/flatted/types.d.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-interface Flatted {
- /**
- * Converts a JavaScript Object Notation (using Flatted encoding) string into an object.
- * @param text A valid Flatted string.
- * @param reviver A function that transforms the results. This function is called for each member of the object.
- * If a member contains nested objects, the nested objects are transformed before the parent object is.
- */
- parse(
- text: string,
- reviver?: (this: any, key: string, value: any) => any
- ): any;
- /**
- * Converts a JavaScript value to a JavaScript Object Notation (using Flatted encoding) string.
- * @param value A JavaScript value, usually an object or array, to be converted.
- * @param replacer A function that transforms the results.
- * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
- */
- stringify(
- value: any,
- replacer?: (this: any, key: string, value: any) => any,
- space?: string | number
- ): string;
- /**
- * Converts a JavaScript value to a JavaScript Object Notation (using Flatted encoding) string.
- * @param value A JavaScript value, usually an object or array, to be converted.
- * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
- * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
- */
- stringify(
- value: any,
- replacer?: (number | string)[] | null,
- space?: string | number
- ): string;
- /**
- * Helper to allow explicit conversions with classes.
- * @param value The JSON to convert to JavaScript value
- */
- fromJSON(value: any): any;
- /**
- * Helper to allow explicit conversions with classes.
- * @param value A JavaScript value, usually an object or array, to be converted.
- */
- toJSON(value: any): any;
-}
-
-/**
- * Fast and minimal circular JSON parser.
- * logic example
-```js
-var a = [{one: 1}, {two: '2'}];
-a[0].a = a;
-// a is the main object, will be at index '0'
-// {one: 1} is the second object, index '1'
-// {two: '2'} the third, in '2', and it has a string
-// which will be found at index '3'
-Flatted.stringify(a);
-// [["1","2"],{"one":1,"a":"0"},{"two":"3"},"2"]
-// a[one,two] {one: 1, a} {two: '2'} '2'
-```
- */
-declare const Flatted: Flatted;
-export = Flatted;
diff --git a/node_modules/flat-cache/node_modules/flatted/.github/workflows/node.js.yml b/node_modules/flatted/.github/workflows/node.js.yml
similarity index 100%
rename from node_modules/flat-cache/node_modules/flatted/.github/workflows/node.js.yml
rename to node_modules/flatted/.github/workflows/node.js.yml
diff --git a/node_modules/flatted/LICENSE b/node_modules/flatted/LICENSE
index c850830..506dc47 100644
--- a/node_modules/flatted/LICENSE
+++ b/node_modules/flatted/LICENSE
@@ -1,6 +1,6 @@
ISC License
-Copyright (c) 2018, Andrea Giammarchi, @WebReflection
+Copyright (c) 2018-2020, Andrea Giammarchi, @WebReflection
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
diff --git a/node_modules/flatted/README.md b/node_modules/flatted/README.md
index 8441593..2e466b6 100644
--- a/node_modules/flatted/README.md
+++ b/node_modules/flatted/README.md
@@ -1,9 +1,27 @@
# flatted
- [](https://coveralls.io/github/WebReflection/flatted?branch=master) [](https://travis-ci.org/WebReflection/flatted) [](https://opensource.org/licenses/ISC) 
+[](https://www.npmjs.com/package/flatted) [](https://coveralls.io/github/WebReflection/flatted?branch=main) [](https://travis-ci.com/WebReflection/flatted) [](https://opensource.org/licenses/ISC) 
+
+
+
+<sup>**Social Media Photo by [Matt Seymour](https://unsplash.com/@mattseymour) on [Unsplash](https://unsplash.com/)**</sup>
+
+## Announcement 📣
+
+There is a standard approach to recursion and more data-types than what JSON allows, and it's part of the [Structured Clone polyfill](https://github.com/ungap/structured-clone/#readme).
+
+Beside acting as a polyfill, its `@ungap/structured-clone/json` export provides both `stringify` and `parse`, and it's been tested for being faster than *flatted*, but its produced output is also smaller than *flatted* in general.
+
+The *@ungap/structured-clone* module is, in short, a drop in replacement for *flatted*, but it's not compatible with *flatted* specialized syntax.
+
+However, if recursion, as well as more data-types, are what you are after, or interesting for your projects/use cases, consider switching to this new module whenever you can 👍
+
+- - -
A super light (0.5K) and fast circular JSON parser, directly from the creator of [CircularJSON](https://github.com/WebReflection/circular-json/#circularjson).
+Now available also for **[PHP](./php/flatted.php)**.
+
```js
npm i flatted
```
@@ -12,10 +30,10 @@
```js
// ESM
-import {parse, stringify} from 'flatted/esm';
+import {parse, stringify, toJSON, fromJSON} from 'flatted';
// CJS
-const {parse, stringify} = require('flatted/cjs');
+const {parse, stringify, toJSON, fromJSON} = require('flatted');
const a = [{}];
a[0].a = a;
@@ -24,6 +42,34 @@
stringify(a); // [["1","0"],{"a":"0"}]
```
+## toJSON and fromJSON
+
+If you'd like to implicitly survive JSON serialization, these two helpers helps:
+
+```js
+import {toJSON, fromJSON} from 'flatted';
+
+class RecursiveMap extends Map {
+ static fromJSON(any) {
+ return new this(fromJSON(any));
+ }
+ toJSON() {
+ return toJSON([...this.entries()]);
+ }
+}
+
+const recursive = new RecursiveMap;
+const same = {};
+same.same = same;
+recursive.set('same', same);
+
+const asString = JSON.stringify(recursive);
+const asMap = RecursiveMap.fromJSON(JSON.parse(asString));
+asMap.get('same') === asMap.get('same').same;
+// true
+```
+
+
## Flatted VS JSON
As it is for every other specialized format capable of serializing and deserializing circular data, you should never `JSON.parse(Flatted.stringify(data))`, and you should never `Flatted.parse(JSON.stringify(data))`.
diff --git a/node_modules/flatted/cjs/index.js b/node_modules/flatted/cjs/index.js
index a09c80c..c2c9486 100644
--- a/node_modules/flatted/cjs/index.js
+++ b/node_modules/flatted/cjs/index.js
@@ -1,114 +1,99 @@
-var Flatted = (function (Primitive, primitive) {
+'use strict';
+/*! (c) 2020 Andrea Giammarchi */
- /*!
- * ISC License
- *
- * Copyright (c) 2018, Andrea Giammarchi, @WebReflection
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
+const {parse: $parse, stringify: $stringify} = JSON;
+const {keys} = Object;
- var Flatted = {
+const Primitive = String; // it could be Number
+const primitive = 'string'; // it could be 'number'
- parse: function parse(text, reviver) {
- var input = JSON.parse(text, Primitives).map(primitives);
- var value = input[0];
- var $ = reviver || noop;
- var tmp = typeof value === 'object' && value ?
- revive(input, new Set, value, $) :
- value;
- return $.call({'': tmp}, '', tmp);
- },
+const ignore = {};
+const object = 'object';
- stringify: function stringify(value, replacer, space) {
- for (var
- firstRun,
- known = new Map,
- input = [],
- output = [],
- $ = replacer && typeof replacer === typeof input ?
- function (k, v) {
- if (k === '' || -1 < replacer.indexOf(k)) return v;
- } :
- (replacer || noop),
- i = +set(known, input, $.call({'': value}, '', value)),
- replace = function (key, value) {
- if (firstRun) {
- firstRun = !firstRun;
- return value;
- }
- var after = $.call(this, key, value);
- switch (typeof after) {
- case 'object':
- if (after === null) return after;
- case primitive:
- return known.get(after) || set(known, input, after);
- }
- return after;
- };
- i < input.length; i++
- ) {
- firstRun = true;
- output[i] = JSON.stringify(input[i], replace, space);
+const noop = (_, value) => value;
+
+const primitives = value => (
+ value instanceof Primitive ? Primitive(value) : value
+);
+
+const Primitives = (_, value) => (
+ typeof value === primitive ? new Primitive(value) : value
+);
+
+const revive = (input, parsed, output, $) => {
+ const lazy = [];
+ for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) {
+ const k = ke[y];
+ const value = output[k];
+ if (value instanceof Primitive) {
+ const tmp = input[value];
+ if (typeof tmp === object && !parsed.has(tmp)) {
+ parsed.add(tmp);
+ output[k] = ignore;
+ lazy.push({k, a: [input, parsed, tmp, $]});
}
- return '[' + output.join(',') + ']';
+ else
+ output[k] = $.call(output, k, tmp);
}
-
- };
-
- return Flatted;
-
- function noop(key, value) {
- return value;
+ else if (output[k] !== ignore)
+ output[k] = $.call(output, k, value);
}
-
- function revive(input, parsed, output, $) {
- return Object.keys(output).reduce(
- function (output, key) {
- var value = output[key];
- if (value instanceof Primitive) {
- var tmp = input[value];
- if (typeof tmp === 'object' && !parsed.has(tmp)) {
- parsed.add(tmp);
- output[key] = $.call(output, key, revive(input, parsed, tmp, $));
- } else {
- output[key] = $.call(output, key, tmp);
- }
- } else
- output[key] = $.call(output, key, value);
- return output;
- },
- output
- );
+ for (let {length} = lazy, i = 0; i < length; i++) {
+ const {k, a} = lazy[i];
+ output[k] = $.call(output, k, revive.apply(null, a));
}
+ return output;
+};
- function set(known, input, value) {
- var index = Primitive(input.push(value) - 1);
- known.set(value, index);
- return index;
+const set = (known, input, value) => {
+ const index = Primitive(input.push(value) - 1);
+ known.set(value, index);
+ return index;
+};
+
+const parse = (text, reviver) => {
+ const input = $parse(text, Primitives).map(primitives);
+ const value = input[0];
+ const $ = reviver || noop;
+ const tmp = typeof value === object && value ?
+ revive(input, new Set, value, $) :
+ value;
+ return $.call({'': tmp}, '', tmp);
+};
+exports.parse = parse;
+
+const stringify = (value, replacer, space) => {
+ const $ = replacer && typeof replacer === object ?
+ (k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) :
+ (replacer || noop);
+ const known = new Map;
+ const input = [];
+ const output = [];
+ let i = +set(known, input, $.call({'': value}, '', value));
+ let firstRun = !i;
+ while (i < input.length) {
+ firstRun = true;
+ output[i] = $stringify(input[i++], replace, space);
}
-
- // the two kinds of primitives
- // 1. the real one
- // 2. the wrapped one
-
- function primitives(value) {
- return value instanceof Primitive ? Primitive(value) : value;
+ return '[' + output.join(',') + ']';
+ function replace(key, value) {
+ if (firstRun) {
+ firstRun = !firstRun;
+ return value;
+ }
+ const after = $.call(this, key, value);
+ switch (typeof after) {
+ case object:
+ if (after === null) return after;
+ case primitive:
+ return known.get(after) || set(known, input, after);
+ }
+ return after;
}
+};
+exports.stringify = stringify;
- function Primitives(key, value) {
- return typeof value === primitive ? new Primitive(value) : value;
- }
-
-}(String, 'string'));
-module.exports = Flatted;
+const toJSON = any => $parse(stringify(any));
+exports.toJSON = toJSON;
+const fromJSON = any => parse($stringify(any));
+exports.fromJSON = fromJSON;
diff --git a/node_modules/flat-cache/node_modules/flatted/cjs/package.json b/node_modules/flatted/cjs/package.json
similarity index 100%
rename from node_modules/flat-cache/node_modules/flatted/cjs/package.json
rename to node_modules/flatted/cjs/package.json
diff --git a/node_modules/flat-cache/node_modules/flatted/es.js b/node_modules/flatted/es.js
similarity index 100%
rename from node_modules/flat-cache/node_modules/flatted/es.js
rename to node_modules/flatted/es.js
diff --git a/node_modules/flatted/esm/index.js b/node_modules/flatted/esm/index.js
index 4392ca2..9a8c239 100644
--- a/node_modules/flatted/esm/index.js
+++ b/node_modules/flatted/esm/index.js
@@ -1,116 +1,94 @@
-var Flatted = (function (Primitive, primitive) {
+/*! (c) 2020 Andrea Giammarchi */
- /*!
- * ISC License
- *
- * Copyright (c) 2018, Andrea Giammarchi, @WebReflection
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
+const {parse: $parse, stringify: $stringify} = JSON;
+const {keys} = Object;
- var Flatted = {
+const Primitive = String; // it could be Number
+const primitive = 'string'; // it could be 'number'
- parse: function parse(text, reviver) {
- var input = JSON.parse(text, Primitives).map(primitives);
- var value = input[0];
- var $ = reviver || noop;
- var tmp = typeof value === 'object' && value ?
- revive(input, new Set, value, $) :
- value;
- return $.call({'': tmp}, '', tmp);
- },
+const ignore = {};
+const object = 'object';
- stringify: function stringify(value, replacer, space) {
- for (var
- firstRun,
- known = new Map,
- input = [],
- output = [],
- $ = replacer && typeof replacer === typeof input ?
- function (k, v) {
- if (k === '' || -1 < replacer.indexOf(k)) return v;
- } :
- (replacer || noop),
- i = +set(known, input, $.call({'': value}, '', value)),
- replace = function (key, value) {
- if (firstRun) {
- firstRun = !firstRun;
- return value;
- }
- var after = $.call(this, key, value);
- switch (typeof after) {
- case 'object':
- if (after === null) return after;
- case primitive:
- return known.get(after) || set(known, input, after);
- }
- return after;
- };
- i < input.length; i++
- ) {
- firstRun = true;
- output[i] = JSON.stringify(input[i], replace, space);
+const noop = (_, value) => value;
+
+const primitives = value => (
+ value instanceof Primitive ? Primitive(value) : value
+);
+
+const Primitives = (_, value) => (
+ typeof value === primitive ? new Primitive(value) : value
+);
+
+const revive = (input, parsed, output, $) => {
+ const lazy = [];
+ for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) {
+ const k = ke[y];
+ const value = output[k];
+ if (value instanceof Primitive) {
+ const tmp = input[value];
+ if (typeof tmp === object && !parsed.has(tmp)) {
+ parsed.add(tmp);
+ output[k] = ignore;
+ lazy.push({k, a: [input, parsed, tmp, $]});
}
- return '[' + output.join(',') + ']';
+ else
+ output[k] = $.call(output, k, tmp);
}
-
- };
-
- return Flatted;
-
- function noop(key, value) {
- return value;
+ else if (output[k] !== ignore)
+ output[k] = $.call(output, k, value);
}
-
- function revive(input, parsed, output, $) {
- return Object.keys(output).reduce(
- function (output, key) {
- var value = output[key];
- if (value instanceof Primitive) {
- var tmp = input[value];
- if (typeof tmp === 'object' && !parsed.has(tmp)) {
- parsed.add(tmp);
- output[key] = $.call(output, key, revive(input, parsed, tmp, $));
- } else {
- output[key] = $.call(output, key, tmp);
- }
- } else
- output[key] = $.call(output, key, value);
- return output;
- },
- output
- );
+ for (let {length} = lazy, i = 0; i < length; i++) {
+ const {k, a} = lazy[i];
+ output[k] = $.call(output, k, revive.apply(null, a));
}
+ return output;
+};
- function set(known, input, value) {
- var index = Primitive(input.push(value) - 1);
- known.set(value, index);
- return index;
+const set = (known, input, value) => {
+ const index = Primitive(input.push(value) - 1);
+ known.set(value, index);
+ return index;
+};
+
+export const parse = (text, reviver) => {
+ const input = $parse(text, Primitives).map(primitives);
+ const value = input[0];
+ const $ = reviver || noop;
+ const tmp = typeof value === object && value ?
+ revive(input, new Set, value, $) :
+ value;
+ return $.call({'': tmp}, '', tmp);
+};
+
+export const stringify = (value, replacer, space) => {
+ const $ = replacer && typeof replacer === object ?
+ (k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) :
+ (replacer || noop);
+ const known = new Map;
+ const input = [];
+ const output = [];
+ let i = +set(known, input, $.call({'': value}, '', value));
+ let firstRun = !i;
+ while (i < input.length) {
+ firstRun = true;
+ output[i] = $stringify(input[i++], replace, space);
}
-
- // the two kinds of primitives
- // 1. the real one
- // 2. the wrapped one
-
- function primitives(value) {
- return value instanceof Primitive ? Primitive(value) : value;
+ return '[' + output.join(',') + ']';
+ function replace(key, value) {
+ if (firstRun) {
+ firstRun = !firstRun;
+ return value;
+ }
+ const after = $.call(this, key, value);
+ switch (typeof after) {
+ case object:
+ if (after === null) return after;
+ case primitive:
+ return known.get(after) || set(known, input, after);
+ }
+ return after;
}
+};
- function Primitives(key, value) {
- return typeof value === primitive ? new Primitive(value) : value;
- }
-
-}(String, 'string'));
-export default Flatted;
-export var parse = Flatted.parse;
-export var stringify = Flatted.stringify;
+export const toJSON = any => $parse(stringify(any));
+export const fromJSON = any => parse($stringify(any));
diff --git a/node_modules/flat-cache/node_modules/flatted/flatted.jpg b/node_modules/flatted/flatted.jpg
similarity index 100%
rename from node_modules/flat-cache/node_modules/flatted/flatted.jpg
rename to node_modules/flatted/flatted.jpg
Binary files differ
diff --git a/node_modules/flatted/index.js b/node_modules/flatted/index.js
index 1eca303..9cc9107 100644
--- a/node_modules/flatted/index.js
+++ b/node_modules/flatted/index.js
@@ -1,113 +1,127 @@
-var Flatted = (function (Primitive, primitive) {
+self.Flatted = (function (exports) {
+ 'use strict';
- /*!
- * ISC License
- *
- * Copyright (c) 2018, Andrea Giammarchi, @WebReflection
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
+
- var Flatted = {
+ /*! (c) 2020 Andrea Giammarchi */
+ var $parse = JSON.parse,
+ $stringify = JSON.stringify;
+ var keys = Object.keys;
+ var Primitive = String; // it could be Number
- parse: function parse(text, reviver) {
- var input = JSON.parse(text, Primitives).map(primitives);
- var value = input[0];
- var $ = reviver || noop;
- var tmp = typeof value === 'object' && value ?
- revive(input, new Set, value, $) :
- value;
- return $.call({'': tmp}, '', tmp);
- },
+ var primitive = 'string'; // it could be 'number'
- stringify: function stringify(value, replacer, space) {
- for (var
- firstRun,
- known = new Map,
- input = [],
- output = [],
- $ = replacer && typeof replacer === typeof input ?
- function (k, v) {
- if (k === '' || -1 < replacer.indexOf(k)) return v;
- } :
- (replacer || noop),
- i = +set(known, input, $.call({'': value}, '', value)),
- replace = function (key, value) {
- if (firstRun) {
- firstRun = !firstRun;
- return value;
- }
- var after = $.call(this, key, value);
- switch (typeof after) {
- case 'object':
- if (after === null) return after;
- case primitive:
- return known.get(after) || set(known, input, after);
- }
- return after;
- };
- i < input.length; i++
- ) {
- firstRun = true;
- output[i] = JSON.stringify(input[i], replace, space);
- }
- return '[' + output.join(',') + ']';
- }
+ var ignore = {};
+ var object = 'object';
+ var noop = function noop(_, value) {
+ return value;
};
- return Flatted;
+ var primitives = function primitives(value) {
+ return value instanceof Primitive ? Primitive(value) : value;
+ };
- function noop(key, value) {
- return value;
- }
+ var Primitives = function Primitives(_, value) {
+ return typeof(value) === primitive ? new Primitive(value) : value;
+ };
- function revive(input, parsed, output, $) {
- return Object.keys(output).reduce(
- function (output, key) {
- var value = output[key];
- if (value instanceof Primitive) {
- var tmp = input[value];
- if (typeof tmp === 'object' && !parsed.has(tmp)) {
- parsed.add(tmp);
- output[key] = $.call(output, key, revive(input, parsed, tmp, $));
- } else {
- output[key] = $.call(output, key, tmp);
- }
- } else
- output[key] = $.call(output, key, value);
- return output;
- },
- output
- );
- }
+ var revive = function revive(input, parsed, output, $) {
+ var lazy = [];
- function set(known, input, value) {
+ for (var ke = keys(output), length = ke.length, y = 0; y < length; y++) {
+ var k = ke[y];
+ var value = output[k];
+
+ if (value instanceof Primitive) {
+ var tmp = input[value];
+
+ if (typeof(tmp) === object && !parsed.has(tmp)) {
+ parsed.add(tmp);
+ output[k] = ignore;
+ lazy.push({
+ k: k,
+ a: [input, parsed, tmp, $]
+ });
+ } else output[k] = $.call(output, k, tmp);
+ } else if (output[k] !== ignore) output[k] = $.call(output, k, value);
+ }
+
+ for (var _length = lazy.length, i = 0; i < _length; i++) {
+ var _lazy$i = lazy[i],
+ _k = _lazy$i.k,
+ a = _lazy$i.a;
+ output[_k] = $.call(output, _k, revive.apply(null, a));
+ }
+
+ return output;
+ };
+
+ var set = function set(known, input, value) {
var index = Primitive(input.push(value) - 1);
known.set(value, index);
return index;
- }
+ };
- // the two kinds of primitives
- // 1. the real one
- // 2. the wrapped one
+ var parse = function parse(text, reviver) {
+ var input = $parse(text, Primitives).map(primitives);
+ var value = input[0];
+ var $ = reviver || noop;
+ var tmp = typeof(value) === object && value ? revive(input, new Set(), value, $) : value;
+ return $.call({
+ '': tmp
+ }, '', tmp);
+ };
+ var stringify = function stringify(value, replacer, space) {
+ var $ = replacer && typeof(replacer) === object ? function (k, v) {
+ return k === '' || -1 < replacer.indexOf(k) ? v : void 0;
+ } : replacer || noop;
+ var known = new Map();
+ var input = [];
+ var output = [];
+ var i = +set(known, input, $.call({
+ '': value
+ }, '', value));
+ var firstRun = !i;
- function primitives(value) {
- return value instanceof Primitive ? Primitive(value) : value;
- }
+ while (i < input.length) {
+ firstRun = true;
+ output[i] = $stringify(input[i++], replace, space);
+ }
- function Primitives(key, value) {
- return typeof value === primitive ? new Primitive(value) : value;
- }
+ return '[' + output.join(',') + ']';
-}(String, 'string'));
+ function replace(key, value) {
+ if (firstRun) {
+ firstRun = !firstRun;
+ return value;
+ }
+
+ var after = $.call(this, key, value);
+
+ switch (typeof(after)) {
+ case object:
+ if (after === null) return after;
+
+ case primitive:
+ return known.get(after) || set(known, input, after);
+ }
+
+ return after;
+ }
+ };
+ var toJSON = function toJSON(any) {
+ return $parse(stringify(any));
+ };
+ var fromJSON = function fromJSON(any) {
+ return parse($stringify(any));
+ };
+
+ exports.fromJSON = fromJSON;
+ exports.parse = parse;
+ exports.stringify = stringify;
+ exports.toJSON = toJSON;
+
+ return exports;
+
+})({});
diff --git a/node_modules/flatted/min.js b/node_modules/flatted/min.js
index 9e2a134..2fcdabe 100644
--- a/node_modules/flatted/min.js
+++ b/node_modules/flatted/min.js
@@ -1,2 +1,2 @@
-/*! (c) 2018, Andrea Giammarchi, (ISC) */
-var Flatted=function(a,l){return{parse:function(n,t){var e=JSON.parse(n,i).map(f),r=e[0],u=t||s,c="object"==typeof r&&r?function u(c,f,n,i){return Object.keys(n).reduce(function(n,t){var e=n[t];if(e instanceof a){var r=c[e];"object"!=typeof r||f.has(r)?n[t]=i.call(n,t,r):(f.add(r),n[t]=i.call(n,t,u(c,f,r,i)))}else n[t]=i.call(n,t,e);return n},n)}(e,new Set,r,u):r;return u.call({"":c},"",c)},stringify:function(n,e,t){function r(n,t){if(u)return u=!u,t;var e=a.call(this,n,t);switch(typeof e){case"object":if(null===e)return e;case l:return c.get(e)||p(c,f,e)}return e}for(var u,c=new Map,f=[],i=[],a=e&&typeof e==typeof f?function(n,t){if(""===n||-1<e.indexOf(n))return t}:e||s,o=+p(c,f,a.call({"":n},"",n));o<f.length;o++)u=!0,i[o]=JSON.stringify(f[o],r,t);return"["+i.join(",")+"]"}};function s(n,t){return t}function p(n,t,e){var r=a(t.push(e)-1);return n.set(e,r),r}function f(n){return n instanceof a?a(n):n}function i(n,t){return typeof t==l?new a(t):t}}(String,"string");
+self.Flatted=function(n){"use strict";
+/*! (c) 2020 Andrea Giammarchi */var t=JSON.parse,r=JSON.stringify,e=Object.keys,u=String,a="string",f={},i="object",o=function(n,t){return t},c=function(n){return n instanceof u?u(n):n},l=function(n,t){return typeof t===a?new u(t):t},s=function n(t,r,a,o){for(var c=[],l=e(a),s=l.length,p=0;p<s;p++){var v=l[p],y=a[v];if(y instanceof u){var g=t[y];typeof g!==i||r.has(g)?a[v]=o.call(a,v,g):(r.add(g),a[v]=f,c.push({k:v,a:[t,r,g,o]}))}else a[v]!==f&&(a[v]=o.call(a,v,y))}for(var h=c.length,O=0;O<h;O++){var S=c[O],d=S.k,w=S.a;a[d]=o.call(a,d,n.apply(null,w))}return a},p=function(n,t,r){var e=u(t.push(r)-1);return n.set(r,e),e},v=function(n,r){var e=t(n,l).map(c),u=e[0],a=r||o,f=typeof u===i&&u?s(e,new Set,u,a):u;return a.call({"":f},"",f)},y=function(n,t,e){for(var u=t&&typeof t===i?function(n,r){return""===n||-1<t.indexOf(n)?r:void 0}:t||o,f=new Map,c=[],l=[],s=+p(f,c,u.call({"":n},"",n)),v=!s;s<c.length;)v=!0,l[s]=r(c[s++],y,e);return"["+l.join(",")+"]";function y(n,t){if(v)return v=!v,t;var r=u.call(this,n,t);switch(typeof r){case i:if(null===r)return r;case a:return f.get(r)||p(f,c,r)}return r}};return n.fromJSON=function(n){return v(r(n))},n.parse=v,n.stringify=y,n.toJSON=function(n){return t(y(n))},n}({});
diff --git a/node_modules/flatted/package.json b/node_modules/flatted/package.json
index 6b83493..b73bedb 100644
--- a/node_modules/flatted/package.json
+++ b/node_modules/flatted/package.json
@@ -1,20 +1,20 @@
{
"name": "flatted",
- "version": "2.0.2",
+ "version": "3.2.5",
"description": "A super light and fast circular JSON parser.",
"unpkg": "min.js",
- "main": "cjs/index.js",
- "module": "esm/index.js",
"types": "types.d.ts",
+ "main": "./cjs/index.js",
"scripts": {
- "bench": "node test/bench.js",
- "build": "npm run cjs && npm test && npm run esm && npm run min && npm run size",
- "cjs": "cp index.js cjs/index.js; echo 'module.exports = Flatted;' >> cjs/index.js",
- "esm": "cp index.js esm/index.js; echo 'export default Flatted;' >> esm/index.js; echo 'export var parse = Flatted.parse;' >> esm/index.js; echo 'export var stringify = Flatted.stringify;' >> esm/index.js",
- "min": "echo '/*! (c) 2018, Andrea Giammarchi, (ISC) */'>min.js && uglifyjs index.js --support-ie8 -c -m >> min.js",
- "size": "cat index.js | wc -c;cat min.js | wc -c;gzip -c9 min.js | wc -c;cat min.js | brotli | wc -c",
- "coveralls": "nyc report --reporter=text-lcov | coveralls",
- "test": "nyc node test/index.js"
+ "build": "npm run cjs && npm run rollup:es && npm run rollup:babel && npm run min && npm run test && npm run size",
+ "cjs": "ascjs esm cjs",
+ "rollup:es": "rollup --config rollup/es.config.js && sed -i.bck 's/^var /self./' es.js && rm -rf es.js.bck",
+ "rollup:babel": "rollup --config rollup/babel.config.js && sed -i.bck 's/^var /self./' index.js && rm -rf index.js.bck && drop-babel-typeof index.js",
+ "min": "terser index.js -c -m -o min.js",
+ "size": "cat index.js | wc -c;cat min.js | wc -c;gzip -c9 min.js | wc -c;cat min.js | brotli | wc -c; cat es.js | brotli | wc -c",
+ "test": "c8 node test/index.js",
+ "test:php": "php php/test.php",
+ "coverage": "mkdir -p ./coverage; c8 report --reporter=text-lcov > ./coverage/lcov.info"
},
"repository": {
"type": "git",
@@ -34,11 +34,28 @@
},
"homepage": "https://github.com/WebReflection/flatted#readme",
"devDependencies": {
+ "@babel/core": "^7.16.0",
+ "@babel/preset-env": "^7.16.0",
+ "@ungap/structured-clone": "^0.3.4",
+ "ascjs": "^5.0.1",
+ "c8": "^7.10.0",
"circular-json": "^0.5.9",
"circular-json-es6": "^2.0.2",
- "coveralls": "^3.0.11",
+ "drop-babel-typeof": "^1.0.3",
"jsan": "^3.1.13",
- "nyc": "^15.0.0",
- "uglify-js": "^3.8.1"
+ "rollup": "^2.59.0",
+ "rollup-plugin-babel": "^4.4.0",
+ "rollup-plugin-node-resolve": "^5.2.0",
+ "rollup-plugin-terser": "^7.0.2",
+ "terser": "^5.9.0"
+ },
+ "module": "./esm/index.js",
+ "type": "module",
+ "exports": {
+ ".": {
+ "import": "./esm/index.js",
+ "default": "./cjs/index.js"
+ },
+ "./package.json": "./package.json"
}
}
diff --git a/node_modules/flat-cache/node_modules/flatted/php/flatted.php b/node_modules/flatted/php/flatted.php
similarity index 100%
rename from node_modules/flat-cache/node_modules/flatted/php/flatted.php
rename to node_modules/flatted/php/flatted.php
diff --git a/node_modules/flatted/types.d.ts b/node_modules/flatted/types.d.ts
index 1233af2..d38b4a1 100644
--- a/node_modules/flatted/types.d.ts
+++ b/node_modules/flatted/types.d.ts
@@ -1,19 +1,62 @@
+interface Flatted {
+ /**
+ * Converts a JavaScript Object Notation (using Flatted encoding) string into an object.
+ * @param text A valid Flatted string.
+ * @param reviver A function that transforms the results. This function is called for each member of the object.
+ * If a member contains nested objects, the nested objects are transformed before the parent object is.
+ */
+ parse(
+ text: string,
+ reviver?: (this: any, key: string, value: any) => any
+ ): any;
+ /**
+ * Converts a JavaScript value to a JavaScript Object Notation (using Flatted encoding) string.
+ * @param value A JavaScript value, usually an object or array, to be converted.
+ * @param replacer A function that transforms the results.
+ * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
+ */
+ stringify(
+ value: any,
+ replacer?: (this: any, key: string, value: any) => any,
+ space?: string | number
+ ): string;
+ /**
+ * Converts a JavaScript value to a JavaScript Object Notation (using Flatted encoding) string.
+ * @param value A JavaScript value, usually an object or array, to be converted.
+ * @param replacer An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.
+ * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
+ */
+ stringify(
+ value: any,
+ replacer?: (number | string)[] | null,
+ space?: string | number
+ ): string;
+ /**
+ * Helper to allow explicit conversions with classes.
+ * @param value The JSON to convert to JavaScript value
+ */
+ fromJSON(value: any): any;
+ /**
+ * Helper to allow explicit conversions with classes.
+ * @param value A JavaScript value, usually an object or array, to be converted.
+ */
+ toJSON(value: any): any;
+}
+
/**
* Fast and minimal circular JSON parser.
* logic example
```js
- var a = [{one: 1}, {two: '2'}];
+var a = [{one: 1}, {two: '2'}];
a[0].a = a;
// a is the main object, will be at index '0'
// {one: 1} is the second object, index '1'
// {two: '2'} the third, in '2', and it has a string
// which will be found at index '3'
-
Flatted.stringify(a);
// [["1","2"],{"one":1,"a":"0"},{"two":"3"},"2"]
// a[one,two] {one: 1, a} {two: '2'} '2'
```
*/
-declare const Flatted: typeof JSON;
-
+declare const Flatted: Flatted;
export = Flatted;
diff --git a/node_modules/follow-redirects/debug.js b/node_modules/follow-redirects/debug.js
index f2556d7..decb77d 100644
--- a/node_modules/follow-redirects/debug.js
+++ b/node_modules/follow-redirects/debug.js
@@ -6,7 +6,8 @@
/* eslint global-require: off */
debug = require("debug")("follow-redirects");
}
- catch (error) {
+ catch (error) { /* */ }
+ if (typeof debug !== "function") {
debug = function () { /* */ };
}
}
diff --git a/node_modules/follow-redirects/index.js b/node_modules/follow-redirects/index.js
index 98db8ee..3f819d1 100644
--- a/node_modules/follow-redirects/index.js
+++ b/node_modules/follow-redirects/index.js
@@ -7,8 +7,9 @@
var debug = require("./debug");
// Create handlers that pass events from native requests
+var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
var eventHandlers = Object.create(null);
-["abort", "aborted", "connect", "error", "socket", "timeout"].forEach(function (event) {
+events.forEach(function (event) {
eventHandlers[event] = function (arg1, arg2, arg3) {
this._redirectable.emit(event, arg1, arg2, arg3);
};
@@ -17,7 +18,7 @@
// Error types with codes
var RedirectionError = createErrorType(
"ERR_FR_REDIRECTION_FAILURE",
- ""
+ "Redirected request failed"
);
var TooManyRedirectsError = createErrorType(
"ERR_FR_TOO_MANY_REDIRECTS",
@@ -61,6 +62,11 @@
}
RedirectableRequest.prototype = Object.create(Writable.prototype);
+RedirectableRequest.prototype.abort = function () {
+ abortRequest(this._currentRequest);
+ this.emit("abort");
+};
+
// Writes buffered data to the current native request
RedirectableRequest.prototype.write = function (data, encoding, callback) {
// Writing is not allowed if end has been called
@@ -140,40 +146,72 @@
// Global timeout for all underlying requests
RedirectableRequest.prototype.setTimeout = function (msecs, callback) {
- if (callback) {
- this.once("timeout", callback);
+ var self = this;
+
+ // Destroys the socket on timeout
+ function destroyOnTimeout(socket) {
+ socket.setTimeout(msecs);
+ socket.removeListener("timeout", socket.destroy);
+ socket.addListener("timeout", socket.destroy);
}
+ // Sets up a timer to trigger a timeout event
+ function startTimer(socket) {
+ if (self._timeout) {
+ clearTimeout(self._timeout);
+ }
+ self._timeout = setTimeout(function () {
+ self.emit("timeout");
+ clearTimer();
+ }, msecs);
+ destroyOnTimeout(socket);
+ }
+
+ // Stops a timeout from triggering
+ function clearTimer() {
+ // Clear the timeout
+ if (self._timeout) {
+ clearTimeout(self._timeout);
+ self._timeout = null;
+ }
+
+ // Clean up all attached listeners
+ self.removeListener("abort", clearTimer);
+ self.removeListener("error", clearTimer);
+ self.removeListener("response", clearTimer);
+ if (callback) {
+ self.removeListener("timeout", callback);
+ }
+ if (!self.socket) {
+ self._currentRequest.removeListener("socket", startTimer);
+ }
+ }
+
+ // Attach callback if passed
+ if (callback) {
+ this.on("timeout", callback);
+ }
+
+ // Start the timer if or when the socket is opened
if (this.socket) {
- startTimer(this, msecs);
+ startTimer(this.socket);
}
else {
- var self = this;
- this._currentRequest.once("socket", function () {
- startTimer(self, msecs);
- });
+ this._currentRequest.once("socket", startTimer);
}
- this.once("response", clearTimer);
- this.once("error", clearTimer);
+ // Clean up on events
+ this.on("socket", destroyOnTimeout);
+ this.on("abort", clearTimer);
+ this.on("error", clearTimer);
+ this.on("response", clearTimer);
return this;
};
-function startTimer(request, msecs) {
- clearTimeout(request._timeout);
- request._timeout = setTimeout(function () {
- request.emit("timeout");
- }, msecs);
-}
-
-function clearTimer() {
- clearTimeout(this._timeout);
-}
-
// Proxy all other public ClientRequest methods
[
- "abort", "flushHeaders", "getHeader",
+ "flushHeaders", "getHeader",
"setNoDelay", "setSocketKeepAlive",
].forEach(function (method) {
RedirectableRequest.prototype[method] = function (a, b) {
@@ -243,11 +281,8 @@
// Set up event handlers
request._redirectable = this;
- for (var event in eventHandlers) {
- /* istanbul ignore else */
- if (event) {
- request.on(event, eventHandlers[event]);
- }
+ for (var e = 0; e < events.length; e++) {
+ request.on(events[e], eventHandlers[events[e]]);
}
// End a redirected request
@@ -301,86 +336,101 @@
// the user agent MAY automatically redirect its request to the URI
// referenced by the Location field value,
// even if the specific status code is not understood.
+
+ // If the response is not a redirect; return it as-is
var location = response.headers.location;
- if (location && this._options.followRedirects !== false &&
- statusCode >= 300 && statusCode < 400) {
- // Abort the current request
- this._currentRequest.removeAllListeners();
- this._currentRequest.on("error", noop);
- this._currentRequest.abort();
- // Discard the remainder of the response to avoid waiting for data
- response.destroy();
-
- // RFC7231§6.4: A client SHOULD detect and intervene
- // in cyclical redirections (i.e., "infinite" redirection loops).
- if (++this._redirectCount > this._options.maxRedirects) {
- this.emit("error", new TooManyRedirectsError());
- return;
- }
-
- // RFC7231§6.4: Automatic redirection needs to done with
- // care for methods not known to be safe, […]
- // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change
- // the request method from POST to GET for the subsequent request.
- if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
- // RFC7231§6.4.4: The 303 (See Other) status code indicates that
- // the server is redirecting the user agent to a different resource […]
- // A user agent can perform a retrieval request targeting that URI
- // (a GET or HEAD request if using HTTP) […]
- (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
- this._options.method = "GET";
- // Drop a possible entity and headers related to it
- this._requestBodyBuffers = [];
- removeMatchingHeaders(/^content-/i, this._options.headers);
- }
-
- // Drop the Host header, as the redirect might lead to a different host
- var previousHostName = removeMatchingHeaders(/^host$/i, this._options.headers) ||
- url.parse(this._currentUrl).hostname;
-
- // Create the redirected request
- var redirectUrl = url.resolve(this._currentUrl, location);
- debug("redirecting to", redirectUrl);
- this._isRedirect = true;
- var redirectUrlParts = url.parse(redirectUrl);
- Object.assign(this._options, redirectUrlParts);
-
- // Drop the Authorization header if redirecting to another host
- if (redirectUrlParts.hostname !== previousHostName) {
- removeMatchingHeaders(/^authorization$/i, this._options.headers);
- }
-
- // Evaluate the beforeRedirect callback
- if (typeof this._options.beforeRedirect === "function") {
- var responseDetails = { headers: response.headers };
- try {
- this._options.beforeRedirect.call(null, this._options, responseDetails);
- }
- catch (err) {
- this.emit("error", err);
- return;
- }
- this._sanitizeOptions(this._options);
- }
-
- // Perform the redirected request
- try {
- this._performRequest();
- }
- catch (cause) {
- var error = new RedirectionError("Redirected request failed: " + cause.message);
- error.cause = cause;
- this.emit("error", error);
- }
- }
- else {
- // The response is not a redirect; return it as-is
+ if (!location || this._options.followRedirects === false ||
+ statusCode < 300 || statusCode >= 400) {
response.responseUrl = this._currentUrl;
response.redirects = this._redirects;
this.emit("response", response);
// Clean up
this._requestBodyBuffers = [];
+ return;
+ }
+
+ // The response is a redirect, so abort the current request
+ abortRequest(this._currentRequest);
+ // Discard the remainder of the response to avoid waiting for data
+ response.destroy();
+
+ // RFC7231§6.4: A client SHOULD detect and intervene
+ // in cyclical redirections (i.e., "infinite" redirection loops).
+ if (++this._redirectCount > this._options.maxRedirects) {
+ this.emit("error", new TooManyRedirectsError());
+ return;
+ }
+
+ // RFC7231§6.4: Automatic redirection needs to done with
+ // care for methods not known to be safe, […]
+ // RFC7231§6.4.2–3: For historical reasons, a user agent MAY change
+ // the request method from POST to GET for the subsequent request.
+ if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" ||
+ // RFC7231§6.4.4: The 303 (See Other) status code indicates that
+ // the server is redirecting the user agent to a different resource […]
+ // A user agent can perform a retrieval request targeting that URI
+ // (a GET or HEAD request if using HTTP) […]
+ (statusCode === 303) && !/^(?:GET|HEAD)$/.test(this._options.method)) {
+ this._options.method = "GET";
+ // Drop a possible entity and headers related to it
+ this._requestBodyBuffers = [];
+ removeMatchingHeaders(/^content-/i, this._options.headers);
+ }
+
+ // Drop the Host header, as the redirect might lead to a different host
+ var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
+
+ // If the redirect is relative, carry over the host of the last request
+ var currentUrlParts = url.parse(this._currentUrl);
+ var currentHost = currentHostHeader || currentUrlParts.host;
+ var currentUrl = /^\w+:/.test(location) ? this._currentUrl :
+ url.format(Object.assign(currentUrlParts, { host: currentHost }));
+
+ // Determine the URL of the redirection
+ var redirectUrl;
+ try {
+ redirectUrl = url.resolve(currentUrl, location);
+ }
+ catch (cause) {
+ this.emit("error", new RedirectionError(cause));
+ return;
+ }
+
+ // Create the redirected request
+ debug("redirecting to", redirectUrl);
+ this._isRedirect = true;
+ var redirectUrlParts = url.parse(redirectUrl);
+ Object.assign(this._options, redirectUrlParts);
+
+ // Drop confidential headers when redirecting to a less secure protocol
+ // or to a different domain that is not a superdomain
+ if (redirectUrlParts.protocol !== currentUrlParts.protocol &&
+ redirectUrlParts.protocol !== "https:" ||
+ redirectUrlParts.host !== currentHost &&
+ !isSubdomain(redirectUrlParts.host, currentHost)) {
+ removeMatchingHeaders(/^(?:authorization|cookie)$/i, this._options.headers);
+ }
+
+ // Evaluate the beforeRedirect callback
+ if (typeof this._options.beforeRedirect === "function") {
+ var responseDetails = { headers: response.headers };
+ try {
+ this._options.beforeRedirect.call(null, this._options, responseDetails);
+ }
+ catch (err) {
+ this.emit("error", err);
+ return;
+ }
+ this._sanitizeOptions(this._options);
+ }
+
+ // Perform the redirected request
+ try {
+ this._performRequest();
+ }
+ catch (cause) {
+ this.emit("error", new RedirectionError(cause));
}
};
@@ -484,13 +534,20 @@
delete headers[header];
}
}
- return lastValue;
+ return (lastValue === null || typeof lastValue === "undefined") ?
+ undefined : String(lastValue).trim();
}
function createErrorType(code, defaultMessage) {
- function CustomError(message) {
+ function CustomError(cause) {
Error.captureStackTrace(this, this.constructor);
- this.message = message || defaultMessage;
+ if (!cause) {
+ this.message = defaultMessage;
+ }
+ else {
+ this.message = defaultMessage + ": " + cause.message;
+ this.cause = cause;
+ }
}
CustomError.prototype = new Error();
CustomError.prototype.constructor = CustomError;
@@ -499,6 +556,19 @@
return CustomError;
}
+function abortRequest(request) {
+ for (var e = 0; e < events.length; e++) {
+ request.removeListener(events[e], eventHandlers[events[e]]);
+ }
+ request.on("error", noop);
+ request.abort();
+}
+
+function isSubdomain(subdomain, domain) {
+ const dot = subdomain.length - domain.length - 1;
+ return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
+}
+
// Exports
module.exports = wrap({ http: http, https: https });
module.exports.wrap = wrap;
diff --git a/node_modules/follow-redirects/package.json b/node_modules/follow-redirects/package.json
index ce94b72..742fb44 100644
--- a/node_modules/follow-redirects/package.json
+++ b/node_modules/follow-redirects/package.json
@@ -1,6 +1,6 @@
{
"name": "follow-redirects",
- "version": "1.13.2",
+ "version": "1.14.9",
"description": "HTTP and HTTPS modules that follow redirects.",
"license": "MIT",
"main": "index.js",
diff --git a/node_modules/fs-extra/CHANGELOG.md b/node_modules/fs-extra/CHANGELOG.md
deleted file mode 100644
index 3049b45..0000000
--- a/node_modules/fs-extra/CHANGELOG.md
+++ /dev/null
@@ -1,864 +0,0 @@
-8.1.0 / 2019-06-28
-------------------
-
-- Add support for promisified `fs.realpath.native` in Node v9.2+ ([#650](https://github.com/jprichardson/node-fs-extra/issues/650), [#682](https://github.com/jprichardson/node-fs-extra/pull/682))
-- Update `graceful-fs` dependency ([#700](https://github.com/jprichardson/node-fs-extra/pull/700))
-- Use `graceful-fs` everywhere ([#700](https://github.com/jprichardson/node-fs-extra/pull/700))
-
-8.0.1 / 2019-05-13
-------------------
-
-- Fix bug `Maximum call stack size exceeded` error in `util/stat` ([#679](https://github.com/jprichardson/node-fs-extra/pull/679))
-
-8.0.0 / 2019-05-11
-------------------
-
-**NOTE:** Node.js v6 support is deprecated, and will be dropped in the next major release.
-
-- Use `renameSync()` under the hood in `moveSync()`
-- Fix bug with bind-mounted directories in `copy*()` ([#613](https://github.com/jprichardson/node-fs-extra/issues/613), [#618](https://github.com/jprichardson/node-fs-extra/pull/618))
-- Fix bug in `move()` with case-insensitive file systems
-- Use `fs.stat()`'s `bigint` option in `copy*()` & `move*()` where possible ([#657](https://github.com/jprichardson/node-fs-extra/issues/657))
-
-7.0.1 / 2018-11-07
-------------------
-
-- Fix `removeSync()` on Windows, in some cases, it would error out with `ENOTEMPTY` ([#646](https://github.com/jprichardson/node-fs-extra/pull/646))
-- Document `mode` option for `ensureDir*()` ([#587](https://github.com/jprichardson/node-fs-extra/pull/587))
-- Don't include documentation files in npm package tarball ([#642](https://github.com/jprichardson/node-fs-extra/issues/642), [#643](https://github.com/jprichardson/node-fs-extra/pull/643))
-
-7.0.0 / 2018-07-16
-------------------
-
-- **BREAKING:** Refine `copy*()` handling of symlinks to properly detect symlinks that point to the same file. ([#582](https://github.com/jprichardson/node-fs-extra/pull/582))
-- Fix bug with copying write-protected directories ([#600](https://github.com/jprichardson/node-fs-extra/pull/600))
-- Universalify `fs.lchmod()` ([#596](https://github.com/jprichardson/node-fs-extra/pull/596))
-- Add `engines` field to `package.json` ([#580](https://github.com/jprichardson/node-fs-extra/pull/580))
-
-6.0.1 / 2018-05-09
-------------------
-
-- Fix `fs.promises` `ExperimentalWarning` on Node v10.1.0 ([#578](https://github.com/jprichardson/node-fs-extra/pull/578))
-
-6.0.0 / 2018-05-01
-------------------
-
-- Drop support for Node.js versions 4, 5, & 7 ([#564](https://github.com/jprichardson/node-fs-extra/pull/564))
-- Rewrite `move` to use `fs.rename` where possible ([#549](https://github.com/jprichardson/node-fs-extra/pull/549))
-- Don't convert relative paths to absolute paths for `filter` ([#554](https://github.com/jprichardson/node-fs-extra/pull/554))
-- `copy*`'s behavior when `preserveTimestamps` is `false` has been OS-dependent since 5.0.0, but that's now explicitly noted in the docs ([#563](https://github.com/jprichardson/node-fs-extra/pull/563))
-- Fix subdirectory detection for `copy*` & `move*` ([#541](https://github.com/jprichardson/node-fs-extra/pull/541))
-- Handle case-insensitive paths correctly in `copy*` ([#568](https://github.com/jprichardson/node-fs-extra/pull/568))
-
-5.0.0 / 2017-12-11
-------------------
-
-Significant refactor of `copy()` & `copySync()`, including breaking changes. No changes to other functions in this release.
-
-Huge thanks to **[@manidlou](https://github.com/manidlou)** for doing most of the work on this release.
-
-- The `filter` option can no longer be a RegExp (must be a function). This was deprecated since fs-extra v1.0.0. [#512](https://github.com/jprichardson/node-fs-extra/pull/512)
-- `copy()`'s `filter` option can now be a function that returns a Promise. [#518](https://github.com/jprichardson/node-fs-extra/pull/518)
-- `copy()` & `copySync()` now use `fs.copyFile()`/`fs.copyFileSync()` in environments that support it (currently Node 8.5.0+). Older Node versions still get the old implementation. [#505](https://github.com/jprichardson/node-fs-extra/pull/505)
-- Don't allow copying a directory into itself. [#83](https://github.com/jprichardson/node-fs-extra/issues/83)
-- Handle copying between identical files. [#198](https://github.com/jprichardson/node-fs-extra/issues/198)
-- Error out when copying an empty folder to a path that already exists. [#464](https://github.com/jprichardson/node-fs-extra/issues/464)
-- Don't create `dest`'s parent if the `filter` function aborts the `copy()` operation. [#517](https://github.com/jprichardson/node-fs-extra/pull/517)
-- Fix `writeStream` not being closed if there was an error in `copy()`. [#516](https://github.com/jprichardson/node-fs-extra/pull/516)
-
-4.0.3 / 2017-12-05
-------------------
-
-- Fix wrong `chmod` values in `fs.remove()` [#501](https://github.com/jprichardson/node-fs-extra/pull/501)
-- Fix `TypeError` on systems that don't have some `fs` operations like `lchown` [#520](https://github.com/jprichardson/node-fs-extra/pull/520)
-
-4.0.2 / 2017-09-12
-------------------
-
-- Added `EOL` option to `writeJson*` & `outputJson*` (via upgrade to jsonfile v4)
-- Added promise support to [`fs.copyFile()`](https://nodejs.org/api/fs.html#fs_fs_copyfile_src_dest_flags_callback) in Node 8.5+
-- Added `.js` extension to `main` field in `package.json` for better tooling compatibility. [#485](https://github.com/jprichardson/node-fs-extra/pull/485)
-
-4.0.1 / 2017-07-31
-------------------
-
-### Fixed
-
-- Previously, `ensureFile()` & `ensureFileSync()` would do nothing if the path was a directory. Now, they error out for consistency with `ensureDir()`. [#465](https://github.com/jprichardson/node-fs-extra/issues/465), [#466](https://github.com/jprichardson/node-fs-extra/pull/466), [#470](https://github.com/jprichardson/node-fs-extra/issues/470)
-
-4.0.0 / 2017-07-14
-------------------
-
-### Changed
-
-- **BREAKING:** The promisified versions of `fs.read()` & `fs.write()` now return objects. See [the docs](docs/fs-read-write.md) for details. [#436](https://github.com/jprichardson/node-fs-extra/issues/436), [#449](https://github.com/jprichardson/node-fs-extra/pull/449)
-- `fs.move()` now errors out when destination is a subdirectory of source. [#458](https://github.com/jprichardson/node-fs-extra/pull/458)
-- Applied upstream fixes from `rimraf` to `fs.remove()` & `fs.removeSync()`. [#459](https://github.com/jprichardson/node-fs-extra/pull/459)
-
-### Fixed
-
-- Got `fs.outputJSONSync()` working again; it was broken due to refactoring. [#428](https://github.com/jprichardson/node-fs-extra/pull/428)
-
-Also clarified the docs in a few places.
-
-3.0.1 / 2017-05-04
-------------------
-
-- Fix bug in `move()` & `moveSync()` when source and destination are the same, and source does not exist. [#415](https://github.com/jprichardson/node-fs-extra/pull/415)
-
-3.0.0 / 2017-04-27
-------------------
-
-### Added
-
-- **BREAKING:** Added Promise support. All asynchronous native fs methods and fs-extra methods now return a promise if the callback is not passed. [#403](https://github.com/jprichardson/node-fs-extra/pull/403)
-- `pathExists()`, a replacement for the deprecated `fs.exists`. `pathExists` has a normal error-first callback signature. Also added `pathExistsSync`, an alias to `fs.existsSync`, for completeness. [#406](https://github.com/jprichardson/node-fs-extra/pull/406)
-
-### Removed
-
-- **BREAKING:** Removed support for setting the default spaces for `writeJson()`, `writeJsonSync()`, `outputJson()`, & `outputJsonSync()`. This was undocumented. [#402](https://github.com/jprichardson/node-fs-extra/pull/402)
-
-### Changed
-
-- Upgraded jsonfile dependency to v3.0.0:
- - **BREAKING:** Changed behavior of `throws` option for `readJsonSync()`; now does not throw filesystem errors when `throws` is `false`.
-- **BREAKING:** `writeJson()`, `writeJsonSync()`, `outputJson()`, & `outputJsonSync()` now output minified JSON by default for consistency with `JSON.stringify()`; set the `spaces` option to `2` to override this new behavior. [#402](https://github.com/jprichardson/node-fs-extra/pull/402)
-- Use `Buffer.allocUnsafe()` instead of `new Buffer()` in environments that support it. [#394](https://github.com/jprichardson/node-fs-extra/pull/394)
-
-### Fixed
-
-- `removeSync()` silently failed on Windows in some cases. Now throws an `EBUSY` error. [#408](https://github.com/jprichardson/node-fs-extra/pull/408)
-
-2.1.2 / 2017-03-16
-------------------
-
-### Fixed
-
-- Weird windows bug that resulted in `ensureDir()`'s callback being called twice in some cases. This bug may have also affected `remove()`. See [#392](https://github.com/jprichardson/node-fs-extra/issues/392), [#393](https://github.com/jprichardson/node-fs-extra/pull/393)
-
-2.1.1 / 2017-03-15
-------------------
-
-### Fixed
-
-- Reverted [`5597bd`](https://github.com/jprichardson/node-fs-extra/commit/5597bd5b67f7d060f5f5bf26e9635be48330f5d7), this broke compatibility with Node.js versions v4+ but less than `v4.5.0`.
-- Remove `Buffer.alloc()` usage in `moveSync()`.
-
-2.1.0 / 2017-03-15
-------------------
-
-Thanks to [Mani Maghsoudlou (@manidlou)](https://github.com/manidlou) & [Jan Peer Stöcklmair (@JPeer264)](https://github.com/JPeer264) for their extraordinary help with this release!
-
-### Added
-- `moveSync()` See [#309], [#381](https://github.com/jprichardson/node-fs-extra/pull/381). ([@manidlou](https://github.com/manidlou))
-- `copy()` and `copySync()`'s `filter` option now gets the destination path passed as the second parameter. [#366](https://github.com/jprichardson/node-fs-extra/pull/366) ([@manidlou](https://github.com/manidlou))
-
-### Changed
-- Use `Buffer.alloc()` instead of deprecated `new Buffer()` in `copySync()`. [#380](https://github.com/jprichardson/node-fs-extra/pull/380) ([@manidlou](https://github.com/manidlou))
-- Refactored entire codebase to use ES6 features supported by Node.js v4+ [#355](https://github.com/jprichardson/node-fs-extra/issues/355). [(@JPeer264)](https://github.com/JPeer264)
-- Refactored docs. ([@manidlou](https://github.com/manidlou))
-
-### Fixed
-
-- `move()` shouldn't error out when source and dest are the same. [#377](https://github.com/jprichardson/node-fs-extra/issues/377), [#378](https://github.com/jprichardson/node-fs-extra/pull/378) ([@jdalton](https://github.com/jdalton))
-
-2.0.0 / 2017-01-16
-------------------
-
-### Removed
-- **BREAKING:** Removed support for Node `v0.12`. The Node foundation stopped officially supporting it
-on Jan 1st, 2017.
-- **BREAKING:** Remove `walk()` and `walkSync()`. `walkSync()` was only part of `fs-extra` for a little
-over two months. Use [klaw](https://github.com/jprichardson/node-klaw) instead of `walk()`, in fact, `walk()` was just
-an alias to klaw. For `walkSync()` use [klaw-sync](https://github.com/mawni/node-klaw-sync). See: [#338], [#339]
-
-### Changed
-- **BREAKING:** Renamed `clobber` to `overwrite`. This affects `copy()`, `copySync()`, and `move()`. [#330], [#333]
-- Moved docs, to `docs/`. [#340]
-
-### Fixed
-- Apply filters to directories in `copySync()` like in `copy()`. [#324]
-- A specific condition when disk is under heavy use, `copy()` can fail. [#326]
-
-
-1.0.0 / 2016-11-01
-------------------
-
-After five years of development, we finally have reach the 1.0.0 milestone! Big thanks goes
-to [Ryan Zim](https://github.com/RyanZim) for leading the charge on this release!
-
-### Added
-- `walkSync()`
-
-### Changed
-- **BREAKING**: dropped Node v0.10 support.
-- disabled `rimaf` globbing, wasn't used. [#280]
-- deprecate `copy()/copySync()` option `filter` if it's a `RegExp`. `filter` should now be a function.
-- inline `rimraf`. This is temporary and was done because `rimraf` depended upon the beefy `glob` which `fs-extra` does not use. [#300]
-
-### Fixed
-- bug fix proper closing of file handle on `utimesMillis()` [#271]
-- proper escaping of files with dollar signs [#291]
-- `copySync()` failed if user didn't own file. [#199], [#301]
-
-
-0.30.0 / 2016-04-28
--------------------
-- Brought back Node v0.10 support. I didn't realize there was still demand. Official support will end **2016-10-01**.
-
-0.29.0 / 2016-04-27
--------------------
-- **BREAKING**: removed support for Node v0.10. If you still want to use Node v0.10, everything should work except for `ensureLink()/ensureSymlink()`. Node v0.12 is still supported but will be dropped in the near future as well.
-
-0.28.0 / 2016-04-17
--------------------
-- **BREAKING**: removed `createOutputStream()`. Use https://www.npmjs.com/package/create-output-stream. See: [#192][#192]
-- `mkdirs()/mkdirsSync()` check for invalid win32 path chars. See: [#209][#209], [#237][#237]
-- `mkdirs()/mkdirsSync()` if drive not mounted, error. See: [#93][#93]
-
-0.27.0 / 2016-04-15
--------------------
-- add `dereference` option to `copySync()`. [#235][#235]
-
-0.26.7 / 2016-03-16
--------------------
-- fixed `copy()` if source and dest are the same. [#230][#230]
-
-0.26.6 / 2016-03-15
--------------------
-- fixed if `emptyDir()` does not have a callback: [#229][#229]
-
-0.26.5 / 2016-01-27
--------------------
-- `copy()` with two arguments (w/o callback) was broken. See: [#215][#215]
-
-0.26.4 / 2016-01-05
--------------------
-- `copySync()` made `preserveTimestamps` default consistent with `copy()` which is `false`. See: [#208][#208]
-
-0.26.3 / 2015-12-17
--------------------
-- fixed `copy()` hangup in copying blockDevice / characterDevice / `/dev/null`. See: [#193][#193]
-
-0.26.2 / 2015-11-02
--------------------
-- fixed `outputJson{Sync}()` spacing adherence to `fs.spaces`
-
-0.26.1 / 2015-11-02
--------------------
-- fixed `copySync()` when `clogger=true` and the destination is read only. See: [#190][#190]
-
-0.26.0 / 2015-10-25
--------------------
-- extracted the `walk()` function into its own module [`klaw`](https://github.com/jprichardson/node-klaw).
-
-0.25.0 / 2015-10-24
--------------------
-- now has a file walker `walk()`
-
-0.24.0 / 2015-08-28
--------------------
-- removed alias `delete()` and `deleteSync()`. See: [#171][#171]
-
-0.23.1 / 2015-08-07
--------------------
-- Better handling of errors for `move()` when moving across devices. [#170][#170]
-- `ensureSymlink()` and `ensureLink()` should not throw errors if link exists. [#169][#169]
-
-0.23.0 / 2015-08-06
--------------------
-- added `ensureLink{Sync}()` and `ensureSymlink{Sync}()`. See: [#165][#165]
-
-0.22.1 / 2015-07-09
--------------------
-- Prevent calling `hasMillisResSync()` on module load. See: [#149][#149].
-Fixes regression that was introduced in `0.21.0`.
-
-0.22.0 / 2015-07-09
--------------------
-- preserve permissions / ownership in `copy()`. See: [#54][#54]
-
-0.21.0 / 2015-07-04
--------------------
-- add option to preserve timestamps in `copy()` and `copySync()`. See: [#141][#141]
-- updated `graceful-fs@3.x` to `4.x`. This brings in features from `amazing-graceful-fs` (much cleaner code / less hacks)
-
-0.20.1 / 2015-06-23
--------------------
-- fixed regression caused by latest jsonfile update: See: https://github.com/jprichardson/node-jsonfile/issues/26
-
-0.20.0 / 2015-06-19
--------------------
-- removed `jsonfile` aliases with `File` in the name, they weren't documented and probably weren't in use e.g.
-this package had both `fs.readJsonFile` and `fs.readJson` that were aliases to each other, now use `fs.readJson`.
-- preliminary walker created. Intentionally not documented. If you use it, it will almost certainly change and break your code.
-- started moving tests inline
-- upgraded to `jsonfile@2.1.0`, can now pass JSON revivers/replacers to `readJson()`, `writeJson()`, `outputJson()`
-
-0.19.0 / 2015-06-08
--------------------
-- `fs.copy()` had support for Node v0.8, dropped support
-
-0.18.4 / 2015-05-22
--------------------
-- fixed license field according to this: [#136][#136] and https://github.com/npm/npm/releases/tag/v2.10.0
-
-0.18.3 / 2015-05-08
--------------------
-- bugfix: handle `EEXIST` when clobbering on some Linux systems. [#134][#134]
-
-0.18.2 / 2015-04-17
--------------------
-- bugfix: allow `F_OK` ([#120][#120])
-
-0.18.1 / 2015-04-15
--------------------
-- improved windows support for `move()` a bit. https://github.com/jprichardson/node-fs-extra/commit/92838980f25dc2ee4ec46b43ee14d3c4a1d30c1b
-- fixed a lot of tests for Windows (appveyor)
-
-0.18.0 / 2015-03-31
--------------------
-- added `emptyDir()` and `emptyDirSync()`
-
-0.17.0 / 2015-03-28
--------------------
-- `copySync` added `clobber` option (before always would clobber, now if `clobber` is `false` it throws an error if the destination exists).
-**Only works with files at the moment.**
-- `createOutputStream()` added. See: [#118][#118]
-
-0.16.5 / 2015-03-08
--------------------
-- fixed `fs.move` when `clobber` is `true` and destination is a directory, it should clobber. [#114][#114]
-
-0.16.4 / 2015-03-01
--------------------
-- `fs.mkdirs` fix infinite loop on Windows. See: See https://github.com/substack/node-mkdirp/pull/74 and https://github.com/substack/node-mkdirp/issues/66
-
-0.16.3 / 2015-01-28
--------------------
-- reverted https://github.com/jprichardson/node-fs-extra/commit/1ee77c8a805eba5b99382a2591ff99667847c9c9
-
-
-0.16.2 / 2015-01-28
--------------------
-- fixed `fs.copy` for Node v0.8 (support is temporary and will be removed in the near future)
-
-0.16.1 / 2015-01-28
--------------------
-- if `setImmediate` is not available, fall back to `process.nextTick`
-
-0.16.0 / 2015-01-28
--------------------
-- bugfix `fs.move()` into itself. Closes [#104]
-- bugfix `fs.move()` moving directory across device. Closes [#108]
-- added coveralls support
-- bugfix: nasty multiple callback `fs.copy()` bug. Closes [#98]
-- misc fs.copy code cleanups
-
-0.15.0 / 2015-01-21
--------------------
-- dropped `ncp`, imported code in
-- because of previous, now supports `io.js`
-- `graceful-fs` is now a dependency
-
-0.14.0 / 2015-01-05
--------------------
-- changed `copy`/`copySync` from `fs.copy(src, dest, [filters], callback)` to `fs.copy(src, dest, [options], callback)` [#100][#100]
-- removed mockfs tests for mkdirp (this may be temporary, but was getting in the way of other tests)
-
-0.13.0 / 2014-12-10
--------------------
-- removed `touch` and `touchSync` methods (they didn't handle permissions like UNIX touch)
-- updated `"ncp": "^0.6.0"` to `"ncp": "^1.0.1"`
-- imported `mkdirp` => `minimist` and `mkdirp` are no longer dependences, should now appease people who wanted `mkdirp` to be `--use_strict` safe. See [#59]([#59][#59])
-
-0.12.0 / 2014-09-22
--------------------
-- copy symlinks in `copySync()` [#85][#85]
-
-0.11.1 / 2014-09-02
--------------------
-- bugfix `copySync()` preserve file permissions [#80][#80]
-
-0.11.0 / 2014-08-11
--------------------
-- upgraded `"ncp": "^0.5.1"` to `"ncp": "^0.6.0"`
-- upgrade `jsonfile": "^1.2.0"` to `jsonfile": "^2.0.0"` => on write, json files now have `\n` at end. Also adds `options.throws` to `readJsonSync()`
-see https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options for more details.
-
-0.10.0 / 2014-06-29
-------------------
-* bugfix: upgaded `"jsonfile": "~1.1.0"` to `"jsonfile": "^1.2.0"`, bumped minor because of `jsonfile` dep change
-from `~` to `^`. [#67]
-
-0.9.1 / 2014-05-22
-------------------
-* removed Node.js `0.8.x` support, `0.9.0` was published moments ago and should have been done there
-
-0.9.0 / 2014-05-22
-------------------
-* upgraded `ncp` from `~0.4.2` to `^0.5.1`, [#58]
-* upgraded `rimraf` from `~2.2.6` to `^2.2.8`
-* upgraded `mkdirp` from `0.3.x` to `^0.5.0`
-* added methods `ensureFile()`, `ensureFileSync()`
-* added methods `ensureDir()`, `ensureDirSync()` [#31]
-* added `move()` method. From: https://github.com/andrewrk/node-mv
-
-
-0.8.1 / 2013-10-24
-------------------
-* copy failed to return an error to the callback if a file doesn't exist (ulikoehler [#38], [#39])
-
-0.8.0 / 2013-10-14
-------------------
-* `filter` implemented on `copy()` and `copySync()`. (Srirangan / [#36])
-
-0.7.1 / 2013-10-12
-------------------
-* `copySync()` implemented (Srirangan / [#33])
-* updated to the latest `jsonfile` version `1.1.0` which gives `options` params for the JSON methods. Closes [#32]
-
-0.7.0 / 2013-10-07
-------------------
-* update readme conventions
-* `copy()` now works if destination directory does not exist. Closes [#29]
-
-0.6.4 / 2013-09-05
-------------------
-* changed `homepage` field in package.json to remove NPM warning
-
-0.6.3 / 2013-06-28
-------------------
-* changed JSON spacing default from `4` to `2` to follow Node conventions
-* updated `jsonfile` dep
-* updated `rimraf` dep
-
-0.6.2 / 2013-06-28
-------------------
-* added .npmignore, [#25]
-
-0.6.1 / 2013-05-14
-------------------
-* modified for `strict` mode, closes [#24]
-* added `outputJson()/outputJsonSync()`, closes [#23]
-
-0.6.0 / 2013-03-18
-------------------
-* removed node 0.6 support
-* added node 0.10 support
-* upgraded to latest `ncp` and `rimraf`.
-* optional `graceful-fs` support. Closes [#17]
-
-
-0.5.0 / 2013-02-03
-------------------
-* Removed `readTextFile`.
-* Renamed `readJSONFile` to `readJSON` and `readJson`, same with write.
-* Restructured documentation a bit. Added roadmap.
-
-0.4.0 / 2013-01-28
-------------------
-* Set default spaces in `jsonfile` from 4 to 2.
-* Updated `testutil` deps for tests.
-* Renamed `touch()` to `createFile()`
-* Added `outputFile()` and `outputFileSync()`
-* Changed creation of testing diretories so the /tmp dir is not littered.
-* Added `readTextFile()` and `readTextFileSync()`.
-
-0.3.2 / 2012-11-01
-------------------
-* Added `touch()` and `touchSync()` methods.
-
-0.3.1 / 2012-10-11
-------------------
-* Fixed some stray globals.
-
-0.3.0 / 2012-10-09
-------------------
-* Removed all CoffeeScript from tests.
-* Renamed `mkdir` to `mkdirs`/`mkdirp`.
-
-0.2.1 / 2012-09-11
-------------------
-* Updated `rimraf` dep.
-
-0.2.0 / 2012-09-10
-------------------
-* Rewrote module into JavaScript. (Must still rewrite tests into JavaScript)
-* Added all methods of [jsonfile](https://github.com/jprichardson/node-jsonfile)
-* Added Travis-CI.
-
-0.1.3 / 2012-08-13
-------------------
-* Added method `readJSONFile`.
-
-0.1.2 / 2012-06-15
-------------------
-* Bug fix: `deleteSync()` didn't exist.
-* Verified Node v0.8 compatibility.
-
-0.1.1 / 2012-06-15
-------------------
-* Fixed bug in `remove()`/`delete()` that wouldn't execute the function if a callback wasn't passed.
-
-0.1.0 / 2012-05-31
-------------------
-* Renamed `copyFile()` to `copy()`. `copy()` can now copy directories (recursively) too.
-* Renamed `rmrf()` to `remove()`.
-* `remove()` aliased with `delete()`.
-* Added `mkdirp` capabilities. Named: `mkdir()`. Hides Node.js native `mkdir()`.
-* Instead of exporting the native `fs` module with new functions, I now copy over the native methods to a new object and export that instead.
-
-0.0.4 / 2012-03-14
-------------------
-* Removed CoffeeScript dependency
-
-0.0.3 / 2012-01-11
-------------------
-* Added methods rmrf and rmrfSync
-* Moved tests from Jasmine to Mocha
-
-
-[#344]: https://github.com/jprichardson/node-fs-extra/issues/344 "Licence Year"
-[#343]: https://github.com/jprichardson/node-fs-extra/pull/343 "Add klaw-sync link to readme"
-[#342]: https://github.com/jprichardson/node-fs-extra/pull/342 "allow preserveTimestamps when use move"
-[#341]: https://github.com/jprichardson/node-fs-extra/issues/341 "mkdirp(path.dirname(dest) in move() logic needs cleaning up [question]"
-[#340]: https://github.com/jprichardson/node-fs-extra/pull/340 "Move docs to seperate docs folder [documentation]"
-[#339]: https://github.com/jprichardson/node-fs-extra/pull/339 "Remove walk() & walkSync() [feature-walk]"
-[#338]: https://github.com/jprichardson/node-fs-extra/issues/338 "Remove walk() and walkSync() [feature-walk]"
-[#337]: https://github.com/jprichardson/node-fs-extra/issues/337 "copy doesn't return a yieldable value"
-[#336]: https://github.com/jprichardson/node-fs-extra/pull/336 "Docs enhanced walk sync [documentation, feature-walk]"
-[#335]: https://github.com/jprichardson/node-fs-extra/pull/335 "Refactor move() tests [feature-move]"
-[#334]: https://github.com/jprichardson/node-fs-extra/pull/334 "Cleanup lib/move/index.js [feature-move]"
-[#333]: https://github.com/jprichardson/node-fs-extra/pull/333 "Rename clobber to overwrite [feature-copy, feature-move]"
-[#332]: https://github.com/jprichardson/node-fs-extra/pull/332 "BREAKING: Drop Node v0.12 & io.js support"
-[#331]: https://github.com/jprichardson/node-fs-extra/issues/331 "Add support for chmodr [enhancement, future]"
-[#330]: https://github.com/jprichardson/node-fs-extra/pull/330 "BREAKING: Do not error when copy destination exists & clobber: false [feature-copy]"
-[#329]: https://github.com/jprichardson/node-fs-extra/issues/329 "Does .walk() scale to large directories? [question]"
-[#328]: https://github.com/jprichardson/node-fs-extra/issues/328 "Copying files corrupts [feature-copy, needs-confirmed]"
-[#327]: https://github.com/jprichardson/node-fs-extra/pull/327 "Use writeStream 'finish' event instead of 'close' [bug, feature-copy]"
-[#326]: https://github.com/jprichardson/node-fs-extra/issues/326 "fs.copy fails with chmod error when disk under heavy use [bug, feature-copy]"
-[#325]: https://github.com/jprichardson/node-fs-extra/issues/325 "ensureDir is difficult to promisify [enhancement]"
-[#324]: https://github.com/jprichardson/node-fs-extra/pull/324 "copySync() should apply filter to directories like copy() [bug, feature-copy]"
-[#323]: https://github.com/jprichardson/node-fs-extra/issues/323 "Support for `dest` being a directory when using `copy*()`?"
-[#322]: https://github.com/jprichardson/node-fs-extra/pull/322 "Add fs-promise as fs-extra-promise alternative"
-[#321]: https://github.com/jprichardson/node-fs-extra/issues/321 "fs.copy() with clobber set to false return EEXIST error [feature-copy]"
-[#320]: https://github.com/jprichardson/node-fs-extra/issues/320 "fs.copySync: Error: EPERM: operation not permitted, unlink "
-[#319]: https://github.com/jprichardson/node-fs-extra/issues/319 "Create directory if not exists"
-[#318]: https://github.com/jprichardson/node-fs-extra/issues/318 "Support glob patterns [enhancement, future]"
-[#317]: https://github.com/jprichardson/node-fs-extra/pull/317 "Adding copy sync test for src file without write perms"
-[#316]: https://github.com/jprichardson/node-fs-extra/pull/316 "Remove move()'s broken limit option [feature-move]"
-[#315]: https://github.com/jprichardson/node-fs-extra/pull/315 "Fix move clobber tests to work around graceful-fs bug."
-[#314]: https://github.com/jprichardson/node-fs-extra/issues/314 "move() limit option [documentation, enhancement, feature-move]"
-[#313]: https://github.com/jprichardson/node-fs-extra/pull/313 "Test that remove() ignores glob characters."
-[#312]: https://github.com/jprichardson/node-fs-extra/pull/312 "Enhance walkSync() to return items with path and stats [feature-walk]"
-[#311]: https://github.com/jprichardson/node-fs-extra/issues/311 "move() not work when dest name not provided [feature-move]"
-[#310]: https://github.com/jprichardson/node-fs-extra/issues/310 "Edit walkSync to return items like what walk emits [documentation, enhancement, feature-walk]"
-[#309]: https://github.com/jprichardson/node-fs-extra/issues/309 "moveSync support [enhancement, feature-move]"
-[#308]: https://github.com/jprichardson/node-fs-extra/pull/308 "Fix incorrect anchor link"
-[#307]: https://github.com/jprichardson/node-fs-extra/pull/307 "Fix coverage"
-[#306]: https://github.com/jprichardson/node-fs-extra/pull/306 "Update devDeps, fix lint error"
-[#305]: https://github.com/jprichardson/node-fs-extra/pull/305 "Re-add Coveralls"
-[#304]: https://github.com/jprichardson/node-fs-extra/pull/304 "Remove path-is-absolute [enhancement]"
-[#303]: https://github.com/jprichardson/node-fs-extra/pull/303 "Document copySync filter inconsistency [documentation, feature-copy]"
-[#302]: https://github.com/jprichardson/node-fs-extra/pull/302 "fix(console): depreciated -> deprecated"
-[#301]: https://github.com/jprichardson/node-fs-extra/pull/301 "Remove chmod call from copySync [feature-copy]"
-[#300]: https://github.com/jprichardson/node-fs-extra/pull/300 "Inline Rimraf [enhancement, feature-move, feature-remove]"
-[#299]: https://github.com/jprichardson/node-fs-extra/pull/299 "Warn when filter is a RegExp [feature-copy]"
-[#298]: https://github.com/jprichardson/node-fs-extra/issues/298 "API Docs [documentation]"
-[#297]: https://github.com/jprichardson/node-fs-extra/pull/297 "Warn about using preserveTimestamps on 32-bit node"
-[#296]: https://github.com/jprichardson/node-fs-extra/pull/296 "Improve EEXIST error message for copySync [enhancement]"
-[#295]: https://github.com/jprichardson/node-fs-extra/pull/295 "Depreciate using regular expressions for copy's filter option [documentation]"
-[#294]: https://github.com/jprichardson/node-fs-extra/pull/294 "BREAKING: Refactor lib/copy/ncp.js [feature-copy]"
-[#293]: https://github.com/jprichardson/node-fs-extra/pull/293 "Update CI configs"
-[#292]: https://github.com/jprichardson/node-fs-extra/issues/292 "Rewrite lib/copy/ncp.js [enhancement, feature-copy]"
-[#291]: https://github.com/jprichardson/node-fs-extra/pull/291 "Escape '$' in replacement string for async file copying"
-[#290]: https://github.com/jprichardson/node-fs-extra/issues/290 "Exclude files pattern while copying using copy.config.js [question]"
-[#289]: https://github.com/jprichardson/node-fs-extra/pull/289 "(Closes #271) lib/util/utimes: properly close file descriptors in the event of an error"
-[#288]: https://github.com/jprichardson/node-fs-extra/pull/288 "(Closes #271) lib/util/utimes: properly close file descriptors in the event of an error"
-[#287]: https://github.com/jprichardson/node-fs-extra/issues/287 "emptyDir() callback arguments are inconsistent [enhancement, feature-remove]"
-[#286]: https://github.com/jprichardson/node-fs-extra/pull/286 "Added walkSync function"
-[#285]: https://github.com/jprichardson/node-fs-extra/issues/285 "CITGM test failing on s390"
-[#284]: https://github.com/jprichardson/node-fs-extra/issues/284 "outputFile method is missing a check to determine if existing item is a folder or not"
-[#283]: https://github.com/jprichardson/node-fs-extra/pull/283 "Apply filter also on directories and symlinks for copySync()"
-[#282]: https://github.com/jprichardson/node-fs-extra/pull/282 "Apply filter also on directories and symlinks for copySync()"
-[#281]: https://github.com/jprichardson/node-fs-extra/issues/281 "remove function executes 'successfully' but doesn't do anything?"
-[#280]: https://github.com/jprichardson/node-fs-extra/pull/280 "Disable rimraf globbing"
-[#279]: https://github.com/jprichardson/node-fs-extra/issues/279 "Some code is vendored instead of included [awaiting-reply]"
-[#278]: https://github.com/jprichardson/node-fs-extra/issues/278 "copy() does not preserve file/directory ownership"
-[#277]: https://github.com/jprichardson/node-fs-extra/pull/277 "Mention defaults for clobber and dereference options"
-[#276]: https://github.com/jprichardson/node-fs-extra/issues/276 "Cannot connect to Shared Folder [awaiting-reply]"
-[#275]: https://github.com/jprichardson/node-fs-extra/issues/275 "EMFILE, too many open files on Mac OS with JSON API"
-[#274]: https://github.com/jprichardson/node-fs-extra/issues/274 "Use with memory-fs? [enhancement, future]"
-[#273]: https://github.com/jprichardson/node-fs-extra/pull/273 "tests: rename `remote.test.js` to `remove.test.js`"
-[#272]: https://github.com/jprichardson/node-fs-extra/issues/272 "Copy clobber flag never err even when true [bug, feature-copy]"
-[#271]: https://github.com/jprichardson/node-fs-extra/issues/271 "Unclosed file handle on futimes error"
-[#270]: https://github.com/jprichardson/node-fs-extra/issues/270 "copy not working as desired on Windows [feature-copy, platform-windows]"
-[#269]: https://github.com/jprichardson/node-fs-extra/issues/269 "Copying with preserveTimeStamps: true is inaccurate using 32bit node [feature-copy]"
-[#268]: https://github.com/jprichardson/node-fs-extra/pull/268 "port fix for mkdirp issue #111"
-[#267]: https://github.com/jprichardson/node-fs-extra/issues/267 "WARN deprecated wrench@1.5.9: wrench.js is deprecated!"
-[#266]: https://github.com/jprichardson/node-fs-extra/issues/266 "fs-extra"
-[#265]: https://github.com/jprichardson/node-fs-extra/issues/265 "Link the `fs.stat fs.exists` etc. methods for replace the `fs` module forever?"
-[#264]: https://github.com/jprichardson/node-fs-extra/issues/264 "Renaming a file using move fails when a file inside is open (at least on windows) [wont-fix]"
-[#263]: https://github.com/jprichardson/node-fs-extra/issues/263 "ENOSYS: function not implemented, link [needs-confirmed]"
-[#262]: https://github.com/jprichardson/node-fs-extra/issues/262 "Add .exists() and .existsSync()"
-[#261]: https://github.com/jprichardson/node-fs-extra/issues/261 "Cannot read property 'prototype' of undefined"
-[#260]: https://github.com/jprichardson/node-fs-extra/pull/260 "use more specific path for method require"
-[#259]: https://github.com/jprichardson/node-fs-extra/issues/259 "Feature Request: isEmpty"
-[#258]: https://github.com/jprichardson/node-fs-extra/issues/258 "copy files does not preserve file timestamp"
-[#257]: https://github.com/jprichardson/node-fs-extra/issues/257 "Copying a file on windows fails"
-[#256]: https://github.com/jprichardson/node-fs-extra/pull/256 "Updated Readme "
-[#255]: https://github.com/jprichardson/node-fs-extra/issues/255 "Update rimraf required version"
-[#254]: https://github.com/jprichardson/node-fs-extra/issues/254 "request for readTree, readTreeSync, walkSync method"
-[#253]: https://github.com/jprichardson/node-fs-extra/issues/253 "outputFile does not touch mtime when file exists"
-[#252]: https://github.com/jprichardson/node-fs-extra/pull/252 "Fixing problem when copying file with no write permission"
-[#251]: https://github.com/jprichardson/node-fs-extra/issues/251 "Just wanted to say thank you"
-[#250]: https://github.com/jprichardson/node-fs-extra/issues/250 "`fs.remove()` not removing files (works with `rm -rf`)"
-[#249]: https://github.com/jprichardson/node-fs-extra/issues/249 "Just a Question ... Remove Servers"
-[#248]: https://github.com/jprichardson/node-fs-extra/issues/248 "Allow option to not preserve permissions for copy"
-[#247]: https://github.com/jprichardson/node-fs-extra/issues/247 "Add TypeScript typing directly in the fs-extra package"
-[#246]: https://github.com/jprichardson/node-fs-extra/issues/246 "fse.remove() && fse.removeSync() don't throw error on ENOENT file"
-[#245]: https://github.com/jprichardson/node-fs-extra/issues/245 "filter for empty dir [enhancement]"
-[#244]: https://github.com/jprichardson/node-fs-extra/issues/244 "copySync doesn't apply the filter to directories"
-[#243]: https://github.com/jprichardson/node-fs-extra/issues/243 "Can I request fs.walk() to be synchronous?"
-[#242]: https://github.com/jprichardson/node-fs-extra/issues/242 "Accidentally truncates file names ending with $$ [bug, feature-copy]"
-[#241]: https://github.com/jprichardson/node-fs-extra/pull/241 "Remove link to createOutputStream"
-[#240]: https://github.com/jprichardson/node-fs-extra/issues/240 "walkSync request"
-[#239]: https://github.com/jprichardson/node-fs-extra/issues/239 "Depreciate regular expressions for copy's filter [documentation, feature-copy]"
-[#238]: https://github.com/jprichardson/node-fs-extra/issues/238 "Can't write to files while in a worker thread."
-[#237]: https://github.com/jprichardson/node-fs-extra/issues/237 ".ensureDir(..) fails silently when passed an invalid path..."
-[#236]: https://github.com/jprichardson/node-fs-extra/issues/236 "[Removed] Filed under wrong repo"
-[#235]: https://github.com/jprichardson/node-fs-extra/pull/235 "Adds symlink dereference option to `fse.copySync` (#191)"
-[#234]: https://github.com/jprichardson/node-fs-extra/issues/234 "ensureDirSync fails silent when EACCES: permission denied on travis-ci"
-[#233]: https://github.com/jprichardson/node-fs-extra/issues/233 "please make sure the first argument in callback is error object [feature-copy]"
-[#232]: https://github.com/jprichardson/node-fs-extra/issues/232 "Copy a folder content to its child folder. "
-[#231]: https://github.com/jprichardson/node-fs-extra/issues/231 "Adding read/write/output functions for YAML"
-[#230]: https://github.com/jprichardson/node-fs-extra/pull/230 "throw error if src and dest are the same to avoid zeroing out + test"
-[#229]: https://github.com/jprichardson/node-fs-extra/pull/229 "fix 'TypeError: callback is not a function' in emptyDir"
-[#228]: https://github.com/jprichardson/node-fs-extra/pull/228 "Throw error when target is empty so file is not accidentally zeroed out"
-[#227]: https://github.com/jprichardson/node-fs-extra/issues/227 "Uncatchable errors when there are invalid arguments [feature-move]"
-[#226]: https://github.com/jprichardson/node-fs-extra/issues/226 "Moving to the current directory"
-[#225]: https://github.com/jprichardson/node-fs-extra/issues/225 "EBUSY: resource busy or locked, unlink"
-[#224]: https://github.com/jprichardson/node-fs-extra/issues/224 "fse.copy ENOENT error"
-[#223]: https://github.com/jprichardson/node-fs-extra/issues/223 "Suspicious behavior of fs.existsSync"
-[#222]: https://github.com/jprichardson/node-fs-extra/pull/222 "A clearer description of emtpyDir function"
-[#221]: https://github.com/jprichardson/node-fs-extra/pull/221 "Update README.md"
-[#220]: https://github.com/jprichardson/node-fs-extra/pull/220 "Non-breaking feature: add option 'passStats' to copy methods."
-[#219]: https://github.com/jprichardson/node-fs-extra/pull/219 "Add closing parenthesis in copySync example"
-[#218]: https://github.com/jprichardson/node-fs-extra/pull/218 "fix #187 #70 options.filter bug"
-[#217]: https://github.com/jprichardson/node-fs-extra/pull/217 "fix #187 #70 options.filter bug"
-[#216]: https://github.com/jprichardson/node-fs-extra/pull/216 "fix #187 #70 options.filter bug"
-[#215]: https://github.com/jprichardson/node-fs-extra/pull/215 "fse.copy throws error when only src and dest provided [bug, documentation, feature-copy]"
-[#214]: https://github.com/jprichardson/node-fs-extra/pull/214 "Fixing copySync anchor tag"
-[#213]: https://github.com/jprichardson/node-fs-extra/issues/213 "Merge extfs with this repo"
-[#212]: https://github.com/jprichardson/node-fs-extra/pull/212 "Update year to 2016 in README.md and LICENSE"
-[#211]: https://github.com/jprichardson/node-fs-extra/issues/211 "Not copying all files"
-[#210]: https://github.com/jprichardson/node-fs-extra/issues/210 "copy/copySync behave differently when copying a symbolic file [bug, documentation, feature-copy]"
-[#209]: https://github.com/jprichardson/node-fs-extra/issues/209 "In Windows invalid directory name causes infinite loop in ensureDir(). [bug]"
-[#208]: https://github.com/jprichardson/node-fs-extra/pull/208 "fix options.preserveTimestamps to false in copy-sync by default [feature-copy]"
-[#207]: https://github.com/jprichardson/node-fs-extra/issues/207 "Add `compare` suite of functions"
-[#206]: https://github.com/jprichardson/node-fs-extra/issues/206 "outputFileSync"
-[#205]: https://github.com/jprichardson/node-fs-extra/issues/205 "fix documents about copy/copySync [documentation, feature-copy]"
-[#204]: https://github.com/jprichardson/node-fs-extra/pull/204 "allow copy of block and character device files"
-[#203]: https://github.com/jprichardson/node-fs-extra/issues/203 "copy method's argument options couldn't be undefined [bug, feature-copy]"
-[#202]: https://github.com/jprichardson/node-fs-extra/issues/202 "why there is not a walkSync method?"
-[#201]: https://github.com/jprichardson/node-fs-extra/issues/201 "clobber for directories [feature-copy, future]"
-[#200]: https://github.com/jprichardson/node-fs-extra/issues/200 "'copySync' doesn't work in sync"
-[#199]: https://github.com/jprichardson/node-fs-extra/issues/199 "fs.copySync fails if user does not own file [bug, feature-copy]"
-[#198]: https://github.com/jprichardson/node-fs-extra/issues/198 "handle copying between identical files [feature-copy]"
-[#197]: https://github.com/jprichardson/node-fs-extra/issues/197 "Missing documentation for `outputFile` `options` 3rd parameter [documentation]"
-[#196]: https://github.com/jprichardson/node-fs-extra/issues/196 "copy filter: async function and/or function called with `fs.stat` result [future]"
-[#195]: https://github.com/jprichardson/node-fs-extra/issues/195 "How to override with outputFile?"
-[#194]: https://github.com/jprichardson/node-fs-extra/pull/194 "allow ensureFile(Sync) to provide data to be written to created file"
-[#193]: https://github.com/jprichardson/node-fs-extra/issues/193 "`fs.copy` fails silently if source file is /dev/null [bug, feature-copy]"
-[#192]: https://github.com/jprichardson/node-fs-extra/issues/192 "Remove fs.createOutputStream()"
-[#191]: https://github.com/jprichardson/node-fs-extra/issues/191 "How to copy symlinks to target as normal folders [feature-copy]"
-[#190]: https://github.com/jprichardson/node-fs-extra/pull/190 "copySync to overwrite destination file if readonly and clobber true"
-[#189]: https://github.com/jprichardson/node-fs-extra/pull/189 "move.test fix to support CRLF on Windows"
-[#188]: https://github.com/jprichardson/node-fs-extra/issues/188 "move.test failing on windows platform"
-[#187]: https://github.com/jprichardson/node-fs-extra/issues/187 "Not filter each file, stops on first false [feature-copy]"
-[#186]: https://github.com/jprichardson/node-fs-extra/issues/186 "Do you need a .size() function in this module? [future]"
-[#185]: https://github.com/jprichardson/node-fs-extra/issues/185 "Doesn't work on NodeJS v4.x"
-[#184]: https://github.com/jprichardson/node-fs-extra/issues/184 "CLI equivalent for fs-extra"
-[#183]: https://github.com/jprichardson/node-fs-extra/issues/183 "with clobber true, copy and copySync behave differently if destination file is read only [bug, feature-copy]"
-[#182]: https://github.com/jprichardson/node-fs-extra/issues/182 "ensureDir(dir, callback) second callback parameter not specified"
-[#181]: https://github.com/jprichardson/node-fs-extra/issues/181 "Add ability to remove file securely [enhancement, wont-fix]"
-[#180]: https://github.com/jprichardson/node-fs-extra/issues/180 "Filter option doesn't work the same way in copy and copySync [bug, feature-copy]"
-[#179]: https://github.com/jprichardson/node-fs-extra/issues/179 "Include opendir"
-[#178]: https://github.com/jprichardson/node-fs-extra/issues/178 "ENOTEMPTY is thrown on removeSync "
-[#177]: https://github.com/jprichardson/node-fs-extra/issues/177 "fix `remove()` wildcards (introduced by rimraf) [feature-remove]"
-[#176]: https://github.com/jprichardson/node-fs-extra/issues/176 "createOutputStream doesn't emit 'end' event"
-[#175]: https://github.com/jprichardson/node-fs-extra/issues/175 "[Feature Request].moveSync support [feature-move, future]"
-[#174]: https://github.com/jprichardson/node-fs-extra/pull/174 "Fix copy formatting and document options.filter"
-[#173]: https://github.com/jprichardson/node-fs-extra/issues/173 "Feature Request: writeJson should mkdirs"
-[#172]: https://github.com/jprichardson/node-fs-extra/issues/172 "rename `clobber` flags to `overwrite`"
-[#171]: https://github.com/jprichardson/node-fs-extra/issues/171 "remove unnecessary aliases"
-[#170]: https://github.com/jprichardson/node-fs-extra/pull/170 "More robust handling of errors moving across virtual drives"
-[#169]: https://github.com/jprichardson/node-fs-extra/pull/169 "suppress ensureLink & ensureSymlink dest exists error"
-[#168]: https://github.com/jprichardson/node-fs-extra/pull/168 "suppress ensurelink dest exists error"
-[#167]: https://github.com/jprichardson/node-fs-extra/pull/167 "Adds basic (string, buffer) support for ensureFile content [future]"
-[#166]: https://github.com/jprichardson/node-fs-extra/pull/166 "Adds basic (string, buffer) support for ensureFile content"
-[#165]: https://github.com/jprichardson/node-fs-extra/pull/165 "ensure for link & symlink"
-[#164]: https://github.com/jprichardson/node-fs-extra/issues/164 "Feature Request: ensureFile to take optional argument for file content"
-[#163]: https://github.com/jprichardson/node-fs-extra/issues/163 "ouputJson not formatted out of the box [bug]"
-[#162]: https://github.com/jprichardson/node-fs-extra/pull/162 "ensure symlink & link"
-[#161]: https://github.com/jprichardson/node-fs-extra/pull/161 "ensure symlink & link"
-[#160]: https://github.com/jprichardson/node-fs-extra/pull/160 "ensure symlink & link"
-[#159]: https://github.com/jprichardson/node-fs-extra/pull/159 "ensure symlink & link"
-[#158]: https://github.com/jprichardson/node-fs-extra/issues/158 "Feature Request: ensureLink and ensureSymlink methods"
-[#157]: https://github.com/jprichardson/node-fs-extra/issues/157 "writeJson isn't formatted"
-[#156]: https://github.com/jprichardson/node-fs-extra/issues/156 "Promise.promisifyAll doesn't work for some methods"
-[#155]: https://github.com/jprichardson/node-fs-extra/issues/155 "Readme"
-[#154]: https://github.com/jprichardson/node-fs-extra/issues/154 "/tmp/millis-test-sync"
-[#153]: https://github.com/jprichardson/node-fs-extra/pull/153 "Make preserveTimes also work on read-only files. Closes #152"
-[#152]: https://github.com/jprichardson/node-fs-extra/issues/152 "fs.copy fails for read-only files with preserveTimestamp=true [feature-copy]"
-[#151]: https://github.com/jprichardson/node-fs-extra/issues/151 "TOC does not work correctly on npm [documentation]"
-[#150]: https://github.com/jprichardson/node-fs-extra/issues/150 "Remove test file fixtures, create with code."
-[#149]: https://github.com/jprichardson/node-fs-extra/issues/149 "/tmp/millis-test-sync"
-[#148]: https://github.com/jprichardson/node-fs-extra/issues/148 "split out `Sync` methods in documentation"
-[#147]: https://github.com/jprichardson/node-fs-extra/issues/147 "Adding rmdirIfEmpty"
-[#146]: https://github.com/jprichardson/node-fs-extra/pull/146 "ensure test.js works"
-[#145]: https://github.com/jprichardson/node-fs-extra/issues/145 "Add `fs.exists` and `fs.existsSync` if it doesn't exist."
-[#144]: https://github.com/jprichardson/node-fs-extra/issues/144 "tests failing"
-[#143]: https://github.com/jprichardson/node-fs-extra/issues/143 "update graceful-fs"
-[#142]: https://github.com/jprichardson/node-fs-extra/issues/142 "PrependFile Feature"
-[#141]: https://github.com/jprichardson/node-fs-extra/pull/141 "Add option to preserve timestamps"
-[#140]: https://github.com/jprichardson/node-fs-extra/issues/140 "Json file reading fails with 'utf8'"
-[#139]: https://github.com/jprichardson/node-fs-extra/pull/139 "Preserve file timestamp on copy. Closes #138"
-[#138]: https://github.com/jprichardson/node-fs-extra/issues/138 "Preserve timestamps on copying files"
-[#137]: https://github.com/jprichardson/node-fs-extra/issues/137 "outputFile/outputJson: Unexpected end of input"
-[#136]: https://github.com/jprichardson/node-fs-extra/pull/136 "Update license attribute"
-[#135]: https://github.com/jprichardson/node-fs-extra/issues/135 "emptyDir throws Error if no callback is provided"
-[#134]: https://github.com/jprichardson/node-fs-extra/pull/134 "Handle EEXIST error when clobbering dir"
-[#133]: https://github.com/jprichardson/node-fs-extra/pull/133 "Travis runs with `sudo: false`"
-[#132]: https://github.com/jprichardson/node-fs-extra/pull/132 "isDirectory method"
-[#131]: https://github.com/jprichardson/node-fs-extra/issues/131 "copySync is not working iojs 1.8.4 on linux [feature-copy]"
-[#130]: https://github.com/jprichardson/node-fs-extra/pull/130 "Please review additional features."
-[#129]: https://github.com/jprichardson/node-fs-extra/pull/129 "can you review this feature?"
-[#128]: https://github.com/jprichardson/node-fs-extra/issues/128 "fsExtra.move(filepath, newPath) broken;"
-[#127]: https://github.com/jprichardson/node-fs-extra/issues/127 "consider using fs.access to remove deprecated warnings for fs.exists"
-[#126]: https://github.com/jprichardson/node-fs-extra/issues/126 " TypeError: Object #<Object> has no method 'access'"
-[#125]: https://github.com/jprichardson/node-fs-extra/issues/125 "Question: What do the *Sync function do different from non-sync"
-[#124]: https://github.com/jprichardson/node-fs-extra/issues/124 "move with clobber option 'ENOTEMPTY'"
-[#123]: https://github.com/jprichardson/node-fs-extra/issues/123 "Only copy the content of a directory"
-[#122]: https://github.com/jprichardson/node-fs-extra/pull/122 "Update section links in README to match current section ids."
-[#121]: https://github.com/jprichardson/node-fs-extra/issues/121 "emptyDir is undefined"
-[#120]: https://github.com/jprichardson/node-fs-extra/issues/120 "usage bug caused by shallow cloning methods of 'graceful-fs'"
-[#119]: https://github.com/jprichardson/node-fs-extra/issues/119 "mkdirs and ensureDir never invoke callback and consume CPU indefinitely if provided a path with invalid characters on Windows"
-[#118]: https://github.com/jprichardson/node-fs-extra/pull/118 "createOutputStream"
-[#117]: https://github.com/jprichardson/node-fs-extra/pull/117 "Fixed issue with slash separated paths on windows"
-[#116]: https://github.com/jprichardson/node-fs-extra/issues/116 "copySync can only copy directories not files [documentation, feature-copy]"
-[#115]: https://github.com/jprichardson/node-fs-extra/issues/115 ".Copy & .CopySync [feature-copy]"
-[#114]: https://github.com/jprichardson/node-fs-extra/issues/114 "Fails to move (rename) directory to non-empty directory even with clobber: true"
-[#113]: https://github.com/jprichardson/node-fs-extra/issues/113 "fs.copy seems to callback early if the destination file already exists"
-[#112]: https://github.com/jprichardson/node-fs-extra/pull/112 "Copying a file into an existing directory"
-[#111]: https://github.com/jprichardson/node-fs-extra/pull/111 "Moving a file into an existing directory "
-[#110]: https://github.com/jprichardson/node-fs-extra/pull/110 "Moving a file into an existing directory"
-[#109]: https://github.com/jprichardson/node-fs-extra/issues/109 "fs.move across windows drives fails"
-[#108]: https://github.com/jprichardson/node-fs-extra/issues/108 "fse.move directories across multiple devices doesn't work"
-[#107]: https://github.com/jprichardson/node-fs-extra/pull/107 "Check if dest path is an existing dir and copy or move source in it"
-[#106]: https://github.com/jprichardson/node-fs-extra/issues/106 "fse.copySync crashes while copying across devices D: [feature-copy]"
-[#105]: https://github.com/jprichardson/node-fs-extra/issues/105 "fs.copy hangs on iojs"
-[#104]: https://github.com/jprichardson/node-fs-extra/issues/104 "fse.move deletes folders [bug]"
-[#103]: https://github.com/jprichardson/node-fs-extra/issues/103 "Error: EMFILE with copy"
-[#102]: https://github.com/jprichardson/node-fs-extra/issues/102 "touch / touchSync was removed ?"
-[#101]: https://github.com/jprichardson/node-fs-extra/issues/101 "fs-extra promisified"
-[#100]: https://github.com/jprichardson/node-fs-extra/pull/100 "copy: options object or filter to pass to ncp"
-[#99]: https://github.com/jprichardson/node-fs-extra/issues/99 "ensureDir() modes [future]"
-[#98]: https://github.com/jprichardson/node-fs-extra/issues/98 "fs.copy() incorrect async behavior [bug]"
-[#97]: https://github.com/jprichardson/node-fs-extra/pull/97 "use path.join; fix copySync bug"
-[#96]: https://github.com/jprichardson/node-fs-extra/issues/96 "destFolderExists in copySync is always undefined."
-[#95]: https://github.com/jprichardson/node-fs-extra/pull/95 "Using graceful-ncp instead of ncp"
-[#94]: https://github.com/jprichardson/node-fs-extra/issues/94 "Error: EEXIST, file already exists '../mkdirp/bin/cmd.js' on fs.copySync() [enhancement, feature-copy]"
-[#93]: https://github.com/jprichardson/node-fs-extra/issues/93 "Confusing error if drive not mounted [enhancement]"
-[#92]: https://github.com/jprichardson/node-fs-extra/issues/92 "Problems with Bluebird"
-[#91]: https://github.com/jprichardson/node-fs-extra/issues/91 "fs.copySync('/test', '/haha') is different with 'cp -r /test /haha' [enhancement]"
-[#90]: https://github.com/jprichardson/node-fs-extra/issues/90 "Folder creation and file copy is Happening in 64 bit machine but not in 32 bit machine"
-[#89]: https://github.com/jprichardson/node-fs-extra/issues/89 "Error: EEXIST using fs-extra's fs.copy to copy a directory on Windows"
-[#88]: https://github.com/jprichardson/node-fs-extra/issues/88 "Stacking those libraries"
-[#87]: https://github.com/jprichardson/node-fs-extra/issues/87 "createWriteStream + outputFile = ?"
-[#86]: https://github.com/jprichardson/node-fs-extra/issues/86 "no moveSync?"
-[#85]: https://github.com/jprichardson/node-fs-extra/pull/85 "Copy symlinks in copySync"
-[#84]: https://github.com/jprichardson/node-fs-extra/issues/84 "Push latest version to npm ?"
-[#83]: https://github.com/jprichardson/node-fs-extra/issues/83 "Prevent copying a directory into itself [feature-copy]"
-[#82]: https://github.com/jprichardson/node-fs-extra/pull/82 "README updates for move"
-[#81]: https://github.com/jprichardson/node-fs-extra/issues/81 "fd leak after fs.move"
-[#80]: https://github.com/jprichardson/node-fs-extra/pull/80 "Preserve file mode in copySync"
-[#79]: https://github.com/jprichardson/node-fs-extra/issues/79 "fs.copy only .html file empty"
-[#78]: https://github.com/jprichardson/node-fs-extra/pull/78 "copySync was not applying filters to directories"
-[#77]: https://github.com/jprichardson/node-fs-extra/issues/77 "Create README reference to bluebird"
-[#76]: https://github.com/jprichardson/node-fs-extra/issues/76 "Create README reference to typescript"
-[#75]: https://github.com/jprichardson/node-fs-extra/issues/75 "add glob as a dep? [question]"
-[#74]: https://github.com/jprichardson/node-fs-extra/pull/74 "including new emptydir module"
-[#73]: https://github.com/jprichardson/node-fs-extra/pull/73 "add dependency status in readme"
-[#72]: https://github.com/jprichardson/node-fs-extra/pull/72 "Use svg instead of png to get better image quality"
-[#71]: https://github.com/jprichardson/node-fs-extra/issues/71 "fse.copy not working on Windows 7 x64 OS, but, copySync does work"
-[#70]: https://github.com/jprichardson/node-fs-extra/issues/70 "Not filter each file, stops on first false [bug]"
-[#69]: https://github.com/jprichardson/node-fs-extra/issues/69 "How to check if folder exist and read the folder name"
-[#68]: https://github.com/jprichardson/node-fs-extra/issues/68 "consider flag to readJsonSync (throw false) [enhancement]"
-[#67]: https://github.com/jprichardson/node-fs-extra/issues/67 "docs for readJson incorrectly states that is accepts options"
-[#66]: https://github.com/jprichardson/node-fs-extra/issues/66 "ENAMETOOLONG"
-[#65]: https://github.com/jprichardson/node-fs-extra/issues/65 "exclude filter in fs.copy"
-[#64]: https://github.com/jprichardson/node-fs-extra/issues/64 "Announce: mfs - monitor your fs-extra calls"
-[#63]: https://github.com/jprichardson/node-fs-extra/issues/63 "Walk"
-[#62]: https://github.com/jprichardson/node-fs-extra/issues/62 "npm install fs-extra doesn't work"
-[#61]: https://github.com/jprichardson/node-fs-extra/issues/61 "No longer supports node 0.8 due to use of `^` in package.json dependencies"
-[#60]: https://github.com/jprichardson/node-fs-extra/issues/60 "chmod & chown for mkdirs"
-[#59]: https://github.com/jprichardson/node-fs-extra/issues/59 "Consider including mkdirp and making fs-extra '--use_strict' safe [question]"
-[#58]: https://github.com/jprichardson/node-fs-extra/issues/58 "Stack trace not included in fs.copy error"
-[#57]: https://github.com/jprichardson/node-fs-extra/issues/57 "Possible to include wildcards in delete?"
-[#56]: https://github.com/jprichardson/node-fs-extra/issues/56 "Crash when have no access to write to destination file in copy "
-[#55]: https://github.com/jprichardson/node-fs-extra/issues/55 "Is it possible to have any console output similar to Grunt copy module?"
-[#54]: https://github.com/jprichardson/node-fs-extra/issues/54 "`copy` does not preserve file ownership and permissons"
-[#53]: https://github.com/jprichardson/node-fs-extra/issues/53 "outputFile() - ability to write data in appending mode"
-[#52]: https://github.com/jprichardson/node-fs-extra/pull/52 "This fixes (what I think) is a bug in copySync"
-[#51]: https://github.com/jprichardson/node-fs-extra/pull/51 "Add a Bitdeli Badge to README"
-[#50]: https://github.com/jprichardson/node-fs-extra/issues/50 "Replace mechanism in createFile"
-[#49]: https://github.com/jprichardson/node-fs-extra/pull/49 "update rimraf to v2.2.6"
-[#48]: https://github.com/jprichardson/node-fs-extra/issues/48 "fs.copy issue [bug]"
-[#47]: https://github.com/jprichardson/node-fs-extra/issues/47 "Bug in copy - callback called on readStream 'close' - Fixed in ncp 0.5.0"
-[#46]: https://github.com/jprichardson/node-fs-extra/pull/46 "update copyright year"
-[#45]: https://github.com/jprichardson/node-fs-extra/pull/45 "Added note about fse.outputFile() being the one that overwrites"
-[#44]: https://github.com/jprichardson/node-fs-extra/pull/44 "Proposal: Stream support"
-[#43]: https://github.com/jprichardson/node-fs-extra/issues/43 "Better error reporting "
-[#42]: https://github.com/jprichardson/node-fs-extra/issues/42 "Performance issue?"
-[#41]: https://github.com/jprichardson/node-fs-extra/pull/41 "There does seem to be a synchronous version now"
-[#40]: https://github.com/jprichardson/node-fs-extra/issues/40 "fs.copy throw unexplained error ENOENT, utime "
-[#39]: https://github.com/jprichardson/node-fs-extra/pull/39 "Added regression test for copy() return callback on error"
-[#38]: https://github.com/jprichardson/node-fs-extra/pull/38 "Return err in copy() fstat cb, because stat could be undefined or null"
-[#37]: https://github.com/jprichardson/node-fs-extra/issues/37 "Maybe include a line reader? [enhancement, question]"
-[#36]: https://github.com/jprichardson/node-fs-extra/pull/36 "`filter` parameter `fs.copy` and `fs.copySync`"
-[#35]: https://github.com/jprichardson/node-fs-extra/pull/35 "`filter` parameter `fs.copy` and `fs.copySync` "
-[#34]: https://github.com/jprichardson/node-fs-extra/issues/34 "update docs to include options for JSON methods [enhancement]"
-[#33]: https://github.com/jprichardson/node-fs-extra/pull/33 "fs_extra.copySync"
-[#32]: https://github.com/jprichardson/node-fs-extra/issues/32 "update to latest jsonfile [enhancement]"
-[#31]: https://github.com/jprichardson/node-fs-extra/issues/31 "Add ensure methods [enhancement]"
-[#30]: https://github.com/jprichardson/node-fs-extra/issues/30 "update package.json optional dep `graceful-fs`"
-[#29]: https://github.com/jprichardson/node-fs-extra/issues/29 "Copy failing if dest directory doesn't exist. Is this intended?"
-[#28]: https://github.com/jprichardson/node-fs-extra/issues/28 "homepage field must be a string url. Deleted."
-[#27]: https://github.com/jprichardson/node-fs-extra/issues/27 "Update Readme"
-[#26]: https://github.com/jprichardson/node-fs-extra/issues/26 "Add readdir recursive method. [enhancement]"
-[#25]: https://github.com/jprichardson/node-fs-extra/pull/25 "adding an `.npmignore` file"
-[#24]: https://github.com/jprichardson/node-fs-extra/issues/24 "[bug] cannot run in strict mode [bug]"
-[#23]: https://github.com/jprichardson/node-fs-extra/issues/23 "`writeJSON()` should create parent directories"
-[#22]: https://github.com/jprichardson/node-fs-extra/pull/22 "Add a limit option to mkdirs()"
-[#21]: https://github.com/jprichardson/node-fs-extra/issues/21 "touch() in 0.10.0"
-[#20]: https://github.com/jprichardson/node-fs-extra/issues/20 "fs.remove yields callback before directory is really deleted"
-[#19]: https://github.com/jprichardson/node-fs-extra/issues/19 "fs.copy err is empty array"
-[#18]: https://github.com/jprichardson/node-fs-extra/pull/18 "Exposed copyFile Function"
-[#17]: https://github.com/jprichardson/node-fs-extra/issues/17 "Use `require('graceful-fs')` if found instead of `require('fs')`"
-[#16]: https://github.com/jprichardson/node-fs-extra/pull/16 "Update README.md"
-[#15]: https://github.com/jprichardson/node-fs-extra/issues/15 "Implement cp -r but sync aka copySync. [enhancement]"
-[#14]: https://github.com/jprichardson/node-fs-extra/issues/14 "fs.mkdirSync is broken in 0.3.1"
-[#13]: https://github.com/jprichardson/node-fs-extra/issues/13 "Thoughts on including a directory tree / file watcher? [enhancement, question]"
-[#12]: https://github.com/jprichardson/node-fs-extra/issues/12 "copyFile & copyFileSync are global"
-[#11]: https://github.com/jprichardson/node-fs-extra/issues/11 "Thoughts on including a file walker? [enhancement, question]"
-[#10]: https://github.com/jprichardson/node-fs-extra/issues/10 "move / moveFile API [enhancement]"
-[#9]: https://github.com/jprichardson/node-fs-extra/issues/9 "don't import normal fs stuff into fs-extra"
-[#8]: https://github.com/jprichardson/node-fs-extra/pull/8 "Update rimraf to latest version"
-[#6]: https://github.com/jprichardson/node-fs-extra/issues/6 "Remove CoffeeScript development dependency"
-[#5]: https://github.com/jprichardson/node-fs-extra/issues/5 "comments on naming"
-[#4]: https://github.com/jprichardson/node-fs-extra/issues/4 "version bump to 0.2"
-[#3]: https://github.com/jprichardson/node-fs-extra/pull/3 "Hi! I fixed some code for you!"
-[#2]: https://github.com/jprichardson/node-fs-extra/issues/2 "Merge with fs.extra and mkdirp"
-[#1]: https://github.com/jprichardson/node-fs-extra/issues/1 "file-extra npm !exist"
diff --git a/node_modules/fs-extra/README.md b/node_modules/fs-extra/README.md
index 070a5e7..6ed8b6a 100644
--- a/node_modules/fs-extra/README.md
+++ b/node_modules/fs-extra/README.md
@@ -4,11 +4,9 @@
`fs-extra` adds file system methods that aren't included in the native `fs` module and adds promise support to the `fs` methods. It also uses [`graceful-fs`](https://github.com/isaacs/node-graceful-fs) to prevent `EMFILE` errors. It should be a drop in replacement for `fs`.
[](https://www.npmjs.org/package/fs-extra)
-[](https://github.com/jprichardson/node-fs-extra/blob/master/LICENSE)
-[](http://travis-ci.org/jprichardson/node-fs-extra)
-[](https://ci.appveyor.com/project/jprichardson/node-fs-extra/branch/master)
+[](https://github.com/jprichardson/node-fs-extra/blob/master/LICENSE)
+[](https://github.com/jprichardson/node-fs-extra/actions/workflows/ci.yml?query=branch%3Amaster)
[](https://www.npmjs.org/package/fs-extra)
-[](https://coveralls.io/github/jprichardson/node-fs-extra)
[](https://standardjs.com)
Why?
@@ -143,7 +141,7 @@
- [writeJsonSync](docs/writeJson-sync.md)
-**NOTE:** You can still use the native Node.js methods. They are promisified and copied over to `fs-extra`. See [notes on `fs.read()` & `fs.write()`](docs/fs-read-write.md)
+**NOTE:** You can still use the native Node.js methods. They are promisified and copied over to `fs-extra`. See [notes on `fs.read()`, `fs.write()`, & `fs.writev()`](docs/fs-read-write-writev.md)
### What happened to `walk()` and `walkSync()`?
@@ -153,6 +151,9 @@
Third Party
-----------
+### CLI
+
+[fse-cli](https://www.npmjs.com/package/@atao60/fse-cli) allows you to run `fs-extra` from a console or from [npm](https://www.npmjs.com) scripts.
### TypeScript
@@ -186,7 +187,7 @@
What's needed?
- First, take a look at existing issues. Those are probably going to be where the priority lies.
- More tests for edge cases. Specifically on different platforms. There can never be enough tests.
-- Improve test coverage. See coveralls output for more info.
+- Improve test coverage.
Note: If you make any big changes, **you should definitely file an issue for discussion first.**
diff --git a/node_modules/fs-extra/lib/copy-sync/index.js b/node_modules/fs-extra/lib/copy-sync/index.js
deleted file mode 100644
index 65945ae..0000000
--- a/node_modules/fs-extra/lib/copy-sync/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict'
-
-module.exports = {
- copySync: require('./copy-sync')
-}
diff --git a/node_modules/fs-extra/lib/copy-sync/copy-sync.js b/node_modules/fs-extra/lib/copy/copy-sync.js
similarity index 68%
rename from node_modules/fs-extra/lib/copy-sync/copy-sync.js
rename to node_modules/fs-extra/lib/copy/copy-sync.js
index f2831b3..551abe0 100644
--- a/node_modules/fs-extra/lib/copy-sync/copy-sync.js
+++ b/node_modules/fs-extra/lib/copy/copy-sync.js
@@ -2,8 +2,8 @@
const fs = require('graceful-fs')
const path = require('path')
-const mkdirpSync = require('../mkdirs').mkdirsSync
-const utimesSync = require('../util/utimes.js').utimesMillisSync
+const mkdirsSync = require('../mkdirs').mkdirsSync
+const utimesMillisSync = require('../util/utimes').utimesMillisSync
const stat = require('../util/stat')
function copySync (src, dest, opts) {
@@ -17,11 +17,14 @@
// Warn about using preserveTimestamps on 32-bit node
if (opts.preserveTimestamps && process.arch === 'ia32') {
- console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n
- see https://github.com/jprichardson/node-fs-extra/issues/269`)
+ process.emitWarning(
+ 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
+ '\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
+ 'Warning', 'fs-extra-WARN0002'
+ )
}
- const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy')
+ const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)
stat.checkParentPathsSync(src, srcStat, dest, 'copy')
return handleFilterAndCopy(destStat, src, dest, opts)
}
@@ -29,8 +32,8 @@
function handleFilterAndCopy (destStat, src, dest, opts) {
if (opts.filter && !opts.filter(src, dest)) return
const destParent = path.dirname(dest)
- if (!fs.existsSync(destParent)) mkdirpSync(destParent)
- return startCopy(destStat, src, dest, opts)
+ if (!fs.existsSync(destParent)) mkdirsSync(destParent)
+ return getStats(destStat, src, dest, opts)
}
function startCopy (destStat, src, dest, opts) {
@@ -47,6 +50,9 @@
srcStat.isCharacterDevice() ||
srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
+ else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)
+ else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)
+ throw new Error(`Unknown file: ${src}`)
}
function onFile (srcStat, destStat, src, dest, opts) {
@@ -64,49 +70,48 @@
}
function copyFile (srcStat, src, dest, opts) {
- if (typeof fs.copyFileSync === 'function') {
- fs.copyFileSync(src, dest)
- fs.chmodSync(dest, srcStat.mode)
- if (opts.preserveTimestamps) {
- return utimesSync(dest, srcStat.atime, srcStat.mtime)
- }
- return
- }
- return copyFileFallback(srcStat, src, dest, opts)
+ fs.copyFileSync(src, dest)
+ if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)
+ return setDestMode(dest, srcStat.mode)
}
-function copyFileFallback (srcStat, src, dest, opts) {
- const BUF_LENGTH = 64 * 1024
- const _buff = require('../util/buffer')(BUF_LENGTH)
+function handleTimestamps (srcMode, src, dest) {
+ // Make sure the file is writable before setting the timestamp
+ // otherwise open fails with EPERM when invoked with 'r+'
+ // (through utimes call)
+ if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)
+ return setDestTimestamps(src, dest)
+}
- const fdr = fs.openSync(src, 'r')
- const fdw = fs.openSync(dest, 'w', srcStat.mode)
- let pos = 0
+function fileIsNotWritable (srcMode) {
+ return (srcMode & 0o200) === 0
+}
- while (pos < srcStat.size) {
- const bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos)
- fs.writeSync(fdw, _buff, 0, bytesRead)
- pos += bytesRead
- }
+function makeFileWritable (dest, srcMode) {
+ return setDestMode(dest, srcMode | 0o200)
+}
- if (opts.preserveTimestamps) fs.futimesSync(fdw, srcStat.atime, srcStat.mtime)
+function setDestMode (dest, srcMode) {
+ return fs.chmodSync(dest, srcMode)
+}
- fs.closeSync(fdr)
- fs.closeSync(fdw)
+function setDestTimestamps (src, dest) {
+ // The initial srcStat.atime cannot be trusted
+ // because it is modified by the read(2) system call
+ // (See https://nodejs.org/api/fs.html#fs_stat_time_values)
+ const updatedSrcStat = fs.statSync(src)
+ return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
}
function onDir (srcStat, destStat, src, dest, opts) {
- if (!destStat) return mkDirAndCopy(srcStat, src, dest, opts)
- if (destStat && !destStat.isDirectory()) {
- throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)
- }
+ if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)
return copyDir(src, dest, opts)
}
-function mkDirAndCopy (srcStat, src, dest, opts) {
+function mkDirAndCopy (srcMode, src, dest, opts) {
fs.mkdirSync(dest)
copyDir(src, dest, opts)
- return fs.chmodSync(dest, srcStat.mode)
+ return setDestMode(dest, srcMode)
}
function copyDir (src, dest, opts) {
@@ -116,7 +121,7 @@
function copyDirItem (item, src, dest, opts) {
const srcItem = path.join(src, item)
const destItem = path.join(dest, item)
- const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy')
+ const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)
return startCopy(destStat, srcItem, destItem, opts)
}
diff --git a/node_modules/fs-extra/lib/copy/copy.js b/node_modules/fs-extra/lib/copy/copy.js
index 411fc64..09d53df 100644
--- a/node_modules/fs-extra/lib/copy/copy.js
+++ b/node_modules/fs-extra/lib/copy/copy.js
@@ -2,9 +2,9 @@
const fs = require('graceful-fs')
const path = require('path')
-const mkdirp = require('../mkdirs').mkdirs
+const mkdirs = require('../mkdirs').mkdirs
const pathExists = require('../path-exists').pathExists
-const utimes = require('../util/utimes').utimesMillis
+const utimesMillis = require('../util/utimes').utimesMillis
const stat = require('../util/stat')
function copy (src, dest, opts, cb) {
@@ -23,11 +23,14 @@
// Warn about using preserveTimestamps on 32-bit node
if (opts.preserveTimestamps && process.arch === 'ia32') {
- console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n
- see https://github.com/jprichardson/node-fs-extra/issues/269`)
+ process.emitWarning(
+ 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
+ '\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
+ 'Warning', 'fs-extra-WARN0001'
+ )
}
- stat.checkPaths(src, dest, 'copy', (err, stats) => {
+ stat.checkPaths(src, dest, 'copy', opts, (err, stats) => {
if (err) return cb(err)
const { srcStat, destStat } = stats
stat.checkParentPaths(src, srcStat, dest, 'copy', err => {
@@ -42,10 +45,10 @@
const destParent = path.dirname(dest)
pathExists(destParent, (err, dirExists) => {
if (err) return cb(err)
- if (dirExists) return startCopy(destStat, src, dest, opts, cb)
- mkdirp(destParent, err => {
+ if (dirExists) return getStats(destStat, src, dest, opts, cb)
+ mkdirs(destParent, err => {
if (err) return cb(err)
- return startCopy(destStat, src, dest, opts, cb)
+ return getStats(destStat, src, dest, opts, cb)
})
})
}
@@ -72,6 +75,9 @@
srcStat.isCharacterDevice() ||
srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb)
else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb)
+ else if (srcStat.isSocket()) return cb(new Error(`Cannot copy a socket file: ${src}`))
+ else if (srcStat.isFIFO()) return cb(new Error(`Cannot copy a FIFO pipe: ${src}`))
+ return cb(new Error(`Unknown file: ${src}`))
})
}
@@ -92,49 +98,66 @@
}
function copyFile (srcStat, src, dest, opts, cb) {
- if (typeof fs.copyFile === 'function') {
- return fs.copyFile(src, dest, err => {
- if (err) return cb(err)
- return setDestModeAndTimestamps(srcStat, dest, opts, cb)
- })
- }
- return copyFileFallback(srcStat, src, dest, opts, cb)
-}
-
-function copyFileFallback (srcStat, src, dest, opts, cb) {
- const rs = fs.createReadStream(src)
- rs.on('error', err => cb(err)).once('open', () => {
- const ws = fs.createWriteStream(dest, { mode: srcStat.mode })
- ws.on('error', err => cb(err))
- .on('open', () => rs.pipe(ws))
- .once('close', () => setDestModeAndTimestamps(srcStat, dest, opts, cb))
+ fs.copyFile(src, dest, err => {
+ if (err) return cb(err)
+ if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb)
+ return setDestMode(dest, srcStat.mode, cb)
})
}
-function setDestModeAndTimestamps (srcStat, dest, opts, cb) {
- fs.chmod(dest, srcStat.mode, err => {
+function handleTimestampsAndMode (srcMode, src, dest, cb) {
+ // Make sure the file is writable before setting the timestamp
+ // otherwise open fails with EPERM when invoked with 'r+'
+ // (through utimes call)
+ if (fileIsNotWritable(srcMode)) {
+ return makeFileWritable(dest, srcMode, err => {
+ if (err) return cb(err)
+ return setDestTimestampsAndMode(srcMode, src, dest, cb)
+ })
+ }
+ return setDestTimestampsAndMode(srcMode, src, dest, cb)
+}
+
+function fileIsNotWritable (srcMode) {
+ return (srcMode & 0o200) === 0
+}
+
+function makeFileWritable (dest, srcMode, cb) {
+ return setDestMode(dest, srcMode | 0o200, cb)
+}
+
+function setDestTimestampsAndMode (srcMode, src, dest, cb) {
+ setDestTimestamps(src, dest, err => {
if (err) return cb(err)
- if (opts.preserveTimestamps) {
- return utimes(dest, srcStat.atime, srcStat.mtime, cb)
- }
- return cb()
+ return setDestMode(dest, srcMode, cb)
+ })
+}
+
+function setDestMode (dest, srcMode, cb) {
+ return fs.chmod(dest, srcMode, cb)
+}
+
+function setDestTimestamps (src, dest, cb) {
+ // The initial srcStat.atime cannot be trusted
+ // because it is modified by the read(2) system call
+ // (See https://nodejs.org/api/fs.html#fs_stat_time_values)
+ fs.stat(src, (err, updatedSrcStat) => {
+ if (err) return cb(err)
+ return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb)
})
}
function onDir (srcStat, destStat, src, dest, opts, cb) {
- if (!destStat) return mkDirAndCopy(srcStat, src, dest, opts, cb)
- if (destStat && !destStat.isDirectory()) {
- return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`))
- }
+ if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb)
return copyDir(src, dest, opts, cb)
}
-function mkDirAndCopy (srcStat, src, dest, opts, cb) {
+function mkDirAndCopy (srcMode, src, dest, opts, cb) {
fs.mkdir(dest, err => {
if (err) return cb(err)
copyDir(src, dest, opts, err => {
if (err) return cb(err)
- return fs.chmod(dest, srcStat.mode, cb)
+ return setDestMode(dest, srcMode, cb)
})
})
}
@@ -155,7 +178,7 @@
function copyDirItem (items, item, src, dest, opts, cb) {
const srcItem = path.join(src, item)
const destItem = path.join(dest, item)
- stat.checkPaths(srcItem, destItem, 'copy', (err, stats) => {
+ stat.checkPaths(srcItem, destItem, 'copy', opts, (err, stats) => {
if (err) return cb(err)
const { destStat } = stats
startCopy(destStat, srcItem, destItem, opts, err => {
diff --git a/node_modules/fs-extra/lib/copy/index.js b/node_modules/fs-extra/lib/copy/index.js
index b7e4f7f..45c07a2 100644
--- a/node_modules/fs-extra/lib/copy/index.js
+++ b/node_modules/fs-extra/lib/copy/index.js
@@ -2,5 +2,6 @@
const u = require('universalify').fromCallback
module.exports = {
- copy: u(require('./copy'))
+ copy: u(require('./copy')),
+ copySync: require('./copy-sync')
}
diff --git a/node_modules/fs-extra/lib/empty/index.js b/node_modules/fs-extra/lib/empty/index.js
index 204d53b..b4a2e82 100644
--- a/node_modules/fs-extra/lib/empty/index.js
+++ b/node_modules/fs-extra/lib/empty/index.js
@@ -1,36 +1,27 @@
'use strict'
-const u = require('universalify').fromCallback
-const fs = require('graceful-fs')
+const u = require('universalify').fromPromise
+const fs = require('../fs')
const path = require('path')
const mkdir = require('../mkdirs')
const remove = require('../remove')
-const emptyDir = u(function emptyDir (dir, callback) {
- callback = callback || function () {}
- fs.readdir(dir, (err, items) => {
- if (err) return mkdir.mkdirs(dir, callback)
+const emptyDir = u(async function emptyDir (dir) {
+ let items
+ try {
+ items = await fs.readdir(dir)
+ } catch {
+ return mkdir.mkdirs(dir)
+ }
- items = items.map(item => path.join(dir, item))
-
- deleteItem()
-
- function deleteItem () {
- const item = items.pop()
- if (!item) return callback()
- remove.remove(item, err => {
- if (err) return callback(err)
- deleteItem()
- })
- }
- })
+ return Promise.all(items.map(item => remove.remove(path.join(dir, item))))
})
function emptyDirSync (dir) {
let items
try {
items = fs.readdirSync(dir)
- } catch (err) {
+ } catch {
return mkdir.mkdirsSync(dir)
}
diff --git a/node_modules/fs-extra/lib/ensure/file.js b/node_modules/fs-extra/lib/ensure/file.js
index 67eed30..15cc473 100644
--- a/node_modules/fs-extra/lib/ensure/file.js
+++ b/node_modules/fs-extra/lib/ensure/file.js
@@ -4,7 +4,6 @@
const path = require('path')
const fs = require('graceful-fs')
const mkdir = require('../mkdirs')
-const pathExists = require('../path-exists').pathExists
function createFile (file, callback) {
function makeFile () {
@@ -17,13 +16,26 @@
fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err
if (!err && stats.isFile()) return callback()
const dir = path.dirname(file)
- pathExists(dir, (err, dirExists) => {
- if (err) return callback(err)
- if (dirExists) return makeFile()
- mkdir.mkdirs(dir, err => {
- if (err) return callback(err)
- makeFile()
- })
+ fs.stat(dir, (err, stats) => {
+ if (err) {
+ // if the directory doesn't exist, make it
+ if (err.code === 'ENOENT') {
+ return mkdir.mkdirs(dir, err => {
+ if (err) return callback(err)
+ makeFile()
+ })
+ }
+ return callback(err)
+ }
+
+ if (stats.isDirectory()) makeFile()
+ else {
+ // parent is not a directory
+ // This is just to cause an internal ENOTDIR error to be thrown
+ fs.readdir(dir, err => {
+ if (err) return callback(err)
+ })
+ }
})
})
}
@@ -32,12 +44,20 @@
let stats
try {
stats = fs.statSync(file)
- } catch (e) {}
+ } catch {}
if (stats && stats.isFile()) return
const dir = path.dirname(file)
- if (!fs.existsSync(dir)) {
- mkdir.mkdirsSync(dir)
+ try {
+ if (!fs.statSync(dir).isDirectory()) {
+ // parent is not a directory
+ // This is just to cause an internal ENOTDIR error to be thrown
+ fs.readdirSync(dir)
+ }
+ } catch (err) {
+ // If the stat call above failed because the directory doesn't exist, create it
+ if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir)
+ else throw err
}
fs.writeFileSync(file, '')
diff --git a/node_modules/fs-extra/lib/ensure/index.js b/node_modules/fs-extra/lib/ensure/index.js
index c1f67b7..ecbcdd0 100644
--- a/node_modules/fs-extra/lib/ensure/index.js
+++ b/node_modules/fs-extra/lib/ensure/index.js
@@ -1,23 +1,23 @@
'use strict'
-const file = require('./file')
-const link = require('./link')
-const symlink = require('./symlink')
+const { createFile, createFileSync } = require('./file')
+const { createLink, createLinkSync } = require('./link')
+const { createSymlink, createSymlinkSync } = require('./symlink')
module.exports = {
// file
- createFile: file.createFile,
- createFileSync: file.createFileSync,
- ensureFile: file.createFile,
- ensureFileSync: file.createFileSync,
+ createFile,
+ createFileSync,
+ ensureFile: createFile,
+ ensureFileSync: createFileSync,
// link
- createLink: link.createLink,
- createLinkSync: link.createLinkSync,
- ensureLink: link.createLink,
- ensureLinkSync: link.createLinkSync,
+ createLink,
+ createLinkSync,
+ ensureLink: createLink,
+ ensureLinkSync: createLinkSync,
// symlink
- createSymlink: symlink.createSymlink,
- createSymlinkSync: symlink.createSymlinkSync,
- ensureSymlink: symlink.createSymlink,
- ensureSymlinkSync: symlink.createSymlinkSync
+ createSymlink,
+ createSymlinkSync,
+ ensureSymlink: createSymlink,
+ ensureSymlinkSync: createSymlinkSync
}
diff --git a/node_modules/fs-extra/lib/ensure/link.js b/node_modules/fs-extra/lib/ensure/link.js
index 2cd4196..f6d6748 100644
--- a/node_modules/fs-extra/lib/ensure/link.js
+++ b/node_modules/fs-extra/lib/ensure/link.js
@@ -5,6 +5,7 @@
const fs = require('graceful-fs')
const mkdir = require('../mkdirs')
const pathExists = require('../path-exists').pathExists
+const { areIdentical } = require('../util/stat')
function createLink (srcpath, dstpath, callback) {
function makeLink (srcpath, dstpath) {
@@ -14,14 +15,13 @@
})
}
- pathExists(dstpath, (err, destinationExists) => {
- if (err) return callback(err)
- if (destinationExists) return callback(null)
- fs.lstat(srcpath, (err) => {
+ fs.lstat(dstpath, (_, dstStat) => {
+ fs.lstat(srcpath, (err, srcStat) => {
if (err) {
err.message = err.message.replace('lstat', 'ensureLink')
return callback(err)
}
+ if (dstStat && areIdentical(srcStat, dstStat)) return callback(null)
const dir = path.dirname(dstpath)
pathExists(dir, (err, dirExists) => {
@@ -37,11 +37,14 @@
}
function createLinkSync (srcpath, dstpath) {
- const destinationExists = fs.existsSync(dstpath)
- if (destinationExists) return undefined
+ let dstStat
+ try {
+ dstStat = fs.lstatSync(dstpath)
+ } catch {}
try {
- fs.lstatSync(srcpath)
+ const srcStat = fs.lstatSync(srcpath)
+ if (dstStat && areIdentical(srcStat, dstStat)) return
} catch (err) {
err.message = err.message.replace('lstat', 'ensureLink')
throw err
diff --git a/node_modules/fs-extra/lib/ensure/symlink-paths.js b/node_modules/fs-extra/lib/ensure/symlink-paths.js
index 24e7e1c..33cd760 100644
--- a/node_modules/fs-extra/lib/ensure/symlink-paths.js
+++ b/node_modules/fs-extra/lib/ensure/symlink-paths.js
@@ -34,8 +34,8 @@
return callback(err)
}
return callback(null, {
- 'toCwd': srcpath,
- 'toDst': srcpath
+ toCwd: srcpath,
+ toDst: srcpath
})
})
} else {
@@ -45,8 +45,8 @@
if (err) return callback(err)
if (exists) {
return callback(null, {
- 'toCwd': relativeToDst,
- 'toDst': srcpath
+ toCwd: relativeToDst,
+ toDst: srcpath
})
} else {
return fs.lstat(srcpath, (err) => {
@@ -55,8 +55,8 @@
return callback(err)
}
return callback(null, {
- 'toCwd': srcpath,
- 'toDst': path.relative(dstdir, srcpath)
+ toCwd: srcpath,
+ toDst: path.relative(dstdir, srcpath)
})
})
}
@@ -70,8 +70,8 @@
exists = fs.existsSync(srcpath)
if (!exists) throw new Error('absolute srcpath does not exist')
return {
- 'toCwd': srcpath,
- 'toDst': srcpath
+ toCwd: srcpath,
+ toDst: srcpath
}
} else {
const dstdir = path.dirname(dstpath)
@@ -79,15 +79,15 @@
exists = fs.existsSync(relativeToDst)
if (exists) {
return {
- 'toCwd': relativeToDst,
- 'toDst': srcpath
+ toCwd: relativeToDst,
+ toDst: srcpath
}
} else {
exists = fs.existsSync(srcpath)
if (!exists) throw new Error('relative srcpath does not exist')
return {
- 'toCwd': srcpath,
- 'toDst': path.relative(dstdir, srcpath)
+ toCwd: srcpath,
+ toDst: path.relative(dstdir, srcpath)
}
}
}
diff --git a/node_modules/fs-extra/lib/ensure/symlink-type.js b/node_modules/fs-extra/lib/ensure/symlink-type.js
index 4f8787c..42dc0ce 100644
--- a/node_modules/fs-extra/lib/ensure/symlink-type.js
+++ b/node_modules/fs-extra/lib/ensure/symlink-type.js
@@ -19,7 +19,7 @@
if (type) return type
try {
stats = fs.lstatSync(srcpath)
- } catch (e) {
+ } catch {
return 'file'
}
return (stats && stats.isDirectory()) ? 'dir' : 'file'
diff --git a/node_modules/fs-extra/lib/ensure/symlink.js b/node_modules/fs-extra/lib/ensure/symlink.js
index fe68b79..2b93052 100644
--- a/node_modules/fs-extra/lib/ensure/symlink.js
+++ b/node_modules/fs-extra/lib/ensure/symlink.js
@@ -2,7 +2,7 @@
const u = require('universalify').fromCallback
const path = require('path')
-const fs = require('graceful-fs')
+const fs = require('../fs')
const _mkdirs = require('../mkdirs')
const mkdirs = _mkdirs.mkdirs
const mkdirsSync = _mkdirs.mkdirsSync
@@ -17,26 +17,38 @@
const pathExists = require('../path-exists').pathExists
+const { areIdentical } = require('../util/stat')
+
function createSymlink (srcpath, dstpath, type, callback) {
callback = (typeof type === 'function') ? type : callback
type = (typeof type === 'function') ? false : type
- pathExists(dstpath, (err, destinationExists) => {
+ fs.lstat(dstpath, (err, stats) => {
+ if (!err && stats.isSymbolicLink()) {
+ Promise.all([
+ fs.stat(srcpath),
+ fs.stat(dstpath)
+ ]).then(([srcStat, dstStat]) => {
+ if (areIdentical(srcStat, dstStat)) return callback(null)
+ _createSymlink(srcpath, dstpath, type, callback)
+ })
+ } else _createSymlink(srcpath, dstpath, type, callback)
+ })
+}
+
+function _createSymlink (srcpath, dstpath, type, callback) {
+ symlinkPaths(srcpath, dstpath, (err, relative) => {
if (err) return callback(err)
- if (destinationExists) return callback(null)
- symlinkPaths(srcpath, dstpath, (err, relative) => {
+ srcpath = relative.toDst
+ symlinkType(relative.toCwd, type, (err, type) => {
if (err) return callback(err)
- srcpath = relative.toDst
- symlinkType(relative.toCwd, type, (err, type) => {
+ const dir = path.dirname(dstpath)
+ pathExists(dir, (err, dirExists) => {
if (err) return callback(err)
- const dir = path.dirname(dstpath)
- pathExists(dir, (err, dirExists) => {
+ if (dirExists) return fs.symlink(srcpath, dstpath, type, callback)
+ mkdirs(dir, err => {
if (err) return callback(err)
- if (dirExists) return fs.symlink(srcpath, dstpath, type, callback)
- mkdirs(dir, err => {
- if (err) return callback(err)
- fs.symlink(srcpath, dstpath, type, callback)
- })
+ fs.symlink(srcpath, dstpath, type, callback)
})
})
})
@@ -44,8 +56,15 @@
}
function createSymlinkSync (srcpath, dstpath, type) {
- const destinationExists = fs.existsSync(dstpath)
- if (destinationExists) return undefined
+ let stats
+ try {
+ stats = fs.lstatSync(dstpath)
+ } catch {}
+ if (stats && stats.isSymbolicLink()) {
+ const srcStat = fs.statSync(srcpath)
+ const dstStat = fs.statSync(dstpath)
+ if (areIdentical(srcStat, dstStat)) return
+ }
const relative = symlinkPathsSync(srcpath, dstpath)
srcpath = relative.toDst
diff --git a/node_modules/fs-extra/lib/fs/index.js b/node_modules/fs-extra/lib/fs/index.js
index a7b2292..7b025e2 100644
--- a/node_modules/fs-extra/lib/fs/index.js
+++ b/node_modules/fs-extra/lib/fs/index.js
@@ -18,18 +18,20 @@
'fsync',
'ftruncate',
'futimes',
- 'lchown',
'lchmod',
+ 'lchown',
'link',
'lstat',
'mkdir',
'mkdtemp',
'open',
- 'readFile',
+ 'opendir',
'readdir',
+ 'readFile',
'readlink',
'realpath',
'rename',
+ 'rm',
'rmdir',
'stat',
'symlink',
@@ -39,21 +41,14 @@
'writeFile'
].filter(key => {
// Some commands are not available on some systems. Ex:
- // fs.copyFile was added in Node.js v8.5.0
- // fs.mkdtemp was added in Node.js v5.10.0
+ // fs.opendir was added in Node.js v12.12.0
+ // fs.rm was added in Node.js v14.14.0
// fs.lchown is not available on at least some Linux
return typeof fs[key] === 'function'
})
-// Export all keys:
-Object.keys(fs).forEach(key => {
- if (key === 'promises') {
- // fs.promises is a getter property that triggers ExperimentalWarning
- // Don't re-export it here, the getter is defined in "lib/index.js"
- return
- }
- exports[key] = fs[key]
-})
+// Export cloned fs:
+Object.assign(exports, fs)
// Universalify async methods:
api.forEach(method => {
@@ -71,7 +66,7 @@
})
}
-// fs.read() & fs.write need special treatment due to multiple callback args
+// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args
exports.read = function (fd, buffer, offset, length, position, callback) {
if (typeof callback === 'function') {
@@ -103,7 +98,31 @@
})
}
-// fs.realpath.native only available in Node v9.2+
+// fs.writev only available in Node v12.9.0+
+if (typeof fs.writev === 'function') {
+ // Function signature is
+ // s.writev(fd, buffers[, position], callback)
+ // We need to handle the optional arg, so we use ...args
+ exports.writev = function (fd, buffers, ...args) {
+ if (typeof args[args.length - 1] === 'function') {
+ return fs.writev(fd, buffers, ...args)
+ }
+
+ return new Promise((resolve, reject) => {
+ fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {
+ if (err) return reject(err)
+ resolve({ bytesWritten, buffers })
+ })
+ })
+ }
+}
+
+// fs.realpath.native sometimes not available if fs is monkey-patched
if (typeof fs.realpath.native === 'function') {
exports.realpath.native = u(fs.realpath.native)
+} else {
+ process.emitWarning(
+ 'fs.realpath.native is not a function. Is fs being monkey-patched?',
+ 'Warning', 'fs-extra-WARN0003'
+ )
}
diff --git a/node_modules/fs-extra/lib/index.js b/node_modules/fs-extra/lib/index.js
index 40e37b1..da6711a 100644
--- a/node_modules/fs-extra/lib/index.js
+++ b/node_modules/fs-extra/lib/index.js
@@ -1,28 +1,16 @@
'use strict'
-module.exports = Object.assign(
- {},
+module.exports = {
// Export promiseified graceful-fs:
- require('./fs'),
+ ...require('./fs'),
// Export extra methods:
- require('./copy-sync'),
- require('./copy'),
- require('./empty'),
- require('./ensure'),
- require('./json'),
- require('./mkdirs'),
- require('./move-sync'),
- require('./move'),
- require('./output'),
- require('./path-exists'),
- require('./remove')
-)
-
-// Export fs.promises as a getter property so that we don't trigger
-// ExperimentalWarning before fs.promises is actually accessed.
-const fs = require('fs')
-if (Object.getOwnPropertyDescriptor(fs, 'promises')) {
- Object.defineProperty(module.exports, 'promises', {
- get () { return fs.promises }
- })
+ ...require('./copy'),
+ ...require('./empty'),
+ ...require('./ensure'),
+ ...require('./json'),
+ ...require('./mkdirs'),
+ ...require('./move'),
+ ...require('./output-file'),
+ ...require('./path-exists'),
+ ...require('./remove')
}
diff --git a/node_modules/fs-extra/lib/json/index.js b/node_modules/fs-extra/lib/json/index.js
index bae68d4..900126a 100644
--- a/node_modules/fs-extra/lib/json/index.js
+++ b/node_modules/fs-extra/lib/json/index.js
@@ -1,6 +1,6 @@
'use strict'
-const u = require('universalify').fromCallback
+const u = require('universalify').fromPromise
const jsonFile = require('./jsonfile')
jsonFile.outputJson = u(require('./output-json'))
diff --git a/node_modules/fs-extra/lib/json/jsonfile.js b/node_modules/fs-extra/lib/json/jsonfile.js
index 59cdb3e..f11d34d 100644
--- a/node_modules/fs-extra/lib/json/jsonfile.js
+++ b/node_modules/fs-extra/lib/json/jsonfile.js
@@ -1,12 +1,11 @@
'use strict'
-const u = require('universalify').fromCallback
const jsonFile = require('jsonfile')
module.exports = {
// jsonfile exports
- readJson: u(jsonFile.readFile),
+ readJson: jsonFile.readFile,
readJsonSync: jsonFile.readFileSync,
- writeJson: u(jsonFile.writeFile),
+ writeJson: jsonFile.writeFile,
writeJsonSync: jsonFile.writeFileSync
}
diff --git a/node_modules/fs-extra/lib/json/output-json-sync.js b/node_modules/fs-extra/lib/json/output-json-sync.js
index 6f76710..d4e564f 100644
--- a/node_modules/fs-extra/lib/json/output-json-sync.js
+++ b/node_modules/fs-extra/lib/json/output-json-sync.js
@@ -1,18 +1,12 @@
'use strict'
-const fs = require('graceful-fs')
-const path = require('path')
-const mkdir = require('../mkdirs')
-const jsonFile = require('./jsonfile')
+const { stringify } = require('jsonfile/utils')
+const { outputFileSync } = require('../output-file')
function outputJsonSync (file, data, options) {
- const dir = path.dirname(file)
+ const str = stringify(data, options)
- if (!fs.existsSync(dir)) {
- mkdir.mkdirsSync(dir)
- }
-
- jsonFile.writeJsonSync(file, data, options)
+ outputFileSync(file, str, options)
}
module.exports = outputJsonSync
diff --git a/node_modules/fs-extra/lib/json/output-json.js b/node_modules/fs-extra/lib/json/output-json.js
index d45edb8..0afdeb6 100644
--- a/node_modules/fs-extra/lib/json/output-json.js
+++ b/node_modules/fs-extra/lib/json/output-json.js
@@ -1,27 +1,12 @@
'use strict'
-const path = require('path')
-const mkdir = require('../mkdirs')
-const pathExists = require('../path-exists').pathExists
-const jsonFile = require('./jsonfile')
+const { stringify } = require('jsonfile/utils')
+const { outputFile } = require('../output-file')
-function outputJson (file, data, options, callback) {
- if (typeof options === 'function') {
- callback = options
- options = {}
- }
+async function outputJson (file, data, options = {}) {
+ const str = stringify(data, options)
- const dir = path.dirname(file)
-
- pathExists(dir, (err, itDoes) => {
- if (err) return callback(err)
- if (itDoes) return jsonFile.writeJson(file, data, options, callback)
-
- mkdir.mkdirs(dir, err => {
- if (err) return callback(err)
- jsonFile.writeJson(file, data, options, callback)
- })
- })
+ await outputFile(file, str, options)
}
module.exports = outputJson
diff --git a/node_modules/fs-extra/lib/mkdirs/index.js b/node_modules/fs-extra/lib/mkdirs/index.js
index d6e7e5b..9edecee 100644
--- a/node_modules/fs-extra/lib/mkdirs/index.js
+++ b/node_modules/fs-extra/lib/mkdirs/index.js
@@ -1,14 +1,14 @@
'use strict'
-const u = require('universalify').fromCallback
-const mkdirs = u(require('./mkdirs'))
-const mkdirsSync = require('./mkdirs-sync')
+const u = require('universalify').fromPromise
+const { makeDir: _makeDir, makeDirSync } = require('./make-dir')
+const makeDir = u(_makeDir)
module.exports = {
- mkdirs,
- mkdirsSync,
+ mkdirs: makeDir,
+ mkdirsSync: makeDirSync,
// alias
- mkdirp: mkdirs,
- mkdirpSync: mkdirsSync,
- ensureDir: mkdirs,
- ensureDirSync: mkdirsSync
+ mkdirp: makeDir,
+ mkdirpSync: makeDirSync,
+ ensureDir: makeDir,
+ ensureDirSync: makeDirSync
}
diff --git a/node_modules/fs-extra/lib/mkdirs/make-dir.js b/node_modules/fs-extra/lib/mkdirs/make-dir.js
new file mode 100644
index 0000000..45ece64
--- /dev/null
+++ b/node_modules/fs-extra/lib/mkdirs/make-dir.js
@@ -0,0 +1,27 @@
+'use strict'
+const fs = require('../fs')
+const { checkPath } = require('./utils')
+
+const getMode = options => {
+ const defaults = { mode: 0o777 }
+ if (typeof options === 'number') return options
+ return ({ ...defaults, ...options }).mode
+}
+
+module.exports.makeDir = async (dir, options) => {
+ checkPath(dir)
+
+ return fs.mkdir(dir, {
+ mode: getMode(options),
+ recursive: true
+ })
+}
+
+module.exports.makeDirSync = (dir, options) => {
+ checkPath(dir)
+
+ return fs.mkdirSync(dir, {
+ mode: getMode(options),
+ recursive: true
+ })
+}
diff --git a/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js b/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js
deleted file mode 100644
index a34acb9..0000000
--- a/node_modules/fs-extra/lib/mkdirs/mkdirs-sync.js
+++ /dev/null
@@ -1,54 +0,0 @@
-'use strict'
-
-const fs = require('graceful-fs')
-const path = require('path')
-const invalidWin32Path = require('./win32').invalidWin32Path
-
-const o777 = parseInt('0777', 8)
-
-function mkdirsSync (p, opts, made) {
- if (!opts || typeof opts !== 'object') {
- opts = { mode: opts }
- }
-
- let mode = opts.mode
- const xfs = opts.fs || fs
-
- if (process.platform === 'win32' && invalidWin32Path(p)) {
- const errInval = new Error(p + ' contains invalid WIN32 path characters.')
- errInval.code = 'EINVAL'
- throw errInval
- }
-
- if (mode === undefined) {
- mode = o777 & (~process.umask())
- }
- if (!made) made = null
-
- p = path.resolve(p)
-
- try {
- xfs.mkdirSync(p, mode)
- made = made || p
- } catch (err0) {
- if (err0.code === 'ENOENT') {
- if (path.dirname(p) === p) throw err0
- made = mkdirsSync(path.dirname(p), opts, made)
- mkdirsSync(p, opts, made)
- } else {
- // In the case of any other error, just see if there's a dir there
- // already. If so, then hooray! If not, then something is borked.
- let stat
- try {
- stat = xfs.statSync(p)
- } catch (err1) {
- throw err0
- }
- if (!stat.isDirectory()) throw err0
- }
- }
-
- return made
-}
-
-module.exports = mkdirsSync
diff --git a/node_modules/fs-extra/lib/mkdirs/mkdirs.js b/node_modules/fs-extra/lib/mkdirs/mkdirs.js
deleted file mode 100644
index 1897533..0000000
--- a/node_modules/fs-extra/lib/mkdirs/mkdirs.js
+++ /dev/null
@@ -1,63 +0,0 @@
-'use strict'
-
-const fs = require('graceful-fs')
-const path = require('path')
-const invalidWin32Path = require('./win32').invalidWin32Path
-
-const o777 = parseInt('0777', 8)
-
-function mkdirs (p, opts, callback, made) {
- if (typeof opts === 'function') {
- callback = opts
- opts = {}
- } else if (!opts || typeof opts !== 'object') {
- opts = { mode: opts }
- }
-
- if (process.platform === 'win32' && invalidWin32Path(p)) {
- const errInval = new Error(p + ' contains invalid WIN32 path characters.')
- errInval.code = 'EINVAL'
- return callback(errInval)
- }
-
- let mode = opts.mode
- const xfs = opts.fs || fs
-
- if (mode === undefined) {
- mode = o777 & (~process.umask())
- }
- if (!made) made = null
-
- callback = callback || function () {}
- p = path.resolve(p)
-
- xfs.mkdir(p, mode, er => {
- if (!er) {
- made = made || p
- return callback(null, made)
- }
- switch (er.code) {
- case 'ENOENT':
- if (path.dirname(p) === p) return callback(er)
- mkdirs(path.dirname(p), opts, (er, made) => {
- if (er) callback(er, made)
- else mkdirs(p, opts, callback, made)
- })
- break
-
- // In the case of any other error, just see if there's a dir
- // there already. If so, then hooray! If not, then something
- // is borked.
- default:
- xfs.stat(p, (er2, stat) => {
- // if the stat fails, then that's super weird.
- // let the original error be the failure reason.
- if (er2 || !stat.isDirectory()) callback(er, made)
- else callback(null, made)
- })
- break
- }
- })
-}
-
-module.exports = mkdirs
diff --git a/node_modules/fs-extra/lib/mkdirs/utils.js b/node_modules/fs-extra/lib/mkdirs/utils.js
new file mode 100644
index 0000000..a4059ad
--- /dev/null
+++ b/node_modules/fs-extra/lib/mkdirs/utils.js
@@ -0,0 +1,21 @@
+// Adapted from https://github.com/sindresorhus/make-dir
+// Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+// 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.
+'use strict'
+const path = require('path')
+
+// https://github.com/nodejs/node/issues/8987
+// https://github.com/libuv/libuv/pull/1088
+module.exports.checkPath = function checkPath (pth) {
+ if (process.platform === 'win32') {
+ const pathHasInvalidWinCharacters = /[<>:"|?*]/.test(pth.replace(path.parse(pth).root, ''))
+
+ if (pathHasInvalidWinCharacters) {
+ const error = new Error(`Path contains invalid characters: ${pth}`)
+ error.code = 'EINVAL'
+ throw error
+ }
+ }
+}
diff --git a/node_modules/fs-extra/lib/mkdirs/win32.js b/node_modules/fs-extra/lib/mkdirs/win32.js
deleted file mode 100644
index 99b3920..0000000
--- a/node_modules/fs-extra/lib/mkdirs/win32.js
+++ /dev/null
@@ -1,25 +0,0 @@
-'use strict'
-
-const path = require('path')
-
-// get drive on windows
-function getRootPath (p) {
- p = path.normalize(path.resolve(p)).split(path.sep)
- if (p.length > 0) return p[0]
- return null
-}
-
-// http://stackoverflow.com/a/62888/10333 contains more accurate
-// TODO: expand to include the rest
-const INVALID_PATH_CHARS = /[<>:"|?*]/
-
-function invalidWin32Path (p) {
- const rp = getRootPath(p)
- p = p.replace(rp, '')
- return INVALID_PATH_CHARS.test(p)
-}
-
-module.exports = {
- getRootPath,
- invalidWin32Path
-}
diff --git a/node_modules/fs-extra/lib/move-sync/index.js b/node_modules/fs-extra/lib/move-sync/index.js
deleted file mode 100644
index af90b06..0000000
--- a/node_modules/fs-extra/lib/move-sync/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-'use strict'
-
-module.exports = {
- moveSync: require('./move-sync')
-}
diff --git a/node_modules/fs-extra/lib/move/index.js b/node_modules/fs-extra/lib/move/index.js
index 3785345..fcee73c 100644
--- a/node_modules/fs-extra/lib/move/index.js
+++ b/node_modules/fs-extra/lib/move/index.js
@@ -2,5 +2,6 @@
const u = require('universalify').fromCallback
module.exports = {
- move: u(require('./move'))
+ move: u(require('./move')),
+ moveSync: require('./move-sync')
}
diff --git a/node_modules/fs-extra/lib/move-sync/move-sync.js b/node_modules/fs-extra/lib/move/move-sync.js
similarity index 65%
rename from node_modules/fs-extra/lib/move-sync/move-sync.js
rename to node_modules/fs-extra/lib/move/move-sync.js
index 20f910c..8453366 100644
--- a/node_modules/fs-extra/lib/move-sync/move-sync.js
+++ b/node_modules/fs-extra/lib/move/move-sync.js
@@ -2,7 +2,7 @@
const fs = require('graceful-fs')
const path = require('path')
-const copySync = require('../copy-sync').copySync
+const copySync = require('../copy').copySync
const removeSync = require('../remove').removeSync
const mkdirpSync = require('../mkdirs').mkdirpSync
const stat = require('../util/stat')
@@ -11,13 +11,20 @@
opts = opts || {}
const overwrite = opts.overwrite || opts.clobber || false
- const { srcStat } = stat.checkPathsSync(src, dest, 'move')
+ const { srcStat, isChangingCase = false } = stat.checkPathsSync(src, dest, 'move', opts)
stat.checkParentPathsSync(src, srcStat, dest, 'move')
- mkdirpSync(path.dirname(dest))
- return doRename(src, dest, overwrite)
+ if (!isParentRoot(dest)) mkdirpSync(path.dirname(dest))
+ return doRename(src, dest, overwrite, isChangingCase)
}
-function doRename (src, dest, overwrite) {
+function isParentRoot (dest) {
+ const parent = path.dirname(dest)
+ const parsedPath = path.parse(parent)
+ return parsedPath.root === parent
+}
+
+function doRename (src, dest, overwrite, isChangingCase) {
+ if (isChangingCase) return rename(src, dest, overwrite)
if (overwrite) {
removeSync(dest)
return rename(src, dest, overwrite)
diff --git a/node_modules/fs-extra/lib/move/move.js b/node_modules/fs-extra/lib/move/move.js
index fa3ea61..7dc6ecd 100644
--- a/node_modules/fs-extra/lib/move/move.js
+++ b/node_modules/fs-extra/lib/move/move.js
@@ -14,22 +14,32 @@
opts = {}
}
+ opts = opts || {}
+
const overwrite = opts.overwrite || opts.clobber || false
- stat.checkPaths(src, dest, 'move', (err, stats) => {
+ stat.checkPaths(src, dest, 'move', opts, (err, stats) => {
if (err) return cb(err)
- const { srcStat } = stats
+ const { srcStat, isChangingCase = false } = stats
stat.checkParentPaths(src, srcStat, dest, 'move', err => {
if (err) return cb(err)
+ if (isParentRoot(dest)) return doRename(src, dest, overwrite, isChangingCase, cb)
mkdirp(path.dirname(dest), err => {
if (err) return cb(err)
- return doRename(src, dest, overwrite, cb)
+ return doRename(src, dest, overwrite, isChangingCase, cb)
})
})
})
}
-function doRename (src, dest, overwrite, cb) {
+function isParentRoot (dest) {
+ const parent = path.dirname(dest)
+ const parsedPath = path.parse(parent)
+ return parsedPath.root === parent
+}
+
+function doRename (src, dest, overwrite, isChangingCase, cb) {
+ if (isChangingCase) return rename(src, dest, overwrite, cb)
if (overwrite) {
return remove(dest, err => {
if (err) return cb(err)
diff --git a/node_modules/fs-extra/lib/output/index.js b/node_modules/fs-extra/lib/output-file/index.js
similarity index 100%
rename from node_modules/fs-extra/lib/output/index.js
rename to node_modules/fs-extra/lib/output-file/index.js
diff --git a/node_modules/fs-extra/lib/remove/index.js b/node_modules/fs-extra/lib/remove/index.js
index cee5340..4428e59 100644
--- a/node_modules/fs-extra/lib/remove/index.js
+++ b/node_modules/fs-extra/lib/remove/index.js
@@ -1,9 +1,22 @@
'use strict'
+const fs = require('graceful-fs')
const u = require('universalify').fromCallback
const rimraf = require('./rimraf')
+function remove (path, callback) {
+ // Node 14.14.0+
+ if (fs.rm) return fs.rm(path, { recursive: true, force: true }, callback)
+ rimraf(path, callback)
+}
+
+function removeSync (path) {
+ // Node 14.14.0+
+ if (fs.rmSync) return fs.rmSync(path, { recursive: true, force: true })
+ rimraf.sync(path)
+}
+
module.exports = {
- remove: u(rimraf),
- removeSync: rimraf.sync
+ remove: u(remove),
+ removeSync
}
diff --git a/node_modules/fs-extra/lib/remove/rimraf.js b/node_modules/fs-extra/lib/remove/rimraf.js
index f287e4e..2c77102 100644
--- a/node_modules/fs-extra/lib/remove/rimraf.js
+++ b/node_modules/fs-extra/lib/remove/rimraf.js
@@ -113,9 +113,6 @@
assert(p)
assert(options)
assert(typeof cb === 'function')
- if (er) {
- assert(er instanceof Error)
- }
options.chmod(p, 0o666, er2 => {
if (er2) {
@@ -139,9 +136,6 @@
assert(p)
assert(options)
- if (er) {
- assert(er instanceof Error)
- }
try {
options.chmodSync(p, 0o666)
@@ -173,9 +167,6 @@
function rmdir (p, options, originalEr, cb) {
assert(p)
assert(options)
- if (originalEr) {
- assert(originalEr instanceof Error)
- }
assert(typeof cb === 'function')
// try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
@@ -268,9 +259,6 @@
function rmdirSync (p, options, originalEr) {
assert(p)
assert(options)
- if (originalEr) {
- assert(originalEr instanceof Error)
- }
try {
options.rmdirSync(p)
@@ -302,7 +290,7 @@
try {
const ret = options.rmdirSync(p, options)
return ret
- } catch (er) { }
+ } catch {}
} while (Date.now() - startTime < 500) // give up after 500ms
} else {
const ret = options.rmdirSync(p, options)
diff --git a/node_modules/fs-extra/lib/util/buffer.js b/node_modules/fs-extra/lib/util/buffer.js
deleted file mode 100644
index dabf288..0000000
--- a/node_modules/fs-extra/lib/util/buffer.js
+++ /dev/null
@@ -1,12 +0,0 @@
-'use strict'
-/* eslint-disable node/no-deprecated-api */
-module.exports = function (size) {
- if (typeof Buffer.allocUnsafe === 'function') {
- try {
- return Buffer.allocUnsafe(size)
- } catch (e) {
- return new Buffer(size)
- }
- }
- return new Buffer(size)
-}
diff --git a/node_modules/fs-extra/lib/util/stat.js b/node_modules/fs-extra/lib/util/stat.js
index 350cb9f..0ed5aec 100644
--- a/node_modules/fs-extra/lib/util/stat.js
+++ b/node_modules/fs-extra/lib/util/stat.js
@@ -1,70 +1,30 @@
'use strict'
-const fs = require('graceful-fs')
+const fs = require('../fs')
const path = require('path')
+const util = require('util')
-const NODE_VERSION_MAJOR_WITH_BIGINT = 10
-const NODE_VERSION_MINOR_WITH_BIGINT = 5
-const NODE_VERSION_PATCH_WITH_BIGINT = 0
-const nodeVersion = process.versions.node.split('.')
-const nodeVersionMajor = Number.parseInt(nodeVersion[0], 10)
-const nodeVersionMinor = Number.parseInt(nodeVersion[1], 10)
-const nodeVersionPatch = Number.parseInt(nodeVersion[2], 10)
-
-function nodeSupportsBigInt () {
- if (nodeVersionMajor > NODE_VERSION_MAJOR_WITH_BIGINT) {
- return true
- } else if (nodeVersionMajor === NODE_VERSION_MAJOR_WITH_BIGINT) {
- if (nodeVersionMinor > NODE_VERSION_MINOR_WITH_BIGINT) {
- return true
- } else if (nodeVersionMinor === NODE_VERSION_MINOR_WITH_BIGINT) {
- if (nodeVersionPatch >= NODE_VERSION_PATCH_WITH_BIGINT) {
- return true
- }
- }
- }
- return false
+function getStats (src, dest, opts) {
+ const statFunc = opts.dereference
+ ? (file) => fs.stat(file, { bigint: true })
+ : (file) => fs.lstat(file, { bigint: true })
+ return Promise.all([
+ statFunc(src),
+ statFunc(dest).catch(err => {
+ if (err.code === 'ENOENT') return null
+ throw err
+ })
+ ]).then(([srcStat, destStat]) => ({ srcStat, destStat }))
}
-function getStats (src, dest, cb) {
- if (nodeSupportsBigInt()) {
- fs.stat(src, { bigint: true }, (err, srcStat) => {
- if (err) return cb(err)
- fs.stat(dest, { bigint: true }, (err, destStat) => {
- if (err) {
- if (err.code === 'ENOENT') return cb(null, { srcStat, destStat: null })
- return cb(err)
- }
- return cb(null, { srcStat, destStat })
- })
- })
- } else {
- fs.stat(src, (err, srcStat) => {
- if (err) return cb(err)
- fs.stat(dest, (err, destStat) => {
- if (err) {
- if (err.code === 'ENOENT') return cb(null, { srcStat, destStat: null })
- return cb(err)
- }
- return cb(null, { srcStat, destStat })
- })
- })
- }
-}
-
-function getStatsSync (src, dest) {
- let srcStat, destStat
- if (nodeSupportsBigInt()) {
- srcStat = fs.statSync(src, { bigint: true })
- } else {
- srcStat = fs.statSync(src)
- }
+function getStatsSync (src, dest, opts) {
+ let destStat
+ const statFunc = opts.dereference
+ ? (file) => fs.statSync(file, { bigint: true })
+ : (file) => fs.lstatSync(file, { bigint: true })
+ const srcStat = statFunc(src)
try {
- if (nodeSupportsBigInt()) {
- destStat = fs.statSync(dest, { bigint: true })
- } else {
- destStat = fs.statSync(dest)
- }
+ destStat = statFunc(dest)
} catch (err) {
if (err.code === 'ENOENT') return { srcStat, destStat: null }
throw err
@@ -72,13 +32,30 @@
return { srcStat, destStat }
}
-function checkPaths (src, dest, funcName, cb) {
- getStats(src, dest, (err, stats) => {
+function checkPaths (src, dest, funcName, opts, cb) {
+ util.callbackify(getStats)(src, dest, opts, (err, stats) => {
if (err) return cb(err)
const { srcStat, destStat } = stats
- if (destStat && destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {
- return cb(new Error('Source and destination must not be the same.'))
+
+ if (destStat) {
+ if (areIdentical(srcStat, destStat)) {
+ const srcBaseName = path.basename(src)
+ const destBaseName = path.basename(dest)
+ if (funcName === 'move' &&
+ srcBaseName !== destBaseName &&
+ srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
+ return cb(null, { srcStat, destStat, isChangingCase: true })
+ }
+ return cb(new Error('Source and destination must not be the same.'))
+ }
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
+ return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`))
+ }
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
+ return cb(new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`))
+ }
}
+
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
return cb(new Error(errMsg(src, dest, funcName)))
}
@@ -86,11 +63,28 @@
})
}
-function checkPathsSync (src, dest, funcName) {
- const { srcStat, destStat } = getStatsSync(src, dest)
- if (destStat && destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {
- throw new Error('Source and destination must not be the same.')
+function checkPathsSync (src, dest, funcName, opts) {
+ const { srcStat, destStat } = getStatsSync(src, dest, opts)
+
+ if (destStat) {
+ if (areIdentical(srcStat, destStat)) {
+ const srcBaseName = path.basename(src)
+ const destBaseName = path.basename(dest)
+ if (funcName === 'move' &&
+ srcBaseName !== destBaseName &&
+ srcBaseName.toLowerCase() === destBaseName.toLowerCase()) {
+ return { srcStat, destStat, isChangingCase: true }
+ }
+ throw new Error('Source and destination must not be the same.')
+ }
+ if (srcStat.isDirectory() && !destStat.isDirectory()) {
+ throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)
+ }
+ if (!srcStat.isDirectory() && destStat.isDirectory()) {
+ throw new Error(`Cannot overwrite directory '${dest}' with non-directory '${src}'.`)
+ }
}
+
if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {
throw new Error(errMsg(src, dest, funcName))
}
@@ -105,29 +99,16 @@
const srcParent = path.resolve(path.dirname(src))
const destParent = path.resolve(path.dirname(dest))
if (destParent === srcParent || destParent === path.parse(destParent).root) return cb()
- if (nodeSupportsBigInt()) {
- fs.stat(destParent, { bigint: true }, (err, destStat) => {
- if (err) {
- if (err.code === 'ENOENT') return cb()
- return cb(err)
- }
- if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {
- return cb(new Error(errMsg(src, dest, funcName)))
- }
- return checkParentPaths(src, srcStat, destParent, funcName, cb)
- })
- } else {
- fs.stat(destParent, (err, destStat) => {
- if (err) {
- if (err.code === 'ENOENT') return cb()
- return cb(err)
- }
- if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {
- return cb(new Error(errMsg(src, dest, funcName)))
- }
- return checkParentPaths(src, srcStat, destParent, funcName, cb)
- })
- }
+ fs.stat(destParent, { bigint: true }, (err, destStat) => {
+ if (err) {
+ if (err.code === 'ENOENT') return cb()
+ return cb(err)
+ }
+ if (areIdentical(srcStat, destStat)) {
+ return cb(new Error(errMsg(src, dest, funcName)))
+ }
+ return checkParentPaths(src, srcStat, destParent, funcName, cb)
+ })
}
function checkParentPathsSync (src, srcStat, dest, funcName) {
@@ -136,21 +117,21 @@
if (destParent === srcParent || destParent === path.parse(destParent).root) return
let destStat
try {
- if (nodeSupportsBigInt()) {
- destStat = fs.statSync(destParent, { bigint: true })
- } else {
- destStat = fs.statSync(destParent)
- }
+ destStat = fs.statSync(destParent, { bigint: true })
} catch (err) {
if (err.code === 'ENOENT') return
throw err
}
- if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {
+ if (areIdentical(srcStat, destStat)) {
throw new Error(errMsg(src, dest, funcName))
}
return checkParentPathsSync(src, srcStat, destParent, funcName)
}
+function areIdentical (srcStat, destStat) {
+ return destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev
+}
+
// return true if dest is a subdir of src, otherwise false.
// It only checks the path strings.
function isSrcSubdir (src, dest) {
@@ -168,5 +149,6 @@
checkPathsSync,
checkParentPaths,
checkParentPathsSync,
- isSrcSubdir
+ isSrcSubdir,
+ areIdentical
}
diff --git a/node_modules/fs-extra/lib/util/utimes.js b/node_modules/fs-extra/lib/util/utimes.js
index 8916a1b..75395de 100644
--- a/node_modules/fs-extra/lib/util/utimes.js
+++ b/node_modules/fs-extra/lib/util/utimes.js
@@ -1,56 +1,6 @@
'use strict'
const fs = require('graceful-fs')
-const os = require('os')
-const path = require('path')
-
-// HFS, ext{2,3}, FAT do not, Node.js v0.10 does not
-function hasMillisResSync () {
- let tmpfile = path.join('millis-test-sync' + Date.now().toString() + Math.random().toString().slice(2))
- tmpfile = path.join(os.tmpdir(), tmpfile)
-
- // 550 millis past UNIX epoch
- const d = new Date(1435410243862)
- fs.writeFileSync(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141')
- const fd = fs.openSync(tmpfile, 'r+')
- fs.futimesSync(fd, d, d)
- fs.closeSync(fd)
- return fs.statSync(tmpfile).mtime > 1435410243000
-}
-
-function hasMillisRes (callback) {
- let tmpfile = path.join('millis-test' + Date.now().toString() + Math.random().toString().slice(2))
- tmpfile = path.join(os.tmpdir(), tmpfile)
-
- // 550 millis past UNIX epoch
- const d = new Date(1435410243862)
- fs.writeFile(tmpfile, 'https://github.com/jprichardson/node-fs-extra/pull/141', err => {
- if (err) return callback(err)
- fs.open(tmpfile, 'r+', (err, fd) => {
- if (err) return callback(err)
- fs.futimes(fd, d, d, err => {
- if (err) return callback(err)
- fs.close(fd, err => {
- if (err) return callback(err)
- fs.stat(tmpfile, (err, stats) => {
- if (err) return callback(err)
- callback(null, stats.mtime > 1435410243000)
- })
- })
- })
- })
- })
-}
-
-function timeRemoveMillis (timestamp) {
- if (typeof timestamp === 'number') {
- return Math.floor(timestamp / 1000) * 1000
- } else if (timestamp instanceof Date) {
- return new Date(Math.floor(timestamp.getTime() / 1000) * 1000)
- } else {
- throw new Error('fs-extra: timeRemoveMillis() unknown parameter type')
- }
-}
function utimesMillis (path, atime, mtime, callback) {
// if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)
@@ -71,9 +21,6 @@
}
module.exports = {
- hasMillisRes,
- hasMillisResSync,
- timeRemoveMillis,
utimesMillis,
utimesMillisSync
}
diff --git a/node_modules/fs-extra/package.json b/node_modules/fs-extra/package.json
index 559d88b..059000e 100644
--- a/node_modules/fs-extra/package.json
+++ b/node_modules/fs-extra/package.json
@@ -1,9 +1,9 @@
{
"name": "fs-extra",
- "version": "8.1.0",
- "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as mkdir -p, cp -r, and rm -rf.",
+ "version": "10.1.0",
+ "description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.",
"engines": {
- "node": ">=6 <7 || >=8"
+ "node": ">=12"
},
"homepage": "https://github.com/jprichardson/node-fs-extra",
"repository": {
@@ -31,26 +31,26 @@
"create",
"text",
"output",
- "move"
+ "move",
+ "promise"
],
"author": "JP Richardson <jprichardson@gmail.com>",
"license": "MIT",
"dependencies": {
"graceful-fs": "^4.2.0",
- "jsonfile": "^4.0.0",
- "universalify": "^0.1.0"
+ "jsonfile": "^6.0.1",
+ "universalify": "^2.0.0"
},
"devDependencies": {
- "coveralls": "^3.0.0",
- "istanbul": "^0.4.5",
+ "at-least-node": "^1.0.0",
"klaw": "^2.1.1",
"klaw-sync": "^3.0.2",
"minimist": "^1.1.1",
"mocha": "^5.0.5",
+ "nyc": "^15.0.0",
"proxyquire": "^2.0.1",
"read-dir-files": "^0.1.1",
- "semver": "^5.3.0",
- "standard": "^12.0.1"
+ "standard": "^16.0.3"
},
"main": "./lib/index.js",
"files": [
@@ -58,12 +58,10 @@
"!lib/**/__tests__/"
],
"scripts": {
- "full-ci": "npm run lint && npm run coverage",
- "coverage": "istanbul cover -i 'lib/**' -x '**/__tests__/**' test.js",
- "coveralls": "coveralls < coverage/lcov.info",
"lint": "standard",
"test-find": "find ./lib/**/__tests__ -name *.test.js | xargs mocha",
"test": "npm run lint && npm run unit",
- "unit": "node test.js"
- }
+ "unit": "nyc node test.js"
+ },
+ "sideEffects": false
}
diff --git a/node_modules/jsonfile/CHANGELOG.md b/node_modules/jsonfile/CHANGELOG.md
index 7718857..d772e43 100644
--- a/node_modules/jsonfile/CHANGELOG.md
+++ b/node_modules/jsonfile/CHANGELOG.md
@@ -1,3 +1,29 @@
+6.1.0 / 2020-10-31
+------------------
+
+- Add `finalEOL` option to disable writing final EOL ([#115](https://github.com/jprichardson/node-jsonfile/issues/115), [#137](https://github.com/jprichardson/node-jsonfile/pull/137))
+- Update dependency ([#138](https://github.com/jprichardson/node-jsonfile/pull/138))
+
+6.0.1 / 2020-03-07
+------------------
+
+- Update dependency ([#130](https://github.com/jprichardson/node-jsonfile/pull/130))
+- Fix code style ([#129](https://github.com/jprichardson/node-jsonfile/pull/129))
+
+6.0.0 / 2020-02-24
+------------------
+
+- **BREAKING:** Drop support for Node 6 & 8 ([#128](https://github.com/jprichardson/node-jsonfile/pull/128))
+- **BREAKING:** Do not allow passing `null` as options to `readFile()` or `writeFile()` ([#128](https://github.com/jprichardson/node-jsonfile/pull/128))
+- Refactor internals ([#128](https://github.com/jprichardson/node-jsonfile/pull/128))
+
+5.0.0 / 2018-09-08
+------------------
+
+- **BREAKING:** Drop Node 4 support
+- **BREAKING:** If no callback is passed to an asynchronous method, a promise is now returned ([#109](https://github.com/jprichardson/node-jsonfile/pull/109))
+- Cleanup docs
+
4.0.0 / 2017-07-12
------------------
diff --git a/node_modules/jsonfile/README.md b/node_modules/jsonfile/README.md
index 721685c..910cde0 100644
--- a/node_modules/jsonfile/README.md
+++ b/node_modules/jsonfile/README.md
@@ -1,7 +1,7 @@
Node.js - jsonfile
================
-Easily read/write JSON files.
+Easily read/write JSON files in Node.js. _Note: this module cannot be used in the browser._
[](https://www.npmjs.org/package/jsonfile)
[](http://travis-ci.org/jprichardson/node-jsonfile)
@@ -26,101 +26,152 @@
API
---
+* [`readFile(filename, [options], callback)`](#readfilefilename-options-callback)
+* [`readFileSync(filename, [options])`](#readfilesyncfilename-options)
+* [`writeFile(filename, obj, [options], callback)`](#writefilefilename-obj-options-callback)
+* [`writeFileSync(filename, obj, [options])`](#writefilesyncfilename-obj-options)
+
+----
+
### readFile(filename, [options], callback)
-`options` (`object`, default `undefined`): Pass in any `fs.readFile` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).
+`options` (`object`, default `undefined`): Pass in any [`fs.readFile`](https://nodejs.org/api/fs.html#fs_fs_readfile_path_options_callback) options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).
- `throws` (`boolean`, default: `true`). If `JSON.parse` throws an error, pass this error to the callback.
If `false`, returns `null` for the object.
```js
-var jsonfile = require('jsonfile')
-var file = '/tmp/data.json'
-jsonfile.readFile(file, function(err, obj) {
+const jsonfile = require('jsonfile')
+const file = '/tmp/data.json'
+jsonfile.readFile(file, function (err, obj) {
+ if (err) console.error(err)
console.dir(obj)
})
```
+You can also use this method with promises. The `readFile` method will return a promise if you do not pass a callback function.
+
+```js
+const jsonfile = require('jsonfile')
+const file = '/tmp/data.json'
+jsonfile.readFile(file)
+ .then(obj => console.dir(obj))
+ .catch(error => console.error(error))
+```
+
+----
### readFileSync(filename, [options])
-`options` (`object`, default `undefined`): Pass in any `fs.readFileSync` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).
+`options` (`object`, default `undefined`): Pass in any [`fs.readFileSync`](https://nodejs.org/api/fs.html#fs_fs_readfilesync_path_options) options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).
- `throws` (`boolean`, default: `true`). If an error is encountered reading or parsing the file, throw the error. If `false`, returns `null` for the object.
```js
-var jsonfile = require('jsonfile')
-var file = '/tmp/data.json'
+const jsonfile = require('jsonfile')
+const file = '/tmp/data.json'
console.dir(jsonfile.readFileSync(file))
```
+----
### writeFile(filename, obj, [options], callback)
-`options`: Pass in any `fs.writeFile` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces` and override `EOL` string.
+`options`: Pass in any [`fs.writeFile`](https://nodejs.org/api/fs.html#fs_fs_writefile_file_data_options_callback) options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces`, or override `EOL` string or set `finalEOL` flag as `false` to not save the file with `EOL` at the end.
```js
-var jsonfile = require('jsonfile')
+const jsonfile = require('jsonfile')
-var file = '/tmp/data.json'
-var obj = {name: 'JP'}
+const file = '/tmp/data.json'
+const obj = { name: 'JP' }
jsonfile.writeFile(file, obj, function (err) {
- console.error(err)
+ if (err) console.error(err)
})
```
+Or use with promises as follows:
+
+```js
+const jsonfile = require('jsonfile')
+
+const file = '/tmp/data.json'
+const obj = { name: 'JP' }
+
+jsonfile.writeFile(file, obj)
+ .then(res => {
+ console.log('Write complete')
+ })
+ .catch(error => console.error(error))
+```
+
**formatting with spaces:**
```js
-var jsonfile = require('jsonfile')
+const jsonfile = require('jsonfile')
-var file = '/tmp/data.json'
-var obj = {name: 'JP'}
+const file = '/tmp/data.json'
+const obj = { name: 'JP' }
-jsonfile.writeFile(file, obj, {spaces: 2}, function(err) {
- console.error(err)
+jsonfile.writeFile(file, obj, { spaces: 2 }, function (err) {
+ if (err) console.error(err)
})
```
**overriding EOL:**
```js
-var jsonfile = require('jsonfile')
+const jsonfile = require('jsonfile')
-var file = '/tmp/data.json'
-var obj = {name: 'JP'}
+const file = '/tmp/data.json'
+const obj = { name: 'JP' }
-jsonfile.writeFile(file, obj, {spaces: 2, EOL: '\r\n'}, function(err) {
- console.error(err)
+jsonfile.writeFile(file, obj, { spaces: 2, EOL: '\r\n' }, function (err) {
+ if (err) console.error(err)
+})
+```
+
+
+**disabling the EOL at the end of file:**
+
+```js
+const jsonfile = require('jsonfile')
+
+const file = '/tmp/data.json'
+const obj = { name: 'JP' }
+
+jsonfile.writeFile(file, obj, { spaces: 2, finalEOL: false }, function (err) {
+ if (err) console.log(err)
})
```
**appending to an existing JSON file:**
-You can use `fs.writeFile` option `{flag: 'a'}` to achieve this.
+You can use `fs.writeFile` option `{ flag: 'a' }` to achieve this.
```js
-var jsonfile = require('jsonfile')
+const jsonfile = require('jsonfile')
-var file = '/tmp/mayAlreadyExistedData.json'
-var obj = {name: 'JP'}
+const file = '/tmp/mayAlreadyExistedData.json'
+const obj = { name: 'JP' }
-jsonfile.writeFile(file, obj, {flag: 'a'}, function (err) {
- console.error(err)
+jsonfile.writeFile(file, obj, { flag: 'a' }, function (err) {
+ if (err) console.error(err)
})
```
+----
+
### writeFileSync(filename, obj, [options])
-`options`: Pass in any `fs.writeFileSync` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces` and override `EOL` string.
+`options`: Pass in any [`fs.writeFileSync`](https://nodejs.org/api/fs.html#fs_fs_writefilesync_file_data_options) options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). Can also pass in `spaces`, or override `EOL` string or set `finalEOL` flag as `false` to not save the file with `EOL` at the end.
```js
-var jsonfile = require('jsonfile')
+const jsonfile = require('jsonfile')
-var file = '/tmp/data.json'
-var obj = {name: 'JP'}
+const file = '/tmp/data.json'
+const obj = { name: 'JP' }
jsonfile.writeFileSync(file, obj)
```
@@ -128,36 +179,47 @@
**formatting with spaces:**
```js
-var jsonfile = require('jsonfile')
+const jsonfile = require('jsonfile')
-var file = '/tmp/data.json'
-var obj = {name: 'JP'}
+const file = '/tmp/data.json'
+const obj = { name: 'JP' }
-jsonfile.writeFileSync(file, obj, {spaces: 2})
+jsonfile.writeFileSync(file, obj, { spaces: 2 })
```
**overriding EOL:**
```js
-var jsonfile = require('jsonfile')
+const jsonfile = require('jsonfile')
-var file = '/tmp/data.json'
-var obj = {name: 'JP'}
+const file = '/tmp/data.json'
+const obj = { name: 'JP' }
-jsonfile.writeFileSync(file, obj, {spaces: 2, EOL: '\r\n'})
+jsonfile.writeFileSync(file, obj, { spaces: 2, EOL: '\r\n' })
+```
+
+**disabling the EOL at the end of file:**
+
+```js
+const jsonfile = require('jsonfile')
+
+const file = '/tmp/data.json'
+const obj = { name: 'JP' }
+
+jsonfile.writeFileSync(file, obj, { spaces: 2, finalEOL: false })
```
**appending to an existing JSON file:**
-You can use `fs.writeFileSync` option `{flag: 'a'}` to achieve this.
+You can use `fs.writeFileSync` option `{ flag: 'a' }` to achieve this.
```js
-var jsonfile = require('jsonfile')
+const jsonfile = require('jsonfile')
-var file = '/tmp/mayAlreadyExistedData.json'
-var obj = {name: 'JP'}
+const file = '/tmp/mayAlreadyExistedData.json'
+const obj = { name: 'JP' }
-jsonfile.writeFileSync(file, obj, {flag: 'a'})
+jsonfile.writeFileSync(file, obj, { flag: 'a' })
```
License
diff --git a/node_modules/jsonfile/index.js b/node_modules/jsonfile/index.js
index d1e5827..0582868 100644
--- a/node_modules/jsonfile/index.js
+++ b/node_modules/jsonfile/index.js
@@ -1,69 +1,58 @@
-var _fs
+let _fs
try {
_fs = require('graceful-fs')
} catch (_) {
_fs = require('fs')
}
+const universalify = require('universalify')
+const { stringify, stripBom } = require('./utils')
-function readFile (file, options, callback) {
- if (callback == null) {
- callback = options
- options = {}
- }
-
+async function _readFile (file, options = {}) {
if (typeof options === 'string') {
- options = {encoding: options}
+ options = { encoding: options }
}
- options = options || {}
- var fs = options.fs || _fs
+ const fs = options.fs || _fs
- var shouldThrow = true
- if ('throws' in options) {
- shouldThrow = options.throws
- }
+ const shouldThrow = 'throws' in options ? options.throws : true
- fs.readFile(file, options, function (err, data) {
- if (err) return callback(err)
+ let data = await universalify.fromCallback(fs.readFile)(file, options)
- data = stripBom(data)
+ data = stripBom(data)
- var obj
- try {
- obj = JSON.parse(data, options ? options.reviver : null)
- } catch (err2) {
- if (shouldThrow) {
- err2.message = file + ': ' + err2.message
- return callback(err2)
- } else {
- return callback(null, null)
- }
+ let obj
+ try {
+ obj = JSON.parse(data, options ? options.reviver : null)
+ } catch (err) {
+ if (shouldThrow) {
+ err.message = `${file}: ${err.message}`
+ throw err
+ } else {
+ return null
}
+ }
- callback(null, obj)
- })
+ return obj
}
-function readFileSync (file, options) {
- options = options || {}
+const readFile = universalify.fromPromise(_readFile)
+
+function readFileSync (file, options = {}) {
if (typeof options === 'string') {
- options = {encoding: options}
+ options = { encoding: options }
}
- var fs = options.fs || _fs
+ const fs = options.fs || _fs
- var shouldThrow = true
- if ('throws' in options) {
- shouldThrow = options.throws
- }
+ const shouldThrow = 'throws' in options ? options.throws : true
try {
- var content = fs.readFileSync(file, options)
+ let content = fs.readFileSync(file, options)
content = stripBom(content)
return JSON.parse(content, options.reviver)
} catch (err) {
if (shouldThrow) {
- err.message = file + ': ' + err.message
+ err.message = `${file}: ${err.message}`
throw err
} else {
return null
@@ -71,64 +60,29 @@
}
}
-function stringify (obj, options) {
- var spaces
- var EOL = '\n'
- if (typeof options === 'object' && options !== null) {
- if (options.spaces) {
- spaces = options.spaces
- }
- if (options.EOL) {
- EOL = options.EOL
- }
- }
+async function _writeFile (file, obj, options = {}) {
+ const fs = options.fs || _fs
- var str = JSON.stringify(obj, options ? options.replacer : null, spaces)
+ const str = stringify(obj, options)
- return str.replace(/\n/g, EOL) + EOL
+ await universalify.fromCallback(fs.writeFile)(file, str, options)
}
-function writeFile (file, obj, options, callback) {
- if (callback == null) {
- callback = options
- options = {}
- }
- options = options || {}
- var fs = options.fs || _fs
+const writeFile = universalify.fromPromise(_writeFile)
- var str = ''
- try {
- str = stringify(obj, options)
- } catch (err) {
- // Need to return whether a callback was passed or not
- if (callback) callback(err, null)
- return
- }
+function writeFileSync (file, obj, options = {}) {
+ const fs = options.fs || _fs
- fs.writeFile(file, str, options, callback)
-}
-
-function writeFileSync (file, obj, options) {
- options = options || {}
- var fs = options.fs || _fs
-
- var str = stringify(obj, options)
+ const str = stringify(obj, options)
// not sure if fs.writeFileSync returns anything, but just in case
return fs.writeFileSync(file, str, options)
}
-function stripBom (content) {
- // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified
- if (Buffer.isBuffer(content)) content = content.toString('utf8')
- content = content.replace(/^\uFEFF/, '')
- return content
-}
-
-var jsonfile = {
- readFile: readFile,
- readFileSync: readFileSync,
- writeFile: writeFile,
- writeFileSync: writeFileSync
+const jsonfile = {
+ readFile,
+ readFileSync,
+ writeFile,
+ writeFileSync
}
module.exports = jsonfile
diff --git a/node_modules/jsonfile/package.json b/node_modules/jsonfile/package.json
index 29e783f..4d01eb1 100644
--- a/node_modules/jsonfile/package.json
+++ b/node_modules/jsonfile/package.json
@@ -1,6 +1,6 @@
{
"name": "jsonfile",
- "version": "4.0.0",
+ "version": "6.1.0",
"description": "Easily read/write JSON files.",
"repository": {
"type": "git",
@@ -16,18 +16,21 @@
],
"author": "JP Richardson <jprichardson@gmail.com>",
"license": "MIT",
- "dependencies": {},
+ "dependencies": {
+ "universalify": "^2.0.0"
+ },
"optionalDependencies": {
"graceful-fs": "^4.1.6"
},
"devDependencies": {
- "mocha": "2.x",
+ "mocha": "^8.2.0",
"rimraf": "^2.4.0",
- "standard": "^10.0.3"
+ "standard": "^16.0.1"
},
"main": "index.js",
"files": [
- "index.js"
+ "index.js",
+ "utils.js"
],
"scripts": {
"lint": "standard",
diff --git a/node_modules/jsonfile/utils.js b/node_modules/jsonfile/utils.js
new file mode 100644
index 0000000..b5ff48e
--- /dev/null
+++ b/node_modules/jsonfile/utils.js
@@ -0,0 +1,14 @@
+function stringify (obj, { EOL = '\n', finalEOL = true, replacer = null, spaces } = {}) {
+ const EOF = finalEOL ? EOL : ''
+ const str = JSON.stringify(obj, replacer, spaces)
+
+ return str.replace(/\n/g, EOL) + EOF
+}
+
+function stripBom (content) {
+ // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified
+ if (Buffer.isBuffer(content)) content = content.toString('utf8')
+ return content.replace(/^\uFEFF/, '')
+}
+
+module.exports = { stringify, stripBom }
diff --git a/node_modules/log4js/CHANGELOG.md b/node_modules/log4js/CHANGELOG.md
index 94f4252..8333e7b 100644
--- a/node_modules/log4js/CHANGELOG.md
+++ b/node_modules/log4js/CHANGELOG.md
@@ -1,4 +1,167 @@
-# log4js-node changelog
+# log4js-node Changelog
+
+## 6.4.5
+
+- [chore(fix): deserialise for enableCallStack features: filename, lineNumber, columnNumber, callStack](https://github.com/log4js-node/log4js-node/pull/1230) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(fix): fileDepth for ESM](https://github.com/log4js-node/log4js-node/pull/1224) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(refactor): replace deprecated String.prototype.substr()](https://github.com/log4js-node/log4js-node/pull/1223) - thanks [@CommanderRoot](https://github.com/CommanderRoot)
+- [chore(types): LogEvent types](https://github.com/log4js-node/log4js-node/pull/1231) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(docs): updated typescript usage](https://github.com/log4js-node/log4js-node/pull/1229) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(dep): updated dependencies](https://github.com/log4js-node/log4js-node/pull/1232) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(dep): bump date-format from 4.0.6 to 4.0.7
+ - chore(dep): bump streamroller from 3.0.6 to 3.0.7
+ - updated package-lock.json
+- [chore(dep): updated dependencies](https://github.com/log4js-node/log4js-node/pull/1228) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(dev): bump eslint from 8.11.0 to 8.13.0
+ - chore(dev): bump eslint-plugin-import from 2.25.4 to 2.26.0
+ - chore(dev): bump tap from 16.0.0 to 16.0.1
+ - chore(dev): bump typescript from 4.6.2 to 4.6.3
+ - updated package-lock.json
+- [chore(deps): bump minimist from 1.2.5 to 1.2.6](https://github.com/log4js-node/log4js-node/pull/1227) - thanks [@Dependabot](https://github.com/dependabot)
+
+## 6.4.4
+
+- [chore(fix): set logger.level on runtime will no longer wrongly reset useCallStack](https://github.com/log4js-node/log4js-node/pull/1217) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(docs): updated docs for broken links and inaccessible pages](https://github.com/log4js-node/log4js-node/pull/1219) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(docs): broken link to gelf appender](https://github.com/log4js-node/log4js-node/pull/1218) - thanks [@mattalexx](https://github.com/mattalexx)
+- [chore(docs): updated docs for appenders module loading](https://github.com/log4js-node/log4js-node/pull/985) - thanks [@leonimurilo](https://github.com/leonimurilo)
+- [chore(dep): updated dependencies](https://github.com/log4js-node/log4js-node/pull/1221) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(dep): bump streamroller from 3.0.5 to 3.0.6
+ - chore(dep): bump debug from 4.3.3 to 4.3.4
+ - chore(dep): bump date-format from 4.0.5 to 4.0.6
+ - chore(dev): bump prettier from 2.5.1 to 2.6.0
+ - updated package-lock.json
+
+## 6.4.3
+
+- chore(test): 100% test coverage - thanks [@peteriman](https://github.com/peteriman)
+ - Part 1 of 3: https://github.com/log4js-node/log4js-node/pull/1200
+ - Part 2 of 3: https://github.com/log4js-node/log4js-node/pull/1204
+ - Part 3 of 3: https://github.com/log4js-node/log4js-node/pull/1205
+ - [chore(test): improved test cases](https://github.com/log4js-node/log4js-node/pull/1211)
+- [chore(validation): added filename validation](https://github.com/log4js-node/log4js-node/pull/1201) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(improvement): do not initialise default appenders as it will be done again by configure()](https://github.com/log4js-node/log4js-node/pull/1210) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(improvement): defensive coding for cluster=null if require('cluster') fails in try-catch ](https://github.com/log4js-node/log4js-node/pull/1199) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(improvement): removed redundant logic in tcp-serverAppender](https://github.com/log4js-node/log4js-node/pull/1198) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(improvement): removed redundant logic in multiprocessAppender](https://github.com/log4js-node/log4js-node/pull/1197) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(docs): updated README.md with badges](https://github.com/log4js-node/log4js-node/pull/1209) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(docs): added docs for istanbul ignore](https://github.com/log4js-node/log4js-node/pull/1208) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(docs): updated logger api docs](https://github.com/log4js-node/log4js-node/pull/1203) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(docs): updated file and fileSync appender docs](https://github.com/log4js-node/log4js-node/pull/1202) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(lint): improve eslint rules](https://github.com/log4js-node/log4js-node/pull/1206) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(dep): updated dependencies](https://github.com/log4js-node/log4js-node/pull/1207) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(dev): bump eslint from 8.10.0 to 8.11.0
+ - chore(dev): bump eslint-config-airbnb-base from 13.2.0 to 15.0.0
+ - chore(dev): bump eslint-config-prettier from 8.4.0 to 8.5.0
+ - chore(dev): bump tap from 15.1.6 to 16.0.0
+ - chore(dep): bump date-format from 4.0.4 to 4.0.5
+ - chore(dep): bump streamroller from 3.0.4 to 3.0.5
+ - chore(dep): updated package-lock.json
+
+## 6.4.2
+
+- [bug: fixed fileSync appender to create directory recursively](https://github.com/log4js-node/log4js-node/pull/1191) - thanks [@peteriman](https://github.com/peteriman)
+- [bug: fixed serialise() for NaN, Infinity, -Infinity and undefined](https://github.com/log4js-node/log4js-node/pull/1188) - thanks [@peteriman](https://github.com/peteriman)
+- [bug: fixed connectLogger not logging on close](https://github.com/log4js-node/log4js-node/pull/1179) - thanks [@peteriman](https://github.com/peteriman)
+- [improvement: defensive coding](https://github.com/log4js-node/log4js-node/pull/1183) - thanks [@peteriman](https://github.com/peteriman)
+- [type: fixed Logger constructor](https://github.com/log4js-node/log4js-node/pull/1177) - thanks [@peteriman](https://github.com/peteriman)
+- [test: improve test coverage](https://github.com/log4js-node/log4js-node/pull/1184) - thanks [@peteriman](https://github.com/peteriman)
+- [test: refactor and replaced tap deprecation in preparation for tap v15](https://github.com/log4js-node/log4js-node/pull/1172) - thanks [@peteriman](https://github.com/peteriman)
+- [test: added e2e test for multiprocess Appender](https://github.com/log4js-node/log4js-node/pull/1170) - thanks [@nicojs](https://github.com/nicojs)
+- [chore(docs): updated file appender docs](https://github.com/log4js-node/log4js-node/pull/1182) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(docs): updated dateFile appender docs](https://github.com/log4js-node/log4js-node/pull/1181) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(docs): corrected typo in sample code for multiFile appender](https://github.com/log4js-node/log4js-node/pull/1180) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(deps): updated deps-dev](https://github.com/log4js-node/log4js-node/pull/1194) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(deps): bump date-format from 4.0.3 to 4.0.4
+ - chore(deps): bump streamroller from 3.0.2 to 3.0.4
+ - issue: addresses compatibility issue with directory creation for NodeJS < 10.12.0 ([#1189](https://github.com/log4js-node/log4js-node/issues/1189)) - details: [streamroller@3.0.3 changelog](https://github.com/log4js-node/streamroller/blob/master/CHANGELOG.md)
+ - chore(deps-dev): bump eslint from 8.8.0 to 8.10.0
+ - chore(deps-dev): bump eslint-config-prettier from 8.3.0 to 8.4.0
+ - chore(deps-dev): bump fs-extra from 10.0.0 to 10.0.1
+ - chore(deps-dev): bump typescript from 4.5.5 to 4.6.2
+- [chore(deps): updated deps-dev](https://github.com/log4js-node/log4js-node/pull/1185) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(deps): bump flatted from 3.2.4 to 3.2.5
+ - chore(deps-dev): bump eslint from 8.7.0 to 8.8.0
+- [chore(deps): updated package-lock.json](https://github.com/log4js-node/log4js-node/pull/1174) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(deps-dev): bump tap from 14.10.7 to 15.1.6](https://github.com/log4js-node/log4js-node/pull/1173) - thanks [@peteriman](https://github.com/peteriman)
+
+## 6.4.1
+
+- [bug: Fixed to startup multiprocess even when no direct appenders](https://github.com/log4js-node/log4js-node/pull/1162) - thanks [@nicojs](https://github.com/nicojs)
+ - [refactor: fixed eslint warnings](https://github.com/log4js-node/log4js-node/pull/1165) - thanks [@peteriman](https://github.com/peteriman)
+- [improvement: additional alias for date patterns](https://github.com/log4js-node/log4js-node/pull/1163) - thanks [@peteriman](https://github.com/peteriman)
+- [improvement: added emitWarning for deprecation](https://github.com/log4js-node/log4js-node/pull/1164) - thanks [@peteriman](https://github.com/peteriman)
+- [type: Fixed wrong types from 6.4.0 regression](https://github.com/log4js-node/log4js-node/pull/1158) - thanks [@glasser](https://github.com/glasser)
+- [chore(docs): changed author to contributors in package.json](https://github.com/log4js-node/log4js-node/pull/1153) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(deps): bump node-fetch from 2.6.6 to 2.6.7](https://github.com/log4js-node/log4js-node/pull/1167) - thanks [@Dependabot](https://github.com/dependabot)
+- [chore(deps-dev): bump typescript from 4.5.4 to 4.5.5](https://github.com/log4js-node/log4js-node/pull/1166) - thanks [@peteriman](https://github.com/peteriman)
+
+## 6.4.0 - BREAKING CHANGE 💥
+New default file permissions may cause external applications unable to read logs.
+A [manual code/configuration change](https://github.com/log4js-node/log4js-node/pull/1141#issuecomment-1076224470) is required.
+
+- [security: default file permission to be 0o600 instead of 0o644](https://github.com/log4js-node/log4js-node/pull/1141) - thanks [ranjit-git](https://www.huntr.dev/users/ranjit-git) and [@peteriman](https://github.com/peteriman)
+ - [chore(docs): updated fileSync.md and misc comments](https://github.com/log4js-node/log4js-node/pull/1148) - thanks [@peteriman](https://github.com/peteriman)
+- [feat: Added warnings when log() is used with invalid levels before fallbacking to INFO](https://github.com/log4js-node/log4js-node/pull/1062) - thanks [@abernh](https://github.com/abernh)
+- [feat: exposed Recording](https://github.com/log4js-node/log4js-node/pull/1103) - thanks [@polo-language](https://github.com/polo-language)
+- [bug: Fixed file descriptor leak if repeated configure()](https://github.com/log4js-node/log4js-node/pull/1113) - thanks [@peteriman](https://github.com/peteriman)
+- [bug: Fixed MaxListenersExceededWarning from NodeJS](https://github.com/log4js-node/log4js-node/pull/1110) - thanks [@peteriman](https://github.com/peteriman)
+ - [test: added assertion for increase of SIGHUP listeners on log4js.configure()](https://github.com/log4js-node/log4js-node/pull/1142) - thanks [@peteriman](https://github.com/peteriman)
+- [bug: Fixed missing TCP appender with Webpack and Typescript](https://github.com/log4js-node/log4js-node/pull/1028) - thanks [@techmunk](https://github.com/techmunk)
+- [bug: Fixed dateFile appender exiting NodeJS on error](https://github.com/log4js-node/log4js-node/pull/1097) - thanks [@4eb0da](https://github.com/4eb0da)
+ - [refactor: using writer.writable instead of alive for checking](https://github.com/log4js-node/log4js-node/pull/1144) - thanks [@peteriman](https://github.com/peteriman)
+- [bug: Fixed TCP appender exiting NodeJS on error](https://github.com/log4js-node/log4js-node/pull/1089) - thanks [@jhonatanTeixeira](https://github.com/jhonatanTeixeira)
+- [bug: Fixed multiprocess appender exiting NodeJS on error](https://github.com/log4js-node/log4js-node/pull/529) - thanks [@harlentan](https://github.com/harlentan)
+- [test: update fakeFS.read as graceful-fs uses it](https://github.com/log4js-node/log4js-node/pull/1127) - thanks [@peteriman](https://github.com/peteriman)
+- [test: update fakeFS.realpath as fs-extra uses it](https://github.com/log4js-node/log4js-node/pull/1128) - thanks [@peteriman](https://github.com/peteriman)
+- test: added tap.tearDown() to clean up test files
+ - [#1143](https://github.com/log4js-node/log4js-node/pull/1143) - thanks [@peteriman](https://github.com/peteriman)
+ - [#1022](https://github.com/log4js-node/log4js-node/pull/1022) - thanks [@abetomo](https://github.com/abetomo)
+- [type: improved @types for AppenderModule](https://github.com/log4js-node/log4js-node/pull/1079) - thanks [@nicobao](https://github.com/nicobao)
+- [type: Updated fileSync appender types](https://github.com/log4js-node/log4js-node/pull/1116) - thanks [@peteriman](https://github.com/peteriman)
+- [type: Removed erroneous type in file appender](https://github.com/log4js-node/log4js-node/pull/1031) - thanks [@vdmtrv](https://github.com/vdmtrv)
+- [type: Updated Logger.log type](https://github.com/log4js-node/log4js-node/pull/1115) - thanks [@ZLundqvist](https://github.com/ZLundqvist)
+- [type: Updated Logger.\_log type](https://github.com/log4js-node/log4js-node/pull/1117) - thanks [@peteriman](https://github.com/peteriman)
+- [type: Updated Logger.level type](https://github.com/log4js-node/log4js-node/pull/1118) - thanks [@peteriman](https://github.com/peteriman)
+- [type: Updated Levels.getLevel type](https://github.com/log4js-node/log4js-node/pull/1072) - thanks [@saulzhong](https://github.com/saulzhong)
+- [chore(deps): bump streamroller from 3.0.1 to 3.0.2](https://github.com/log4js-node/log4js-node/pull/1147) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(deps): bump date-format from 4.0.2 to 4.0.3](https://github.com/log4js-node/log4js-node/pull/1146) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(deps-dev): bump eslint from from 8.6.0 to 8.7.0](https://github.com/log4js-node/log4js-node/pull/1145) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(deps-dev): bump nyc from 14.1.1 to 15.1.0](https://github.com/log4js-node/log4js-node/pull/1140) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(deps-dev): bump eslint from 5.16.0 to 8.6.0](https://github.com/log4js-node/log4js-node/pull/1138) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(deps): bump flatted from 2.0.2 to 3.2.4](https://github.com/log4js-node/log4js-node/pull/1137) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(deps-dev): bump fs-extra from 8.1.0 to 10.0.0](https://github.com/log4js-node/log4js-node/pull/1136) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(deps): bump streamroller from 2.2.4 to 3.0.1](https://github.com/log4js-node/log4js-node/pull/1135) - thanks [@peteriman](https://github.com/peteriman)
+ - [feat: allows for zero backups](https://github.com/log4js-node/log4js-node/pull/1151) - thanks [@peteriman](https://github.com/peteriman)
+ - [api: migrated from daysToKeep to numBackups due to streamroller@^3.0.0](https://github.com/log4js-node/log4js-node/pull/1149) - thanks [@peteriman](https://github.com/peteriman)
+ - [bug: compressed file ignores dateFile appender "mode"](https://github.com/log4js-node/streamroller/pull/65) - thanks [@rnd-debug](https://github.com/rnd-debug)
+ - issue: addresses additional separator in filename ([#1039](https://github.com/log4js-node/log4js-node/issues/1039)) - details: [streamroller@3.0.0 changelog](https://github.com/log4js-node/streamroller/blob/master/CHANGELOG.md)
+ - issue: addresses daysToKeep naming confusion ([#1035](https://github.com/log4js-node/log4js-node/issues/1035), [#1080](https://github.com/log4js-node/log4js-node/issues/1080)) - details: [streamroller@3.0.0 changelog](https://github.com/log4js-node/streamroller/blob/master/CHANGELOG.md)
+- [chore(deps): bump date-format from 3.0.0 to 4.0.2](https://github.com/log4js-node/log4js-node/pull/1134) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(deps): Updated dependencies](https://github.com/log4js-node/log4js-node/pull/1130) - thanks [@peteriman](https://github.com/peteriman)
+ - eslint-config-prettier from 6.15.0 to 8.3.0
+ - eslint-plugin-prettier from 3.4.1 to 4.0.0
+ - husky from 3.1.0 to 7.0.4
+ - prettier from 1.19.0 to 2.5.1
+ - typescript from 3.9.10 to 4.5.4
+- [chore(deps-dev): bump eslint-config-prettier from 6.15.0 to 8.3.0](https://github.com/log4js-node/log4js-node/pull/1129) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(deps): Updated dependencies](https://github.com/log4js-node/log4js-node/pull/1121) - thanks [@peteriman](https://github.com/peteriman)
+ - codecov from 3.6.1 to 3.8.3
+ - eslint-config-prettier from 6.5.0 to 6.15.0
+ - eslint-import-resolver-node from 0.3.2 to 0.3.6
+ - eslint-plugin-import" from 2.18.2 to 2.25.4
+ - eslint-plugin-prettier from 3.1.1 to 3.4.1
+ - husky from 3.0.9 to 3.1.0
+ - prettier from 1.18.2 to 1.19.1
+ - typescript from 3.7.2 to 3.9.10
+- [chore(deps): bump path-parse from 1.0.6 to 1.0.7](https://github.com/log4js-node/log4js-node/pull/1120) - thanks [@Dependabot](https://github.com/dependabot)
+- [chore(deps): bump glob-parent from 5.1.1 to 5.1.2](https://github.com/log4js-node/log4js-node/pull/1084) - thanks [@Dependabot](https://github.com/dependabot)
+- [chore(deps): bump hosted-git-info from 2.7.1 to 2.8.9](https://github.com/log4js-node/log4js-node/pull/1076) - thanks [@Dependabot](https://github.com/dependabot)
+- [chore(deps): bump lodash from 4.17.14 to 4.17.21](https://github.com/log4js-node/log4js-node/pull/1075) - thanks [@Dependabot](https://github.com/dependabot)
+- [chore(deps): bump y18n from 4.0.0 to 4.0.1](https://github.com/log4js-node/log4js-node/pull/1070) - thanks [@Dependabot](https://github.com/dependabot)
+- [chore(deps): bump node-fetch from 2.6.0 to 2.6.1](https://github.com/log4js-node/log4js-node/pull/1047) - thanks [@Dependabot](https://github.com/dependabot)
+- [chore(deps): bump yargs-parser from 13.1.1 to 13.1.2](https://github.com/log4js-node/log4js-node/pull/1045) - thanks [@Dependabot](https://github.com/dependabot)
+- [chore(deps-dev): bump codecov from 3.6.5 to 3.7.1](https://github.com/log4js-node/log4js-node/pull/1033) - thanks [@Dependabot](https://github.com/dependabot)
## 6.3.0
diff --git a/node_modules/log4js/README.md b/node_modules/log4js/README.md
index cb837a7..68dc421 100644
--- a/node_modules/log4js/README.md
+++ b/node_modules/log4js/README.md
@@ -1,4 +1,5 @@
-# log4js-node [](http://travis-ci.org/log4js-node/log4js-node) [](https://codecov.io/gh/log4js-node/log4js-node)
+log4js-node [](https://github.com/log4js-node/log4js-node/actions/workflows/codeql-analysis.yml) [](https://github.com/log4js-node/log4js-node/actions/workflows/node.js.yml)
+===========
[](https://nodei.co/npm/log4js/)
@@ -98,16 +99,15 @@
## TypeScript
```ts
-import { configure, getLogger } from "log4js";
-configure("./filename");
-const logger = getLogger();
-logger.level = "debug";
-logger.debug("Some debug messages");
-
-configure({
+import log4js from "log4js";
+log4js.configure({
appenders: { cheese: { type: "file", filename: "cheese.log" } },
categories: { default: { appenders: ["cheese"], level: "error" } }
});
+
+const logger = log4js.getLogger();
+logger.level = "debug";
+logger.debug("Some debug messages");
```
## Contributing
diff --git a/node_modules/log4js/SECURITY.md b/node_modules/log4js/SECURITY.md
new file mode 100644
index 0000000..f872565
--- /dev/null
+++ b/node_modules/log4js/SECURITY.md
@@ -0,0 +1,19 @@
+# Security Policy
+
+## Supported Versions
+
+We're aiming to only support the latest major version of log4js. Older than that is usually *very* old.
+
+| Version | Supported |
+| ------- | ------------------ |
+| 6.x | :white_check_mark: |
+| < 6.0 | :x: |
+
+## Reporting a Vulnerability
+
+Report vulnerabilities via email to:
+
+* Gareth Jones <gareth.nomiddlename@gmail.com>
+* Lam Wei Li <lam_wei_li@hotmail.com>
+
+Please put "[log4js:security]" in the subject line. We will aim to respond within a day or two.
diff --git a/node_modules/log4js/lib/LoggingEvent.js b/node_modules/log4js/lib/LoggingEvent.js
index 60ce832..f30e5ee 100644
--- a/node_modules/log4js/lib/LoggingEvent.js
+++ b/node_modules/log4js/lib/LoggingEvent.js
@@ -19,7 +19,7 @@
this.categoryName = categoryName;
this.data = data;
this.level = level;
- this.context = Object.assign({}, context);
+ this.context = Object.assign({}, context); // eslint-disable-line prefer-object-spread
this.pid = process.pid;
if (location) {
@@ -32,35 +32,52 @@
}
serialise() {
- const logData = this.data.map((e) => {
+ return flatted.stringify(this, (key, value) => {
// JSON.stringify(new Error('test')) returns {}, which is not really useful for us.
// The following allows us to serialize errors correctly.
- if (e && e.message && e.stack) {
- e = Object.assign({ message: e.message, stack: e.stack }, e);
+ // duck-typing for Error object
+ if (value && value.message && value.stack) {
+ // eslint-disable-next-line prefer-object-spread
+ value = Object.assign({message: value.message, stack: value.stack}, value);
}
- return e;
+ // JSON.stringify({a: parseInt('abc'), b: 1/0, c: -1/0}) returns {a: null, b: null, c: null}.
+ // The following allows us to serialize to NaN, Infinity and -Infinity correctly.
+ else if (typeof value === 'number' && (Number.isNaN(value) || !Number.isFinite(value))) {
+ value = value.toString();
+ }
+ // JSON.stringify([undefined]) returns [null].
+ // The following allows us to serialize to undefined correctly.
+ else if (typeof value === 'undefined') {
+ value = typeof value;
+ }
+ return value;
});
- this.data = logData;
- return flatted.stringify(this);
}
static deserialise(serialised) {
let event;
try {
- const rehydratedEvent = flatted.parse(serialised);
- rehydratedEvent.data = rehydratedEvent.data.map((e) => {
- if (e && e.message && e.stack) {
- const fakeError = new Error(e);
- Object.keys(e).forEach((key) => { fakeError[key] = e[key]; });
- e = fakeError;
+ const rehydratedEvent = flatted.parse(serialised, (key, value) => {
+ if (value && value.message && value.stack) {
+ const fakeError = new Error(value);
+ Object.keys(value).forEach((k) => { fakeError[k] = value[k]; });
+ value = fakeError;
}
- return e;
+ return value;
});
+ rehydratedEvent.location = {
+ functionName: rehydratedEvent.functionName,
+ fileName: rehydratedEvent.fileName,
+ lineNumber: rehydratedEvent.lineNumber,
+ columnNumber: rehydratedEvent.columnNumber,
+ callStack: rehydratedEvent.callStack
+ };
event = new LoggingEvent(
rehydratedEvent.categoryName,
levels.getLevel(rehydratedEvent.level.levelStr),
rehydratedEvent.data,
- rehydratedEvent.context
+ rehydratedEvent.context,
+ rehydratedEvent.location
);
event.startTime = new Date(rehydratedEvent.startTime);
event.pid = rehydratedEvent.pid;
diff --git a/node_modules/log4js/lib/appenders/adapters.js b/node_modules/log4js/lib/appenders/adapters.js
index 1ec15b8..389c98b 100644
--- a/node_modules/log4js/lib/appenders/adapters.js
+++ b/node_modules/log4js/lib/appenders/adapters.js
@@ -9,8 +9,8 @@
G: 1024 * 1024 * 1024,
};
const validUnit = Object.keys(units);
- const unit = maxLogSize.substr(maxLogSize.length - 1).toLocaleUpperCase();
- const value = maxLogSize.substring(0, maxLogSize.length - 1).trim();
+ const unit = maxLogSize.slice(-1).toLocaleUpperCase();
+ const value = maxLogSize.slice(0, -1).trim();
if (validUnit.indexOf(unit) < 0 || !Number.isInteger(Number(value))) {
throw Error(`maxLogSize: "${maxLogSize}" is invalid`);
@@ -20,7 +20,7 @@
}
function adapter(configAdapter, config) {
- const newConfig = Object.assign({}, config);
+ const newConfig = Object.assign({}, config); // eslint-disable-line prefer-object-spread
Object.keys(configAdapter).forEach((key) => {
if (newConfig[key]) {
newConfig[key] = configAdapter[key](config[key]);
diff --git a/node_modules/log4js/lib/appenders/dateFile.js b/node_modules/log4js/lib/appenders/dateFile.js
index da50ead..76de634 100644
--- a/node_modules/log4js/lib/appenders/dateFile.js
+++ b/node_modules/log4js/lib/appenders/dateFile.js
@@ -3,13 +3,30 @@
const eol = os.EOL;
+function openTheStream(filename, pattern, options) {
+ const stream = new streams.DateRollingFileStream(
+ filename,
+ pattern,
+ options
+ );
+ stream.on('error', (err) => {
+ // eslint-disable-next-line no-console
+ console.error('log4js.dateFileAppender - Writing to file %s, error happened ', filename, err);
+ });
+ stream.on("drain", () => {
+ process.emit("log4js:pause", false);
+ });
+ return stream;
+}
+
/**
* File appender that rolls files according to a date pattern.
- * @filename base filename.
- * @pattern the format that will be added to the end of filename when rolling,
+ * @param filename base filename.
+ * @param pattern the format that will be added to the end of filename when rolling,
* also used to check when to roll files - defaults to '.yyyy-MM-dd'
- * @layout layout function for log messages - defaults to basicLayout
- * @timezoneOffset optional timezone offset in minutes - defaults to system local
+ * @param layout layout function for log messages - defaults to basicLayout
+ * @param options - options to be passed to the underlying stream
+ * @param timezoneOffset - optional timezone offset in minutes (default system local)
*/
function appender(
filename,
@@ -22,26 +39,19 @@
// options should work for dateFile as well.
options.maxSize = options.maxLogSize;
- const logFile = new streams.DateRollingFileStream(
- filename,
- pattern,
- options
- );
-
- logFile.on("drain", () => {
- process.emit("log4js:pause", false);
- });
+ const writer = openTheStream(filename, pattern, options);
const app = function (logEvent) {
- if (!logFile.write(layout(logEvent, timezoneOffset) + eol, "utf8")) {
+ if (!writer.writable) {
+ return;
+ }
+ if (!writer.write(layout(logEvent, timezoneOffset) + eol, "utf8")) {
process.emit("log4js:pause", true);
}
};
app.shutdown = function (complete) {
- logFile.write('', 'utf-8', () => {
- logFile.end(complete);
- });
+ writer.end('', 'utf-8', complete);
};
return app;
@@ -49,7 +59,6 @@
function configure(config, layouts) {
let layout = layouts.basicLayout;
-
if (config.layout) {
layout = layouts.layout(config.layout.type, config.layout);
}
@@ -58,6 +67,9 @@
config.alwaysIncludePattern = false;
}
+ // security default (instead of relying on streamroller default)
+ config.mode = config.mode || 0o600;
+
return appender(
config.filename,
config.pattern,
diff --git a/node_modules/log4js/lib/appenders/file.js b/node_modules/log4js/lib/appenders/file.js
index f2c194b..73dad71 100644
--- a/node_modules/log4js/lib/appenders/file.js
+++ b/node_modules/log4js/lib/appenders/file.js
@@ -5,27 +5,18 @@
const eol = os.EOL;
-function openTheStream(file, fileSize, numFiles, options) {
- const stream = new streams.RollingFileStream(
- file,
- fileSize,
- numFiles,
- options
- );
- stream.on('error', (err) => {
- console.error('log4js.fileAppender - Writing to file %s, error happened ', file, err); //eslint-disable-line
+let mainSighupListenerStarted = false;
+const sighupListeners = new Set();
+function mainSighupHandler() {
+ sighupListeners.forEach((app) => {
+ app.sighupHandler();
});
- stream.on('drain', () => {
- process.emit("log4js:pause", false);
- });
- return stream;
}
-
/**
* File Appender writing the logs to a text file. Supports rolling of logs by size.
*
- * @param file file log messages will be written to
+ * @param file the file log messages will be written to
* @param layout a function that takes a logEvent and returns a string
* (defaults to basicLayout).
* @param logSize - the maximum size (in bytes) for a log file,
@@ -36,10 +27,11 @@
* @param timezoneOffset - optional timezone offset in minutes (default system local)
*/
function fileAppender(file, layout, logSize, numBackups, options, timezoneOffset) {
+ if (typeof file !== "string" || file.length === 0) {
+ throw new Error(`Invalid filename: ${file}`);
+ }
file = path.normalize(file);
- numBackups = numBackups === undefined ? 5 : numBackups;
- // there has to be at least one backup if logSize has been specified
- numBackups = numBackups === 0 ? 1 : numBackups;
+ numBackups = (!numBackups && numBackups !== 0) ? 5 : numBackups;
debug(
'Creating file appender (',
@@ -50,16 +42,36 @@
timezoneOffset, ')'
);
+ function openTheStream(filePath, fileSize, numFiles, opt) {
+ const stream = new streams.RollingFileStream(
+ filePath,
+ fileSize,
+ numFiles,
+ opt
+ );
+ stream.on('error', (err) => {
+ // eslint-disable-next-line no-console
+ console.error('log4js.fileAppender - Writing to file %s, error happened ', filePath, err);
+ });
+ stream.on('drain', () => {
+ process.emit("log4js:pause", false);
+ });
+ return stream;
+ }
+
let writer = openTheStream(file, logSize, numBackups, options);
const app = function (loggingEvent) {
+ if (!writer.writable) {
+ return;
+ }
if (options.removeColor === true) {
// eslint-disable-next-line no-control-regex
const regex = /\x1b[[0-9;]*m/g;
loggingEvent.data = loggingEvent.data.map(d => {
- if (typeof d === 'string') return d.replace(regex, '')
- return d
- })
+ if (typeof d === 'string') return d.replace(regex, '');
+ return d;
+ });
}
if (!writer.write(layout(loggingEvent, timezoneOffset) + eol, "utf8")) {
process.emit('log4js:pause', true);
@@ -76,14 +88,22 @@
};
app.shutdown = function (complete) {
- process.removeListener('SIGHUP', app.sighupHandler);
+ sighupListeners.delete(app);
+ if (sighupListeners.size === 0 && mainSighupListenerStarted) {
+ process.removeListener('SIGHUP', mainSighupHandler);
+ mainSighupListenerStarted = false;
+ }
writer.end('', 'utf-8', complete);
};
// On SIGHUP, close and reopen all files. This allows this appender to work with
// logrotate. Note that if you are using logrotate, you should not set
// `logSize`.
- process.on('SIGHUP', app.sighupHandler);
+ sighupListeners.add(app);
+ if (!mainSighupListenerStarted) {
+ process.on('SIGHUP', mainSighupHandler);
+ mainSighupListenerStarted = true;
+ }
return app;
}
@@ -94,6 +114,9 @@
layout = layouts.layout(config.layout.type, config.layout);
}
+ // security default (instead of relying on streamroller default)
+ config.mode = config.mode || 0o600;
+
return fileAppender(
config.filename,
layout,
diff --git a/node_modules/log4js/lib/appenders/fileSync.js b/node_modules/log4js/lib/appenders/fileSync.js
index 237e273..16dc538 100755
--- a/node_modules/log4js/lib/appenders/fileSync.js
+++ b/node_modules/log4js/lib/appenders/fileSync.js
@@ -3,7 +3,7 @@
const fs = require('fs');
const os = require('os');
-const eol = os.EOL || '\n';
+const eol = os.EOL;
function touchFile(file, options) {
// if the file exists, nothing to do
@@ -11,26 +11,56 @@
return;
}
+ // attempt to create the directory
+ const mkdir = (dir) => {
+ try {
+ return fs.mkdirSync(dir, {recursive: true});
+ }
+ // backward-compatible fs.mkdirSync for nodejs pre-10.12.0 (without recursive option)
+ catch (e) {
+ // recursive creation of parent first
+ if (e.code === 'ENOENT') {
+ mkdir(path.dirname(dir));
+ return mkdir(dir);
+ }
+
+ // throw error for all except EEXIST and EROFS (read-only filesystem)
+ if (e.code !== 'EEXIST' && e.code !== 'EROFS') {
+ throw e;
+ }
+
+ // EEXIST: throw if file and not directory
+ // EROFS : throw if directory not found
+ else {
+ try {
+ if (fs.statSync(dir).isDirectory()) {
+ return dir;
+ }
+ throw e;
+ } catch (err) {
+ throw e;
+ }
+ }
+ }
+ };
+ mkdir(path.dirname(file));
+
// touch the file to apply flags (like w to truncate the file)
const id = fs.openSync(file, options.flags, options.mode);
fs.closeSync(id);
}
class RollingFileSync {
- constructor(filename, size, backups, options) {
+ constructor(filename, maxLogSize, backups, options) {
debug('In RollingFileStream');
- function throwErrorIfArgumentsAreNotValid() {
- if (!filename || !size || size <= 0) {
- throw new Error('You must specify a filename and file size');
- }
+ if (maxLogSize < 0) {
+ throw new Error(`maxLogSize (${maxLogSize}) should be > 0`);
}
- throwErrorIfArgumentsAreNotValid();
-
this.filename = filename;
- this.size = size;
- this.backups = backups || 1;
+ this.size = maxLogSize;
+ this.backups = backups;
this.options = options;
this.currentSize = 0;
@@ -63,24 +93,19 @@
}
function index(filename_) {
- return parseInt(filename_.substring((`${path.basename(filename)}.`).length), 10) || 0;
+ return parseInt(filename_.slice((`${path.basename(filename)}.`).length), 10) || 0;
}
function byIndex(a, b) {
- if (index(a) > index(b)) {
- return 1;
- }
- if (index(a) < index(b)) {
- return -1;
- }
-
- return 0;
+ return index(a) - index(b);
}
function increaseFileIndex(fileToRename) {
const idx = index(fileToRename);
debug(`Index of ${fileToRename} is ${idx}`);
- if (idx < that.backups) {
+ if (that.backups === 0) {
+ fs.truncateSync(filename, 0);
+ } else if (idx < that.backups) {
// on windows, you can get a EEXIST error if you rename a file to an existing file
// so, we'll try to delete the file we're renaming to first
try {
@@ -106,7 +131,7 @@
renameTheFiles();
}
- /* eslint no-unused-vars:0 */
+ // eslint-disable-next-line no-unused-vars
write(chunk, encoding) {
const that = this;
@@ -132,23 +157,31 @@
/**
* File Appender writing the logs to a text file. Supports rolling of logs by size.
*
- * @param file file log messages will be written to
+ * @param file the file log messages will be written to
* @param layout a function that takes a logevent and returns a string
* (defaults to basicLayout).
* @param logSize - the maximum size (in bytes) for a log file,
* if not provided then logs won't be rotated.
* @param numBackups - the number of log files to keep after logSize
* has been reached (default 5)
- * @param timezoneOffset - optional timezone offset in minutes
- * (default system local)
- * @param options - passed as is to fs options
+ * @param options - options to be passed to the underlying stream
+ * @param timezoneOffset - optional timezone offset in minutes (default system local)
*/
-function fileAppender(file, layout, logSize, numBackups, timezoneOffset, options) {
- debug('fileSync appender created');
+function fileAppender(file, layout, logSize, numBackups, options, timezoneOffset) {
+ if (typeof file !== "string" || file.length === 0) {
+ throw new Error(`Invalid filename: ${file}`);
+ }
file = path.normalize(file);
- numBackups = numBackups === undefined ? 5 : numBackups;
- // there has to be at least one backup if logSize has been specified
- numBackups = numBackups === 0 ? 1 : numBackups;
+ numBackups = (!numBackups && numBackups !== 0) ? 5 : numBackups;
+
+ debug(
+ 'Creating fileSync appender (',
+ file, ', ',
+ logSize, ', ',
+ numBackups, ', ',
+ options, ', ',
+ timezoneOffset, ')'
+ );
function openTheStream(filePath, fileSize, numFiles) {
let stream;
@@ -192,7 +225,7 @@
const options = {
flags: config.flags || 'a',
encoding: config.encoding || 'utf8',
- mode: config.mode || 0o644
+ mode: config.mode || 0o600
};
return fileAppender(
@@ -200,8 +233,8 @@
layout,
config.maxLogSize,
config.backups,
- config.timezoneOffset,
- options
+ options,
+ config.timezoneOffset
);
}
diff --git a/node_modules/log4js/lib/appenders/index.js b/node_modules/log4js/lib/appenders/index.js
index e81f268..7069d9e 100644
--- a/node_modules/log4js/lib/appenders/index.js
+++ b/node_modules/log4js/lib/appenders/index.js
@@ -17,13 +17,15 @@
coreAppenders.set('file', require('./file'));
coreAppenders.set('dateFile', require('./dateFile'));
coreAppenders.set('fileSync', require('./fileSync'));
+coreAppenders.set('tcp', require('./tcp'));
const appenders = new Map();
const tryLoading = (modulePath, config) => {
debug('Loading module from ', modulePath);
try {
- return require(modulePath); //eslint-disable-line
+ // eslint-disable-next-line global-require, import/no-dynamic-require
+ return require(modulePath);
} catch (e) {
// if the module was found, and we still got an error, then raise it
configuration.throwExceptionIf(
@@ -38,7 +40,7 @@
const loadAppenderModule = (type, config) => coreAppenders.get(type)
|| tryLoading(`./${type}`, config)
|| tryLoading(type, config)
- || (require.main && tryLoading(path.join(path.dirname(require.main.filename), type), config))
+ || (require.main && require.main.filename && tryLoading(path.join(path.dirname(require.main.filename), type), config))
|| tryLoading(path.join(process.cwd(), type), config);
const appendersLoading = new Set();
@@ -67,14 +69,24 @@
`appender "${name}" is not valid (type "${appenderConfig.type}" could not be found)`
);
if (appenderModule.appender) {
- debug(`DEPRECATION: Appender ${appenderConfig.type} exports an appender function.`);
+ process.emitWarning(
+ `Appender ${appenderConfig.type} exports an appender function.`,
+ "DeprecationWarning", "log4js-node-DEP0001"
+ );
+ debug("[log4js-node-DEP0001]",
+ `DEPRECATION: Appender ${appenderConfig.type} exports an appender function.`);
}
if (appenderModule.shutdown) {
- debug(`DEPRECATION: Appender ${appenderConfig.type} exports a shutdown function.`);
+ process.emitWarning(
+ `Appender ${appenderConfig.type} exports a shutdown function.`,
+ "DeprecationWarning", "log4js-node-DEP0002"
+ );
+ debug("[log4js-node-DEP0002]",
+ `DEPRECATION: Appender ${appenderConfig.type} exports a shutdown function.`);
}
debug(`${name}: clustering.isMaster ? ${clustering.isMaster()}`);
- debug(`${name}: appenderModule is ${require('util').inspect(appenderModule)}`); // eslint-disable-line
+ debug(`${name}: appenderModule is ${require('util').inspect(appenderModule)}`); // eslint-disable-line global-require
return clustering.onlyOnMaster(() => {
debug(`calling appenderModule.configure for ${name} / ${appenderConfig.type}`);
return appenderModule.configure(
@@ -83,26 +95,34 @@
appender => getAppender(appender, config),
levels
);
- }, () => { });
+ }, /* istanbul ignore next: fn never gets called by non-master yet needed to pass config validation */ () => {});
};
const setup = (config) => {
appenders.clear();
appendersLoading.clear();
+ if (!config) {
+ return;
+ }
+
const usedAppenders = [];
Object.values(config.categories).forEach(category => {
- usedAppenders.push(...category.appenders)
+ usedAppenders.push(...category.appenders);
});
Object.keys(config.appenders).forEach((name) => {
- // dodgy hard-coding of special case for tcp-server which may not have
+ // dodgy hard-coding of special case for tcp-server and multiprocess which may not have
// any categories associated with it, but needs to be started up anyway
- if (usedAppenders.includes(name) || config.appenders[name].type === 'tcp-server') {
+ if (usedAppenders.includes(name) || config.appenders[name].type === 'tcp-server'
+ || config.appenders[name].type === 'multiprocess') {
getAppender(name, config);
}
});
};
-setup({ appenders: { out: { type: 'stdout' } }, categories: { default: { appenders: ['out'], level: 'trace' } } });
+const init = () => {
+ setup();
+};
+init();
configuration.addListener((config) => {
configuration.throwExceptionIf(
@@ -129,3 +149,4 @@
configuration.addListener(setup);
module.exports = appenders;
+module.exports.init = init;
diff --git a/node_modules/log4js/lib/appenders/logLevelFilter.js b/node_modules/log4js/lib/appenders/logLevelFilter.js
index 7c9012c..253fedd 100644
--- a/node_modules/log4js/lib/appenders/logLevelFilter.js
+++ b/node_modules/log4js/lib/appenders/logLevelFilter.js
@@ -3,7 +3,7 @@
const maxLevel = levels.getLevel(maxLevelString, levels.FATAL);
return (logEvent) => {
const eventLevel = logEvent.level;
- if (eventLevel.isGreaterThanOrEqualTo(minLevel) && eventLevel.isLessThanOrEqualTo(maxLevel)) {
+ if (minLevel.isLessThanOrEqualTo(eventLevel) && maxLevel.isGreaterThanOrEqualTo(eventLevel)) {
appender(logEvent);
}
};
diff --git a/node_modules/log4js/lib/appenders/multiFile.js b/node_modules/log4js/lib/appenders/multiFile.js
index f15722b..8efb4e1 100644
--- a/node_modules/log4js/lib/appenders/multiFile.js
+++ b/node_modules/log4js/lib/appenders/multiFile.js
@@ -14,6 +14,7 @@
function checkForTimeout(fileKey) {
const timer = timers.get(fileKey);
const app = files.get(fileKey);
+ /* istanbul ignore else: failsafe */
if (timer && app) {
if (Date.now() - timer.lastUsed > timer.timeout) {
debug('%s not used for > %d ms => close', fileKey, timer.timeout);
@@ -26,6 +27,9 @@
}
});
}
+ } else {
+ // will never get here as files and timers are coupled to be added and deleted at same place
+ debug('timer or app does not exist');
}
}
@@ -49,6 +53,7 @@
});
}
} else if (config.timeout) {
+ debug('%s extending activity', fileKey);
timers.get(fileKey).lastUsed = Date.now();
}
@@ -64,7 +69,8 @@
cb();
}
let error;
- timers.forEach((timer) => {
+ timers.forEach((timer, fileKey) => {
+ debug('clearing timer for ', fileKey);
clearInterval(timer.interval);
});
files.forEach((app, fileKey) => {
diff --git a/node_modules/log4js/lib/appenders/multiprocess.js b/node_modules/log4js/lib/appenders/multiprocess.js
index 8aac88a..95b5a9d 100644
--- a/node_modules/log4js/lib/appenders/multiprocess.js
+++ b/node_modules/log4js/lib/appenders/multiprocess.js
@@ -25,17 +25,14 @@
return loggingEvent;
}
- /* eslint prefer-arrow-callback:0 */
- const server = net.createServer(function connectionHandler(clientSocket) {
+ const server = net.createServer((clientSocket) => {
debug('(master) connection received');
clientSocket.setEncoding('utf8');
let logMessage = '';
function logTheMessage(msg) {
- if (logMessage.length > 0) {
- debug('(master) deserialising log event and sending to actual appender');
- actualAppender(deserializeLoggingEvent(clientSocket, msg));
- }
+ debug('(master) deserialising log event and sending to actual appender');
+ actualAppender(deserializeLoggingEvent(clientSocket, msg));
}
function chunkReceived(chunk) {
@@ -43,9 +40,9 @@
let event;
logMessage += chunk || '';
if (logMessage.indexOf(END_MSG) > -1) {
- event = logMessage.substring(0, logMessage.indexOf(END_MSG));
+ event = logMessage.slice(0, logMessage.indexOf(END_MSG));
logTheMessage(event);
- logMessage = logMessage.substring(event.length + END_MSG.length) || '';
+ logMessage = logMessage.slice(event.length + END_MSG.length) || '';
// check for more, maybe it was a big chunk
chunkReceived();
}
@@ -68,7 +65,7 @@
clientSocket.on('error', handleError);
});
- server.listen(config.loggerPort || 5000, config.loggerHost || 'localhost', function (e) {
+ server.listen(config.loggerPort || 5000, config.loggerHost || 'localhost', (e) => {
debug('(master) master server listening, error was ', e);
// allow the process to exit, if this is the only socket active
server.unref();
@@ -102,7 +99,6 @@
function emptyBuffer() {
let evt;
debug('(worker) emptying worker buffer');
- /* eslint no-cond-assign:0 */
while ((evt = buffer.shift())) {
write(evt);
}
@@ -119,7 +115,11 @@
canWrite = true;
});
socket.on('timeout', socket.end.bind(socket));
- // don't bother listening for 'error', 'close' gets called after that anyway
+ socket.on('error', (e) => {
+ debug('connection error', e);
+ canWrite = false;
+ emptyBuffer();
+ });
socket.on('close', createSocket);
}
diff --git a/node_modules/log4js/lib/appenders/tcp-server.js b/node_modules/log4js/lib/appenders/tcp-server.js
index 83553cb..222fe5c 100644
--- a/node_modules/log4js/lib/appenders/tcp-server.js
+++ b/node_modules/log4js/lib/appenders/tcp-server.js
@@ -7,46 +7,41 @@
exports.configure = (config) => {
debug('configure called with ', config);
- // dummy shutdown if we're not master
- let shutdown = (cb) => { cb(); };
- clustering.onlyOnMaster(() => {
- const server = net.createServer((socket) => {
- let dataSoFar = '';
- const send = (data) => {
- if (data) {
- dataSoFar += data;
- if (dataSoFar.indexOf(DELIMITER)) {
- const events = dataSoFar.split(DELIMITER);
- if (!dataSoFar.endsWith(DELIMITER)) {
- dataSoFar = events.pop();
- } else {
- dataSoFar = '';
- }
- events.filter(e => e.length).forEach((e) => {
- clustering.send(LoggingEvent.deserialise(e));
- });
+ const server = net.createServer((socket) => {
+ let dataSoFar = '';
+ const send = (data) => {
+ if (data) {
+ dataSoFar += data;
+ if (dataSoFar.indexOf(DELIMITER)) {
+ const events = dataSoFar.split(DELIMITER);
+ if (!dataSoFar.endsWith(DELIMITER)) {
+ dataSoFar = events.pop();
+ } else {
+ dataSoFar = '';
}
+ events.filter(e => e.length).forEach((e) => {
+ clustering.send(LoggingEvent.deserialise(e));
+ });
+ } else {
+ dataSoFar = '';
}
- };
-
- socket.setEncoding('utf8');
- socket.on('data', send);
- socket.on('end', send);
- });
-
- server.listen(config.port || 5000, config.host || 'localhost', () => {
- debug(`listening on ${config.host || 'localhost'}:${config.port || 5000}`);
- server.unref();
- });
-
- shutdown = (cb) => {
- debug('shutdown called.');
- server.close(cb);
+ }
};
+ socket.setEncoding('utf8');
+ socket.on('data', send);
+ socket.on('end', send);
+ });
+
+ server.listen(config.port || 5000, config.host || 'localhost', () => {
+ debug(`listening on ${config.host || 'localhost'}:${config.port || 5000}`);
+ server.unref();
});
return {
- shutdown
+ shutdown: (cb) => {
+ debug('shutdown called.');
+ server.close(cb);
+ }
};
};
diff --git a/node_modules/log4js/lib/appenders/tcp.js b/node_modules/log4js/lib/appenders/tcp.js
index dd24749..8098d48 100644
--- a/node_modules/log4js/lib/appenders/tcp.js
+++ b/node_modules/log4js/lib/appenders/tcp.js
@@ -18,7 +18,6 @@
function emptyBuffer() {
let evt;
debug('emptying buffer');
- /* eslint no-cond-assign:0 */
while ((evt = buffer.shift())) {
write(evt);
}
@@ -39,7 +38,11 @@
emptyBuffer();
});
socket.on('timeout', socket.end.bind(socket));
- // don't bother listening for 'error', 'close' gets called after that anyway
+ socket.on('error', (e) => {
+ debug('connection error', e);
+ canWrite = false;
+ emptyBuffer();
+ });
socket.on('close', createSocket);
}
diff --git a/node_modules/log4js/lib/categories.js b/node_modules/log4js/lib/categories.js
index b9bb8b1..18c3c1d 100644
--- a/node_modules/log4js/lib/categories.js
+++ b/node_modules/log4js/lib/categories.js
@@ -19,7 +19,7 @@
if (category.inherit === false) return;
const lastDotIndex = categoryName.lastIndexOf('.');
if (lastDotIndex < 0) return; // category is not a child
- const parentCategoryName = categoryName.substring(0, lastDotIndex);
+ const parentCategoryName = categoryName.slice(0, lastDotIndex);
let parentCategory = config.categories[parentCategoryName];
@@ -141,6 +141,9 @@
const setup = (config) => {
categories.clear();
+ if (!config) {
+ return;
+ }
const categoryNames = Object.keys(config.categories);
categoryNames.forEach((name) => {
@@ -161,7 +164,11 @@
});
};
-setup({ categories: { default: { appenders: ['out'], level: 'OFF' } } });
+const init = () => {
+ setup();
+};
+init();
+
configuration.addListener(setup);
const configForCategory = (category) => {
@@ -170,28 +177,27 @@
debug(`configForCategory: ${category} exists in config, returning it`);
return categories.get(category);
}
+
+ let sourceCategoryConfig;
if (category.indexOf('.') > 0) {
- debug(`configForCategory: ${category} has hierarchy, searching for parents`);
- return configForCategory(category.substring(0, category.lastIndexOf('.')));
+ debug(`configForCategory: ${category} has hierarchy, cloning from parents`);
+ sourceCategoryConfig = { ...configForCategory(category.slice(0, category.lastIndexOf('.'))) };
+ } else {
+ if (!categories.has('default')) {
+ setup({ categories: { default: { appenders: ['out'], level: 'OFF' } } });
+ }
+ debug('configForCategory: cloning default category');
+ sourceCategoryConfig = { ...categories.get('default') };
}
- debug('configForCategory: returning config for default category');
- return configForCategory('default');
+ categories.set(category, sourceCategoryConfig);
+ return sourceCategoryConfig;
};
const appendersForCategory = category => configForCategory(category).appenders;
-const getLevelForCategory = category => configForCategory(category).level;
+const getLevelForCategory = category => configForCategory(category).level;
const setLevelForCategory = (category, level) => {
- let categoryConfig = categories.get(category);
- debug(`setLevelForCategory: found ${categoryConfig} for ${category}`);
- if (!categoryConfig) {
- const sourceCategoryConfig = configForCategory(category);
- debug('setLevelForCategory: no config found for category, '
- + `found ${sourceCategoryConfig} for parents of ${category}`);
- categoryConfig = { appenders: sourceCategoryConfig.appenders };
- }
- categoryConfig.level = level;
- categories.set(category, categoryConfig);
+ configForCategory(category).level = level;
};
const getEnableCallStackForCategory = category => configForCategory(category).enableCallStack === true;
@@ -199,10 +205,12 @@
configForCategory(category).enableCallStack = useCallStack;
};
-module.exports = {
+module.exports = categories;
+module.exports = Object.assign(module.exports, {
appendersForCategory,
getLevelForCategory,
setLevelForCategory,
getEnableCallStackForCategory,
setEnableCallStackForCategory,
-};
+ init,
+});
diff --git a/node_modules/log4js/lib/clustering.js b/node_modules/log4js/lib/clustering.js
index ca49cb5..fefe976 100644
--- a/node_modules/log4js/lib/clustering.js
+++ b/node_modules/log4js/lib/clustering.js
@@ -5,7 +5,8 @@
let disabled = false;
let cluster = null;
try {
- cluster = require("cluster"); //eslint-disable-line
+ // eslint-disable-next-line global-require
+ cluster = require("cluster");
} catch (e) {
debug("cluster module not present");
disabled = true;
@@ -17,7 +18,7 @@
let pm2InstanceVar = "NODE_APP_INSTANCE";
const isPM2Master = () => pm2 && process.env[pm2InstanceVar] === "0";
-const isMaster = () => disabled || cluster.isMaster || isPM2Master();
+const isMaster = () => disabled || (cluster && cluster.isMaster) || isPM2Master();
const sendToListeners = logEvent => {
listeners.forEach(l => l(logEvent));
@@ -72,7 +73,7 @@
// we only want one of the app instances to write logs
debug("listening for PM2 broadcast messages");
process.on("message", receiver);
- } else if (cluster.isMaster) {
+ } else if (cluster && cluster.isMaster) {
debug("listening for cluster messages");
cluster.on("message", receiver);
} else {
diff --git a/node_modules/log4js/lib/connect-logger.js b/node_modules/log4js/lib/connect-logger.js
index a7c255f..d39d371 100755
--- a/node_modules/log4js/lib/connect-logger.js
+++ b/node_modules/log4js/lib/connect-logger.js
@@ -1,4 +1,4 @@
-/* eslint-disable no-plusplus */
+/* eslint no-underscore-dangle: ["error", { "allow": ["__statusCode", "_remoteAddress", "__headers", "_logging"] }] */
const levels = require("./levels");
@@ -37,9 +37,9 @@
for (let i = 0; i < a.length; ++i) {
for (let j = i + 1; j < a.length; ++j) {
// not === because token can be regexp object
- /* eslint eqeqeq:0 */
+ // eslint-disable-next-line eqeqeq
if (a[i].token == a[j].token) {
- a.splice(j--, 1);
+ a.splice(j--, 1); // eslint-disable-line no-plusplus
}
}
}
@@ -237,7 +237,6 @@
* @api public
*/
module.exports = function getLogger(logger4js, options) {
- /* eslint no-underscore-dangle:0 */
if (typeof options === "string" || typeof options === "function") {
options = { format: options };
} else {
@@ -273,7 +272,12 @@
};
// hook on end request to emit the log entry of the HTTP request.
- res.on("finish", () => {
+ let finished = false;
+ const handler = () => {
+ if (finished) {
+ return;
+ }
+ finished = true;
res.responseTime = new Date() - start;
// status code response level handling
if (res.statusCode && options.level === "auto") {
@@ -293,7 +297,11 @@
thisLogger.log(level, format(fmt, combinedTokens));
}
if (options.context) thisLogger.removeContext("res");
- });
+ };
+ res.on("end", handler);
+ res.on("finish", handler);
+ res.on("error", handler);
+ res.on("close", handler);
}
// ensure next gets always called
diff --git a/node_modules/log4js/lib/layouts.js b/node_modules/log4js/lib/layouts.js
index ab203e5..a762e4d 100644
--- a/node_modules/log4js/lib/layouts.js
+++ b/node_modules/log4js/lib/layouts.js
@@ -2,6 +2,8 @@
const os = require('os');
const util = require('util');
const path = require('path');
+const url = require('url');
+const debug = require('debug')('log4js:layouts');
const styles = {
// styles
@@ -144,14 +146,42 @@
if (specifier) {
format = specifier;
// Pick up special cases
- if (format === 'ISO8601') {
- format = dateFormat.ISO8601_FORMAT;
- } else if (format === 'ISO8601_WITH_TZ_OFFSET') {
- format = dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT;
- } else if (format === 'ABSOLUTE') {
- format = dateFormat.ABSOLUTETIME_FORMAT;
- } else if (format === 'DATE') {
- format = dateFormat.DATETIME_FORMAT;
+ switch (format) {
+ case 'ISO8601':
+ case 'ISO8601_FORMAT':
+ format = dateFormat.ISO8601_FORMAT;
+ break;
+ case 'ISO8601_WITH_TZ_OFFSET':
+ case 'ISO8601_WITH_TZ_OFFSET_FORMAT':
+ format = dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT;
+ break;
+ case 'ABSOLUTE':
+ process.emitWarning(
+ "Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. " +
+ "Please use %d{ABSOLUTETIME} instead.",
+ "DeprecationWarning", "log4js-node-DEP0003"
+ );
+ debug("[log4js-node-DEP0003]",
+ "DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");
+ // falls through
+ case 'ABSOLUTETIME':
+ case 'ABSOLUTETIME_FORMAT':
+ format = dateFormat.ABSOLUTETIME_FORMAT;
+ break;
+ case 'DATE':
+ process.emitWarning(
+ "Pattern %d{DATE} is deprecated due to the confusion it causes when used. " +
+ "Please use %d{DATETIME} instead.",
+ "DeprecationWarning", "log4js-node-DEP0004"
+ );
+ debug("[log4js-node-DEP0004]",
+ "DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");
+ // falls through
+ case 'DATETIME':
+ case 'DATETIME_FORMAT':
+ format = dateFormat.DATETIME_FORMAT;
+ break;
+ // no default
}
}
// Format the date
@@ -221,6 +251,35 @@
function fileName(loggingEvent, specifier) {
let filename = loggingEvent.fileName || '';
+
+ // support for ESM as it uses url instead of path for file
+ /* istanbul ignore next: unsure how to simulate ESM for test coverage */
+ const convertFileURLToPath = function(filepath) {
+ const urlPrefix = 'file://';
+ if (filepath.startsWith(urlPrefix)) {
+ // https://nodejs.org/api/url.html#urlfileurltopathurl
+ if (typeof url.fileURLToPath === 'function') {
+ filepath = url.fileURLToPath(filepath);
+ }
+ // backward-compatible for nodejs pre-10.12.0 (without url.fileURLToPath method)
+ else {
+ // posix: file:///hello/world/foo.txt -> /hello/world/foo.txt -> /hello/world/foo.txt
+ // win32: file:///C:/path/foo.txt -> /C:/path/foo.txt -> \C:\path\foo.txt -> C:\path\foo.txt
+ // win32: file://nas/foo.txt -> //nas/foo.txt -> nas\foo.txt -> \\nas\foo.txt
+ filepath = path.normalize(filepath.replace(new RegExp(`^${urlPrefix}`), ''));
+ if (process.platform === 'win32') {
+ if (filepath.startsWith('\\')) {
+ filepath = filepath.slice(1);
+ } else {
+ filepath = path.sep + path.sep + filepath;
+ }
+ }
+ }
+ }
+ return filepath;
+ };
+ filename = convertFileURLToPath(filename);
+
if (specifier) {
const fileDepth = parseInt(specifier, 10);
const fileList = filename.split(path.sep);
@@ -244,7 +303,6 @@
return loggingEvent.callStack || '';
}
- /* eslint quote-props:0 */
const replacers = {
c: categoryName,
d: formatAsDate,
@@ -273,7 +331,7 @@
function truncate(truncation, toTruncate) {
let len;
if (truncation) {
- len = parseInt(truncation.substr(1), 10);
+ len = parseInt(truncation.slice(1), 10);
// negative truncate length means truncate from end of string
return len > 0 ? toTruncate.slice(0, len) : toTruncate.slice(len);
}
@@ -285,7 +343,7 @@
let len;
if (padding) {
if (padding.charAt(0) === '-') {
- len = parseInt(padding.substr(1), 10);
+ len = parseInt(padding.slice(1), 10);
// Right pad with spaces
while (toPad.length < len) {
toPad += ' ';
@@ -313,7 +371,6 @@
let result;
let searchString = pattern;
- /* eslint no-cond-assign:0 */
while ((result = regex.exec(searchString)) !== null) {
// const matchedString = result[0];
const padding = result[1];
@@ -331,7 +388,7 @@
const replacement = replaceToken(conversionCharacter, loggingEvent, specifier);
formattedString += truncateAndPad(replacement, truncation, padding);
}
- searchString = searchString.substr(result.index + result[0].length);
+ searchString = searchString.slice(result.index + result[0].length);
}
return formattedString;
};
diff --git a/node_modules/log4js/lib/log4js.js b/node_modules/log4js/lib/log4js.js
index fdd48c8..aef83c5 100644
--- a/node_modules/log4js/lib/log4js.js
+++ b/node_modules/log4js/lib/log4js.js
@@ -29,6 +29,7 @@
const Logger = require("./logger");
const clustering = require("./clustering");
const connectLogger = require("./connect-logger");
+const recordingModule = require("./appenders/recording");
let enabled = false;
@@ -56,6 +57,11 @@
}
function configure(configurationFileOrObject) {
+ if (enabled) {
+ // eslint-disable-next-line no-use-before-define
+ shutdown();
+ }
+
let configObject = configurationFileOrObject;
if (typeof configObject === "string") {
@@ -73,6 +79,10 @@
return log4js;
}
+function recording() {
+ return recordingModule
+}
+
/**
* Shutdown all log appenders. This will first disable all writing to appenders
* and then call the shutdown function each appender.
@@ -87,15 +97,25 @@
// not being able to be drained because of run-away log writes.
enabled = false;
- // Call each of the shutdown functions in parallel
+ // Clone out to maintain a reference
const appendersToCheck = Array.from(appenders.values());
+
+ // Reset immediately to prevent leaks
+ appenders.init();
+ categories.init();
+
+ // Call each of the shutdown functions in parallel
const shutdownFunctions = appendersToCheck.reduceRight(
(accum, next) => (next.shutdown ? accum + 1 : accum),
0
);
+ if (shutdownFunctions === 0) {
+ debug("No appenders with shutdown functions found.");
+ return cb !== undefined && cb();
+ }
+
let completed = 0;
let error;
-
debug(`Found ${shutdownFunctions} appenders with shutdown functions.`);
function complete(err) {
error = error || err;
@@ -108,12 +128,6 @@
}
}
}
-
- if (shutdownFunctions === 0) {
- debug("No appenders with shutdown functions found.");
- return cb !== undefined && cb();
- }
-
appendersToCheck.filter(a => a.shutdown).forEach(a => a.shutdown(complete));
return null;
@@ -150,7 +164,8 @@
shutdown,
connectLogger,
levels,
- addLayout: layouts.addLayout
+ addLayout: layouts.addLayout,
+ recording,
};
module.exports = log4js;
diff --git a/node_modules/log4js/lib/logger.js b/node_modules/log4js/lib/logger.js
index dbfd786..ca36be5 100644
--- a/node_modules/log4js/lib/logger.js
+++ b/node_modules/log4js/lib/logger.js
@@ -1,4 +1,5 @@
-/* eslint no-underscore-dangle:0 */
+/* eslint no-underscore-dangle: ["error", { "allow": ["_log"] }] */
+
const debug = require("debug")("log4js:logger");
const LoggingEvent = require("./LoggingEvent");
const levels = require("./levels");
@@ -7,17 +8,28 @@
const configuration = require("./configuration");
const stackReg = /at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/;
+
function defaultParseCallStack(data, skipIdx = 4) {
- const stacklines = data.stack.split("\n").slice(skipIdx);
- const lineMatch = stackReg.exec(stacklines[0]);
- if (lineMatch && lineMatch.length === 6) {
- return {
- functionName: lineMatch[1],
- fileName: lineMatch[2],
- lineNumber: parseInt(lineMatch[3], 10),
- columnNumber: parseInt(lineMatch[4], 10),
- callStack: stacklines.join("\n")
- };
+ try {
+ const stacklines = data.stack.split("\n").slice(skipIdx);
+ const lineMatch = stackReg.exec(stacklines[0]);
+ /* istanbul ignore else: failsafe */
+ if (lineMatch && lineMatch.length === 6) {
+ return {
+ functionName: lineMatch[1],
+ fileName: lineMatch[2],
+ lineNumber: parseInt(lineMatch[3], 10),
+ columnNumber: parseInt(lineMatch[4], 10),
+ callStack: stacklines.join("\n")
+ };
+ } else { // eslint-disable-line no-else-return
+ // will never get here unless nodejs has changes to Error
+ console.error('log4js.logger - defaultParseCallStack error'); // eslint-disable-line no-console
+ }
+ }
+ catch (err) {
+ // will never get error unless nodejs has breaking changes to Error
+ console.error('log4js.logger - defaultParseCallStack error', err); // eslint-disable-line no-console
}
return null;
}
@@ -48,7 +60,7 @@
get level() {
return levels.getLevel(
categories.getLevelForCategory(this.category),
- levels.TRACE
+ levels.OFF
);
}
@@ -68,7 +80,11 @@
}
log(level, ...args) {
- const logLevel = levels.getLevel(level, levels.INFO);
+ let logLevel = levels.getLevel(level);
+ if (!logLevel) {
+ this._log(levels.WARN, 'log4js:logger.log: invalid value for log-level as first parameter given: ', level);
+ logLevel = levels.INFO;
+ }
if (this.isLevelEnabled(logLevel)) {
this._log(logLevel, args);
}
@@ -116,11 +132,11 @@
);
const isLevelMethod = levelMethod[0].toUpperCase() + levelMethod.slice(1);
- Logger.prototype[`is${isLevelMethod}Enabled`] = function() {
+ Logger.prototype[`is${isLevelMethod}Enabled`] = function () {
return this.isLevelEnabled(level);
};
- Logger.prototype[levelMethod] = function(...args) {
+ Logger.prototype[levelMethod] = function (...args) {
this.log(level, ...args);
};
}
diff --git a/node_modules/log4js/node_modules/debug/LICENSE b/node_modules/log4js/node_modules/debug/LICENSE
new file mode 100644
index 0000000..1a9820e
--- /dev/null
+++ b/node_modules/log4js/node_modules/debug/LICENSE
@@ -0,0 +1,20 @@
+(The MIT License)
+
+Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
+Copyright (c) 2018-2021 Josh Junon
+
+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.
+
diff --git a/node_modules/log4js/node_modules/debug/README.md b/node_modules/log4js/node_modules/debug/README.md
new file mode 100644
index 0000000..e9c3e04
--- /dev/null
+++ b/node_modules/log4js/node_modules/debug/README.md
@@ -0,0 +1,481 @@
+# debug
+[](https://travis-ci.org/debug-js/debug) [](https://coveralls.io/github/debug-js/debug?branch=master) [](https://visionmedia-community-slackin.now.sh/) [](#backers)
+[](#sponsors)
+
+<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
+
+A tiny JavaScript debugging utility modelled after Node.js core's debugging
+technique. Works in Node.js and web browsers.
+
+## Installation
+
+```bash
+$ npm install debug
+```
+
+## Usage
+
+`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
+
+Example [_app.js_](./examples/node/app.js):
+
+```js
+var debug = require('debug')('http')
+ , http = require('http')
+ , name = 'My App';
+
+// fake app
+
+debug('booting %o', name);
+
+http.createServer(function(req, res){
+ debug(req.method + ' ' + req.url);
+ res.end('hello\n');
+}).listen(3000, function(){
+ debug('listening');
+});
+
+// fake worker of some kind
+
+require('./worker');
+```
+
+Example [_worker.js_](./examples/node/worker.js):
+
+```js
+var a = require('debug')('worker:a')
+ , b = require('debug')('worker:b');
+
+function work() {
+ a('doing lots of uninteresting work');
+ setTimeout(work, Math.random() * 1000);
+}
+
+work();
+
+function workb() {
+ b('doing some work');
+ setTimeout(workb, Math.random() * 2000);
+}
+
+workb();
+```
+
+The `DEBUG` environment variable is then used to enable these based on space or
+comma-delimited names.
+
+Here are some examples:
+
+<img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png">
+<img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png">
+<img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png">
+
+#### Windows command prompt notes
+
+##### CMD
+
+On Windows the environment variable is set using the `set` command.
+
+```cmd
+set DEBUG=*,-not_this
+```
+
+Example:
+
+```cmd
+set DEBUG=* & node app.js
+```
+
+##### PowerShell (VS Code default)
+
+PowerShell uses different syntax to set environment variables.
+
+```cmd
+$env:DEBUG = "*,-not_this"
+```
+
+Example:
+
+```cmd
+$env:DEBUG='app';node app.js
+```
+
+Then, run the program to be debugged as usual.
+
+npm script example:
+```js
+ "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js",
+```
+
+## Namespace Colors
+
+Every debug instance has a color generated for it based on its namespace name.
+This helps when visually parsing the debug output to identify which debug instance
+a debug line belongs to.
+
+#### Node.js
+
+In Node.js, colors are enabled when stderr is a TTY. You also _should_ install
+the [`supports-color`](https://npmjs.org/supports-color) module alongside debug,
+otherwise debug will only use a small handful of basic colors.
+
+<img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png">
+
+#### Web Browser
+
+Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
+option. These are WebKit web inspectors, Firefox ([since version
+31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
+and the Firebug plugin for Firefox (any version).
+
+<img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png">
+
+
+## Millisecond diff
+
+When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
+
+<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
+
+When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below:
+
+<img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png">
+
+
+## Conventions
+
+If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output.
+
+## Wildcards
+
+The `*` character may be used as a wildcard. Suppose for example your library has
+debuggers named "connect:bodyParser", "connect:compress", "connect:session",
+instead of listing all three with
+`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do
+`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
+
+You can also exclude specific debuggers by prefixing them with a "-" character.
+For example, `DEBUG=*,-connect:*` would include all debuggers except those
+starting with "connect:".
+
+## Environment Variables
+
+When running through Node.js, you can set a few environment variables that will
+change the behavior of the debug logging:
+
+| Name | Purpose |
+|-----------|-------------------------------------------------|
+| `DEBUG` | Enables/disables specific debugging namespaces. |
+| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). |
+| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
+| `DEBUG_DEPTH` | Object inspection depth. |
+| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
+
+
+__Note:__ The environment variables beginning with `DEBUG_` end up being
+converted into an Options object that gets used with `%o`/`%O` formatters.
+See the Node.js documentation for
+[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
+for the complete list.
+
+## Formatters
+
+Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting.
+Below are the officially supported formatters:
+
+| Formatter | Representation |
+|-----------|----------------|
+| `%O` | Pretty-print an Object on multiple lines. |
+| `%o` | Pretty-print an Object all on a single line. |
+| `%s` | String. |
+| `%d` | Number (both integer and float). |
+| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
+| `%%` | Single percent sign ('%'). This does not consume an argument. |
+
+
+### Custom formatters
+
+You can add custom formatters by extending the `debug.formatters` object.
+For example, if you wanted to add support for rendering a Buffer as hex with
+`%h`, you could do something like:
+
+```js
+const createDebug = require('debug')
+createDebug.formatters.h = (v) => {
+ return v.toString('hex')
+}
+
+// …elsewhere
+const debug = createDebug('foo')
+debug('this is hex: %h', new Buffer('hello world'))
+// foo this is hex: 68656c6c6f20776f726c6421 +0ms
+```
+
+
+## Browser Support
+
+You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
+or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
+if you don't want to build it yourself.
+
+Debug's enable state is currently persisted by `localStorage`.
+Consider the situation shown below where you have `worker:a` and `worker:b`,
+and wish to debug both. You can enable this using `localStorage.debug`:
+
+```js
+localStorage.debug = 'worker:*'
+```
+
+And then refresh the page.
+
+```js
+a = debug('worker:a');
+b = debug('worker:b');
+
+setInterval(function(){
+ a('doing some work');
+}, 1000);
+
+setInterval(function(){
+ b('doing some work');
+}, 1200);
+```
+
+In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_.
+
+<img width="647" src="https://user-images.githubusercontent.com/7143133/152083257-29034707-c42c-4959-8add-3cee850e6fcf.png">
+
+## Output streams
+
+ By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
+
+Example [_stdout.js_](./examples/node/stdout.js):
+
+```js
+var debug = require('debug');
+var error = debug('app:error');
+
+// by default stderr is used
+error('goes to stderr!');
+
+var log = debug('app:log');
+// set this namespace to log via console.log
+log.log = console.log.bind(console); // don't forget to bind to console!
+log('goes to stdout');
+error('still goes to stderr!');
+
+// set all output to go via console.info
+// overrides all per-namespace log settings
+debug.log = console.info.bind(console);
+error('now goes to stdout via console.info');
+log('still goes to stdout, but via console.info now');
+```
+
+## Extend
+You can simply extend debugger
+```js
+const log = require('debug')('auth');
+
+//creates new debug instance with extended namespace
+const logSign = log.extend('sign');
+const logLogin = log.extend('login');
+
+log('hello'); // auth hello
+logSign('hello'); //auth:sign hello
+logLogin('hello'); //auth:login hello
+```
+
+## Set dynamically
+
+You can also enable debug dynamically by calling the `enable()` method :
+
+```js
+let debug = require('debug');
+
+console.log(1, debug.enabled('test'));
+
+debug.enable('test');
+console.log(2, debug.enabled('test'));
+
+debug.disable();
+console.log(3, debug.enabled('test'));
+
+```
+
+print :
+```
+1 false
+2 true
+3 false
+```
+
+Usage :
+`enable(namespaces)`
+`namespaces` can include modes separated by a colon and wildcards.
+
+Note that calling `enable()` completely overrides previously set DEBUG variable :
+
+```
+$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))'
+=> false
+```
+
+`disable()`
+
+Will disable all namespaces. The functions returns the namespaces currently
+enabled (and skipped). This can be useful if you want to disable debugging
+temporarily without knowing what was enabled to begin with.
+
+For example:
+
+```js
+let debug = require('debug');
+debug.enable('foo:*,-foo:bar');
+let namespaces = debug.disable();
+debug.enable(namespaces);
+```
+
+Note: There is no guarantee that the string will be identical to the initial
+enable string, but semantically they will be identical.
+
+## Checking whether a debug target is enabled
+
+After you've created a debug instance, you can determine whether or not it is
+enabled by checking the `enabled` property:
+
+```javascript
+const debug = require('debug')('http');
+
+if (debug.enabled) {
+ // do stuff...
+}
+```
+
+You can also manually toggle this property to force the debug instance to be
+enabled or disabled.
+
+## Usage in child processes
+
+Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process.
+For example:
+
+```javascript
+worker = fork(WORKER_WRAP_PATH, [workerPath], {
+ stdio: [
+ /* stdin: */ 0,
+ /* stdout: */ 'pipe',
+ /* stderr: */ 'pipe',
+ 'ipc',
+ ],
+ env: Object.assign({}, process.env, {
+ DEBUG_COLORS: 1 // without this settings, colors won't be shown
+ }),
+});
+
+worker.stderr.pipe(process.stderr, { end: false });
+```
+
+
+## Authors
+
+ - TJ Holowaychuk
+ - Nathan Rajlich
+ - Andrew Rhyne
+ - Josh Junon
+
+## Backers
+
+Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
+
+<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
+
+
+## Sponsors
+
+Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
+
+<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
+Copyright (c) 2018-2021 Josh Junon
+
+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.
diff --git a/node_modules/log4js/node_modules/debug/package.json b/node_modules/log4js/node_modules/debug/package.json
new file mode 100644
index 0000000..3bcdc24
--- /dev/null
+++ b/node_modules/log4js/node_modules/debug/package.json
@@ -0,0 +1,59 @@
+{
+ "name": "debug",
+ "version": "4.3.4",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/debug-js/debug.git"
+ },
+ "description": "Lightweight debugging utility for Node.js and the browser",
+ "keywords": [
+ "debug",
+ "log",
+ "debugger"
+ ],
+ "files": [
+ "src",
+ "LICENSE",
+ "README.md"
+ ],
+ "author": "Josh Junon <josh.junon@protonmail.com>",
+ "contributors": [
+ "TJ Holowaychuk <tj@vision-media.ca>",
+ "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)",
+ "Andrew Rhyne <rhyneandrew@gmail.com>"
+ ],
+ "license": "MIT",
+ "scripts": {
+ "lint": "xo",
+ "test": "npm run test:node && npm run test:browser && npm run lint",
+ "test:node": "istanbul cover _mocha -- test.js",
+ "test:browser": "karma start --single-run",
+ "test:coverage": "cat ./coverage/lcov.info | coveralls"
+ },
+ "dependencies": {
+ "ms": "2.1.2"
+ },
+ "devDependencies": {
+ "brfs": "^2.0.1",
+ "browserify": "^16.2.3",
+ "coveralls": "^3.0.2",
+ "istanbul": "^0.4.5",
+ "karma": "^3.1.4",
+ "karma-browserify": "^6.0.0",
+ "karma-chrome-launcher": "^2.2.0",
+ "karma-mocha": "^1.3.0",
+ "mocha": "^5.2.0",
+ "mocha-lcov-reporter": "^1.2.0",
+ "xo": "^0.23.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ },
+ "main": "./src/index.js",
+ "browser": "./src/browser.js",
+ "engines": {
+ "node": ">=6.0"
+ }
+}
diff --git a/node_modules/log4js/node_modules/debug/src/browser.js b/node_modules/log4js/node_modules/debug/src/browser.js
new file mode 100644
index 0000000..cd0fc35
--- /dev/null
+++ b/node_modules/log4js/node_modules/debug/src/browser.js
@@ -0,0 +1,269 @@
+/* eslint-env browser */
+
+/**
+ * This is the web browser implementation of `debug()`.
+ */
+
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = localstorage();
+exports.destroy = (() => {
+ let warned = false;
+
+ return () => {
+ if (!warned) {
+ warned = true;
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
+ }
+ };
+})();
+
+/**
+ * Colors.
+ */
+
+exports.colors = [
+ '#0000CC',
+ '#0000FF',
+ '#0033CC',
+ '#0033FF',
+ '#0066CC',
+ '#0066FF',
+ '#0099CC',
+ '#0099FF',
+ '#00CC00',
+ '#00CC33',
+ '#00CC66',
+ '#00CC99',
+ '#00CCCC',
+ '#00CCFF',
+ '#3300CC',
+ '#3300FF',
+ '#3333CC',
+ '#3333FF',
+ '#3366CC',
+ '#3366FF',
+ '#3399CC',
+ '#3399FF',
+ '#33CC00',
+ '#33CC33',
+ '#33CC66',
+ '#33CC99',
+ '#33CCCC',
+ '#33CCFF',
+ '#6600CC',
+ '#6600FF',
+ '#6633CC',
+ '#6633FF',
+ '#66CC00',
+ '#66CC33',
+ '#9900CC',
+ '#9900FF',
+ '#9933CC',
+ '#9933FF',
+ '#99CC00',
+ '#99CC33',
+ '#CC0000',
+ '#CC0033',
+ '#CC0066',
+ '#CC0099',
+ '#CC00CC',
+ '#CC00FF',
+ '#CC3300',
+ '#CC3333',
+ '#CC3366',
+ '#CC3399',
+ '#CC33CC',
+ '#CC33FF',
+ '#CC6600',
+ '#CC6633',
+ '#CC9900',
+ '#CC9933',
+ '#CCCC00',
+ '#CCCC33',
+ '#FF0000',
+ '#FF0033',
+ '#FF0066',
+ '#FF0099',
+ '#FF00CC',
+ '#FF00FF',
+ '#FF3300',
+ '#FF3333',
+ '#FF3366',
+ '#FF3399',
+ '#FF33CC',
+ '#FF33FF',
+ '#FF6600',
+ '#FF6633',
+ '#FF9900',
+ '#FF9933',
+ '#FFCC00',
+ '#FFCC33'
+];
+
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+// eslint-disable-next-line complexity
+function useColors() {
+ // NB: In an Electron preload script, document will be defined but not fully
+ // initialized. Since we know we're in Chrome, we'll just detect this case
+ // explicitly
+ if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
+ return true;
+ }
+
+ // Internet Explorer and Edge do not support colors.
+ if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
+ return false;
+ }
+
+ // Is webkit? http://stackoverflow.com/a/16459606/376773
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+ return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+ // Is firebug? http://stackoverflow.com/a/398120/376773
+ (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+ // Is firefox >= v31?
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
+ // Double check webkit in userAgent just in case we are in a worker
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+}
+
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+ args[0] = (this.useColors ? '%c' : '') +
+ this.namespace +
+ (this.useColors ? ' %c' : ' ') +
+ args[0] +
+ (this.useColors ? '%c ' : ' ') +
+ '+' + module.exports.humanize(this.diff);
+
+ if (!this.useColors) {
+ return;
+ }
+
+ const c = 'color: ' + this.color;
+ args.splice(1, 0, c, 'color: inherit');
+
+ // The final "%c" is somewhat tricky, because there could be other
+ // arguments passed either before or after the %c, so we need to
+ // figure out the correct index to insert the CSS into
+ let index = 0;
+ let lastC = 0;
+ args[0].replace(/%[a-zA-Z%]/g, match => {
+ if (match === '%%') {
+ return;
+ }
+ index++;
+ if (match === '%c') {
+ // We only are interested in the *last* %c
+ // (the user may have provided their own)
+ lastC = index;
+ }
+ });
+
+ args.splice(lastC, 0, c);
+}
+
+/**
+ * Invokes `console.debug()` when available.
+ * No-op when `console.debug` is not a "function".
+ * If `console.debug` is not available, falls back
+ * to `console.log`.
+ *
+ * @api public
+ */
+exports.log = console.debug || console.log || (() => {});
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+function save(namespaces) {
+ try {
+ if (namespaces) {
+ exports.storage.setItem('debug', namespaces);
+ } else {
+ exports.storage.removeItem('debug');
+ }
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+function load() {
+ let r;
+ try {
+ r = exports.storage.getItem('debug');
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+
+ // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+ if (!r && typeof process !== 'undefined' && 'env' in process) {
+ r = process.env.DEBUG;
+ }
+
+ return r;
+}
+
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+function localstorage() {
+ try {
+ // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
+ // The Browser also has localStorage in the global context.
+ return localStorage;
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+}
+
+module.exports = require('./common')(exports);
+
+const {formatters} = module.exports;
+
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+formatters.j = function (v) {
+ try {
+ return JSON.stringify(v);
+ } catch (error) {
+ return '[UnexpectedJSONParseError]: ' + error.message;
+ }
+};
diff --git a/node_modules/log4js/node_modules/debug/src/common.js b/node_modules/log4js/node_modules/debug/src/common.js
new file mode 100644
index 0000000..e3291b2
--- /dev/null
+++ b/node_modules/log4js/node_modules/debug/src/common.js
@@ -0,0 +1,274 @@
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ */
+
+function setup(env) {
+ createDebug.debug = createDebug;
+ createDebug.default = createDebug;
+ createDebug.coerce = coerce;
+ createDebug.disable = disable;
+ createDebug.enable = enable;
+ createDebug.enabled = enabled;
+ createDebug.humanize = require('ms');
+ createDebug.destroy = destroy;
+
+ Object.keys(env).forEach(key => {
+ createDebug[key] = env[key];
+ });
+
+ /**
+ * The currently active debug mode names, and names to skip.
+ */
+
+ createDebug.names = [];
+ createDebug.skips = [];
+
+ /**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+ createDebug.formatters = {};
+
+ /**
+ * Selects a color for a debug namespace
+ * @param {String} namespace The namespace string for the debug instance to be colored
+ * @return {Number|String} An ANSI color code for the given namespace
+ * @api private
+ */
+ function selectColor(namespace) {
+ let hash = 0;
+
+ for (let i = 0; i < namespace.length; i++) {
+ hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
+ hash |= 0; // Convert to 32bit integer
+ }
+
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
+ }
+ createDebug.selectColor = selectColor;
+
+ /**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+ function createDebug(namespace) {
+ let prevTime;
+ let enableOverride = null;
+ let namespacesCache;
+ let enabledCache;
+
+ function debug(...args) {
+ // Disabled?
+ if (!debug.enabled) {
+ return;
+ }
+
+ const self = debug;
+
+ // Set `diff` timestamp
+ const curr = Number(new Date());
+ const ms = curr - (prevTime || curr);
+ self.diff = ms;
+ self.prev = prevTime;
+ self.curr = curr;
+ prevTime = curr;
+
+ args[0] = createDebug.coerce(args[0]);
+
+ if (typeof args[0] !== 'string') {
+ // Anything else let's inspect with %O
+ args.unshift('%O');
+ }
+
+ // Apply any `formatters` transformations
+ let index = 0;
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
+ // If we encounter an escaped % then don't increase the array index
+ if (match === '%%') {
+ return '%';
+ }
+ index++;
+ const formatter = createDebug.formatters[format];
+ if (typeof formatter === 'function') {
+ const val = args[index];
+ match = formatter.call(self, val);
+
+ // Now we need to remove `args[index]` since it's inlined in the `format`
+ args.splice(index, 1);
+ index--;
+ }
+ return match;
+ });
+
+ // Apply env-specific formatting (colors, etc.)
+ createDebug.formatArgs.call(self, args);
+
+ const logFn = self.log || createDebug.log;
+ logFn.apply(self, args);
+ }
+
+ debug.namespace = namespace;
+ debug.useColors = createDebug.useColors();
+ debug.color = createDebug.selectColor(namespace);
+ debug.extend = extend;
+ debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
+
+ Object.defineProperty(debug, 'enabled', {
+ enumerable: true,
+ configurable: false,
+ get: () => {
+ if (enableOverride !== null) {
+ return enableOverride;
+ }
+ if (namespacesCache !== createDebug.namespaces) {
+ namespacesCache = createDebug.namespaces;
+ enabledCache = createDebug.enabled(namespace);
+ }
+
+ return enabledCache;
+ },
+ set: v => {
+ enableOverride = v;
+ }
+ });
+
+ // Env-specific initialization logic for debug instances
+ if (typeof createDebug.init === 'function') {
+ createDebug.init(debug);
+ }
+
+ return debug;
+ }
+
+ function extend(namespace, delimiter) {
+ const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
+ newDebug.log = this.log;
+ return newDebug;
+ }
+
+ /**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+ function enable(namespaces) {
+ createDebug.save(namespaces);
+ createDebug.namespaces = namespaces;
+
+ createDebug.names = [];
+ createDebug.skips = [];
+
+ let i;
+ const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+ const len = split.length;
+
+ for (i = 0; i < len; i++) {
+ if (!split[i]) {
+ // ignore empty strings
+ continue;
+ }
+
+ namespaces = split[i].replace(/\*/g, '.*?');
+
+ if (namespaces[0] === '-') {
+ createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
+ } else {
+ createDebug.names.push(new RegExp('^' + namespaces + '$'));
+ }
+ }
+ }
+
+ /**
+ * Disable debug output.
+ *
+ * @return {String} namespaces
+ * @api public
+ */
+ function disable() {
+ const namespaces = [
+ ...createDebug.names.map(toNamespace),
+ ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
+ ].join(',');
+ createDebug.enable('');
+ return namespaces;
+ }
+
+ /**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+ function enabled(name) {
+ if (name[name.length - 1] === '*') {
+ return true;
+ }
+
+ let i;
+ let len;
+
+ for (i = 0, len = createDebug.skips.length; i < len; i++) {
+ if (createDebug.skips[i].test(name)) {
+ return false;
+ }
+ }
+
+ for (i = 0, len = createDebug.names.length; i < len; i++) {
+ if (createDebug.names[i].test(name)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Convert regexp to namespace
+ *
+ * @param {RegExp} regxep
+ * @return {String} namespace
+ * @api private
+ */
+ function toNamespace(regexp) {
+ return regexp.toString()
+ .substring(2, regexp.toString().length - 2)
+ .replace(/\.\*\?$/, '*');
+ }
+
+ /**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+ function coerce(val) {
+ if (val instanceof Error) {
+ return val.stack || val.message;
+ }
+ return val;
+ }
+
+ /**
+ * XXX DO NOT USE. This is a temporary stub function.
+ * XXX It WILL be removed in the next major release.
+ */
+ function destroy() {
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
+ }
+
+ createDebug.enable(createDebug.load());
+
+ return createDebug;
+}
+
+module.exports = setup;
diff --git a/node_modules/log4js/node_modules/debug/src/index.js b/node_modules/log4js/node_modules/debug/src/index.js
new file mode 100644
index 0000000..bf4c57f
--- /dev/null
+++ b/node_modules/log4js/node_modules/debug/src/index.js
@@ -0,0 +1,10 @@
+/**
+ * Detect Electron renderer / nwjs process, which is node, but we should
+ * treat as a browser.
+ */
+
+if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
+ module.exports = require('./browser.js');
+} else {
+ module.exports = require('./node.js');
+}
diff --git a/node_modules/log4js/node_modules/debug/src/node.js b/node_modules/log4js/node_modules/debug/src/node.js
new file mode 100644
index 0000000..79bc085
--- /dev/null
+++ b/node_modules/log4js/node_modules/debug/src/node.js
@@ -0,0 +1,263 @@
+/**
+ * Module dependencies.
+ */
+
+const tty = require('tty');
+const util = require('util');
+
+/**
+ * This is the Node.js implementation of `debug()`.
+ */
+
+exports.init = init;
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.destroy = util.deprecate(
+ () => {},
+ 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
+);
+
+/**
+ * Colors.
+ */
+
+exports.colors = [6, 2, 3, 4, 5, 1];
+
+try {
+ // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
+ // eslint-disable-next-line import/no-extraneous-dependencies
+ const supportsColor = require('supports-color');
+
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
+ exports.colors = [
+ 20,
+ 21,
+ 26,
+ 27,
+ 32,
+ 33,
+ 38,
+ 39,
+ 40,
+ 41,
+ 42,
+ 43,
+ 44,
+ 45,
+ 56,
+ 57,
+ 62,
+ 63,
+ 68,
+ 69,
+ 74,
+ 75,
+ 76,
+ 77,
+ 78,
+ 79,
+ 80,
+ 81,
+ 92,
+ 93,
+ 98,
+ 99,
+ 112,
+ 113,
+ 128,
+ 129,
+ 134,
+ 135,
+ 148,
+ 149,
+ 160,
+ 161,
+ 162,
+ 163,
+ 164,
+ 165,
+ 166,
+ 167,
+ 168,
+ 169,
+ 170,
+ 171,
+ 172,
+ 173,
+ 178,
+ 179,
+ 184,
+ 185,
+ 196,
+ 197,
+ 198,
+ 199,
+ 200,
+ 201,
+ 202,
+ 203,
+ 204,
+ 205,
+ 206,
+ 207,
+ 208,
+ 209,
+ 214,
+ 215,
+ 220,
+ 221
+ ];
+ }
+} catch (error) {
+ // Swallow - we only care if `supports-color` is available; it doesn't have to be.
+}
+
+/**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+exports.inspectOpts = Object.keys(process.env).filter(key => {
+ return /^debug_/i.test(key);
+}).reduce((obj, key) => {
+ // Camel-case
+ const prop = key
+ .substring(6)
+ .toLowerCase()
+ .replace(/_([a-z])/g, (_, k) => {
+ return k.toUpperCase();
+ });
+
+ // Coerce string value into JS value
+ let val = process.env[key];
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
+ val = true;
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
+ val = false;
+ } else if (val === 'null') {
+ val = null;
+ } else {
+ val = Number(val);
+ }
+
+ obj[prop] = val;
+ return obj;
+}, {});
+
+/**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
+
+function useColors() {
+ return 'colors' in exports.inspectOpts ?
+ Boolean(exports.inspectOpts.colors) :
+ tty.isatty(process.stderr.fd);
+}
+
+/**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+ const {namespace: name, useColors} = this;
+
+ if (useColors) {
+ const c = this.color;
+ const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
+ const prefix = ` ${colorCode};1m${name} \u001B[0m`;
+
+ args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+ args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
+ } else {
+ args[0] = getDate() + name + ' ' + args[0];
+ }
+}
+
+function getDate() {
+ if (exports.inspectOpts.hideDate) {
+ return '';
+ }
+ return new Date().toISOString() + ' ';
+}
+
+/**
+ * Invokes `util.format()` with the specified arguments and writes to stderr.
+ */
+
+function log(...args) {
+ return process.stderr.write(util.format(...args) + '\n');
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+function save(namespaces) {
+ if (namespaces) {
+ process.env.DEBUG = namespaces;
+ } else {
+ // If you set a process.env field to null or undefined, it gets cast to the
+ // string 'null' or 'undefined'. Just delete instead.
+ delete process.env.DEBUG;
+ }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+ return process.env.DEBUG;
+}
+
+/**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+function init(debug) {
+ debug.inspectOpts = {};
+
+ const keys = Object.keys(exports.inspectOpts);
+ for (let i = 0; i < keys.length; i++) {
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+ }
+}
+
+module.exports = require('./common')(exports);
+
+const {formatters} = module.exports;
+
+/**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
+
+formatters.o = function (v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts)
+ .split('\n')
+ .map(str => str.trim())
+ .join(' ');
+};
+
+/**
+ * Map %O to `util.inspect()`, allowing multiple lines if needed.
+ */
+
+formatters.O = function (v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts);
+};
diff --git a/node_modules/log4js/package.json b/node_modules/log4js/package.json
index 0307a78..b38ee35 100644
--- a/node_modules/log4js/package.json
+++ b/node_modules/log4js/package.json
@@ -1,11 +1,13 @@
{
"name": "log4js",
- "version": "6.3.0",
+ "version": "6.4.5",
"description": "Port of Log4js to work with node.",
"homepage": "https://log4js-node.github.io/log4js-node/",
"files": [
"lib",
- "types"
+ "types",
+ "CHANGELOG.md",
+ "SECURITY.md"
],
"keywords": [
"logging",
@@ -16,7 +18,10 @@
"license": "Apache-2.0",
"main": "./lib/log4js",
"types": "./types/log4js.d.ts",
- "author": "Gareth Jones <gareth.nomiddlename@gmail.com>",
+ "contributors": [
+ "Gareth Jones <gareth.nomiddlename@gmail.com>",
+ "Lam Wei Li <lam_wei_li@hotmail.com>"
+ ],
"repository": {
"type": "git",
"url": "https://github.com/log4js-node/log4js-node.git"
@@ -29,7 +34,7 @@
},
"scripts": {
"pretest": "eslint \"lib/**/*.js\" \"test/**/*.js\"",
- "test": "tap \"test/tap/**/*.js\" --cov",
+ "test": "tap \"test/tap/**/*.js\" --cov --timeout=45",
"typings": "tsc -p types/tsconfig.json",
"codecov": "tap \"test/tap/**/*.js\" --cov --coverage-report=lcov && codecov"
},
@@ -38,30 +43,30 @@
"lib": "lib"
},
"dependencies": {
- "date-format": "^3.0.0",
- "debug": "^4.1.1",
- "flatted": "^2.0.1",
- "rfdc": "^1.1.4",
- "streamroller": "^2.2.4"
+ "date-format": "^4.0.7",
+ "debug": "^4.3.4",
+ "flatted": "^3.2.5",
+ "rfdc": "^1.3.0",
+ "streamroller": "^3.0.7"
},
"devDependencies": {
"@log4js-node/sandboxed-module": "^2.2.1",
"callsites": "^3.1.0",
- "codecov": "^3.6.1",
+ "codecov": "^3.8.3",
"deep-freeze": "0.0.1",
- "eslint": "^5.16.0",
- "eslint-config-airbnb-base": "^13.2.0",
- "eslint-config-prettier": "^6.5.0",
- "eslint-import-resolver-node": "^0.3.2",
- "eslint-plugin-import": "^2.18.2",
- "eslint-plugin-prettier": "^3.1.1",
- "fs-extra": "^8.1.0",
- "husky": "^3.0.9",
- "nyc": "^14.1.1",
- "prettier": "^1.18.2",
+ "eslint": "^8.13.0",
+ "eslint-config-airbnb-base": "^15.0.0",
+ "eslint-config-prettier": "^8.5.0",
+ "eslint-import-resolver-node": "^0.3.6",
+ "eslint-plugin-import": "^2.26.0",
+ "eslint-plugin-prettier": "^4.0.0",
+ "fs-extra": "^10.0.1",
+ "husky": "^7.0.4",
+ "nyc": "^15.1.0",
+ "prettier": "^2.6.0",
"proxyquire": "^2.1.3",
- "tap": "^14.10.7",
- "typescript": "^3.7.2",
+ "tap": "^16.0.1",
+ "typescript": "^4.6.3",
"validate-commit-msg": "^2.14.0"
},
"browser": {
@@ -88,6 +93,9 @@
"helpMessage": "\n# allowed type: feat, fix, docs, style, refactor, example, perf, test, chore, revert\n# subject no more than 50 chars\n# a body line no more than 72 chars"
}
},
+ "tap": {
+ "check-coverage": false
+ },
"nyc": {
"all": true,
"include": [
diff --git a/node_modules/log4js/types/log4js.d.ts b/node_modules/log4js/types/log4js.d.ts
index 2fdc99c..8915258 100644
--- a/node_modules/log4js/types/log4js.d.ts
+++ b/node_modules/log4js/types/log4js.d.ts
@@ -21,6 +21,8 @@
export function connectLogger(logger: Logger, options: { format?: Format; level?: string; nolog?: any; statusRules?: any[], context?: boolean }): any; // express.Handler;
+export function recording(): Recording;
+
export const levels: Levels;
export function shutdown(cb?: (error: Error) => void): void | null;
@@ -64,6 +66,11 @@
workerId: number;
worker: number;
};
+ functionName?: string;
+ fileName?: string;
+ lineNumber?: number;
+ columnNumber?: number;
+ callStack?: string;
}
export type Token = ((logEvent: LoggingEvent) => string) | string;
@@ -132,7 +139,6 @@
backups?: number;
// defaults to basic layout
layout?: Layout;
- numBackups?: number;
compress?: boolean; // compress the backups
// keep the file extension when rotating logs
keepFileExt?: boolean;
@@ -151,6 +157,9 @@
backups?: number;
// defaults to basic layout
layout?: Layout;
+ encoding?: string;
+ mode?: number;
+ flags?: string;
}
export interface DateFileAppender {
@@ -174,7 +183,7 @@
pattern?: string;
// default “utf-8”
encoding?: string;
- // default 0644
+ // default 0600
mode?: number;
// default ‘a’
flags?: string;
@@ -185,7 +194,7 @@
// keep the file extension when rotating logs
keepFileExt?: boolean;
// if this value is greater than zero, then files older than that many days will be deleted during log rolling.(default 0)
- daysToKeep?: number;
+ numBackups?: number;
}
export interface LogLevelFilterAppender {
@@ -236,15 +245,56 @@
layout?: Layout;
}
+/**
+ * TCP Appender
+ *
+ * @see https://log4js-node.github.io/log4js-node/tcp.html
+ */
+export interface TCPAppender {
+ type: 'tcp';
+ // defaults to 5000
+ port?: number
+ // defaults to localhost
+ host?: string
+ // default to __LOG4JS__
+ endMsg?: string
+ // defaults to a serialized log event
+ layout?: Layout;
+}
+
export interface CustomAppender {
type: string | AppenderModule;
[key: string]: any;
}
export interface AppenderModule {
- configure: Function
+ configure: (config: Config, layouts: LayoutsParam) => AppenderFunction;
}
+export type AppenderFunction = (loggingEvent: LoggingEvent) => void;
+
+// TODO: Actually add types here...
+// It's supposed to be the full config element
+export type Config = any
+
+export interface LayoutsParam {
+ basicLayout: LayoutFunction;
+ messagePassThroughLayout: LayoutFunction;
+ patternLayout: LayoutFunction;
+ colouredLayout: LayoutFunction;
+ coloredLayout: LayoutFunction;
+ dummyLayout: LayoutFunction;
+ addLayout: (name: string, serializerGenerator: LayoutFunction) => void;
+ layout: (name: string, config: PatternToken) => LayoutFunction;
+}
+
+export interface PatternToken {
+ pattern: string; // TODO type this to enforce good pattern...
+ tokens: { [tokenName: string]: () => any };
+}
+
+export type LayoutFunction = (loggingEvent: LoggingEvent) => string;
+
export type Appender = CategoryFilterAppender
| ConsoleAppender
| FileAppender
@@ -257,6 +307,7 @@
| RecordingAppender
| StandardErrorAppender
| StandardOutputAppender
+ | TCPAppender
| CustomAppender;
export interface Levels {
@@ -270,7 +321,7 @@
FATAL: Level;
OFF: Level;
levels: Level[];
- getLevel(level: string): Level;
+ getLevel(level: Level | string, defaultLevel?: Level): Level;
addLevels(customLevels: object): void;
}
@@ -283,13 +334,21 @@
disableClustering?: boolean;
}
+export interface Recording {
+ configure(loggingEvent: LoggingEvent): void
+ replay(): LoggingEvent[]
+ playback(): LoggingEvent[]
+ reset(): void
+ erase(): void
+}
+
export class Logger {
- new(dispatch: Function, name: string): Logger;
+ constructor(name: string);
- readonly category: string;
- level: string;
+ readonly category: string;
+ level: Level | string;
- log(...args: any[]): void;
+ log(level: Level | string, ...args: any[]): void;
isLevelEnabled(level?: string): boolean;
@@ -300,7 +359,7 @@
isErrorEnabled(): boolean;
isFatalEnabled(): boolean;
- _log(level: string, data: any): void;
+ _log(level: Level, data: any): void;
addContext(key: string, value: any): void;
diff --git a/node_modules/log4js/types/test.ts b/node_modules/log4js/types/test.ts
index a78f832..b7bb8f3 100644
--- a/node_modules/log4js/types/test.ts
+++ b/node_modules/log4js/types/test.ts
@@ -133,6 +133,31 @@
//support for passing in an appender module
log4js.configure({
- appenders: { thing: { type: { configure: () => {} }}},
+ appenders: { thing: { type: { configure: () => () => {} }}},
categories: { default: { appenders: ['thing'], level: 'debug'}}
});
+
+log4js.configure({
+ appenders: { rec: { type: 'recording' } },
+ categories: { default: { appenders: ['rec'], 'level': 'debug' } }
+});
+const logger8 = log4js.getLogger();
+logger8.level = 'debug'
+logger8.debug('This will go to the recording!')
+logger8.debug('Another one')
+const recording = log4js.recording()
+const loggingEvents = recording.playback()
+if (loggingEvents.length !== 2) {
+ throw new Error(`Expected 2 recorded events, got ${loggingEvents.length}`)
+}
+if (loggingEvents[0].data[0] !== 'This will go to the recording!') {
+ throw new Error(`Expected message 'This will go to the recording!', got ${loggingEvents[0].data[0]}`)
+}
+if (loggingEvents[1].data[0] !== 'Another one') {
+ throw new Error(`Expected message 'Another one', got ${loggingEvents[1].data[0]}`)
+}
+recording.reset()
+const loggingEventsPostReset = recording.playback()
+if (loggingEventsPostReset.length !== 0) {
+ throw new Error(`Expected 0 recorded events after reset, got ${loggingEventsPostReset.length}`)
+}
diff --git a/node_modules/minimist/index.js b/node_modules/minimist/index.js
index d2afe5e..d9c3eb7 100644
--- a/node_modules/minimist/index.js
+++ b/node_modules/minimist/index.js
@@ -70,7 +70,7 @@
var o = obj;
for (var i = 0; i < keys.length-1; i++) {
var key = keys[i];
- if (key === '__proto__') return;
+ if (isConstructorOrProto(o, key)) return;
if (o[key] === undefined) o[key] = {};
if (o[key] === Object.prototype || o[key] === Number.prototype
|| o[key] === String.prototype) o[key] = {};
@@ -79,7 +79,7 @@
}
var key = keys[keys.length - 1];
- if (key === '__proto__') return;
+ if (isConstructorOrProto(o, key)) return;
if (o === Object.prototype || o === Number.prototype
|| o === String.prototype) o = {};
if (o === Array.prototype) o = [];
@@ -243,3 +243,7 @@
return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
}
+
+function isConstructorOrProto (obj, key) {
+ return key === 'constructor' && typeof obj[key] === 'function' || key === '__proto__';
+}
diff --git a/node_modules/minimist/package.json b/node_modules/minimist/package.json
index c091d41..c225853 100644
--- a/node_modules/minimist/package.json
+++ b/node_modules/minimist/package.json
@@ -1,6 +1,6 @@
{
"name": "minimist",
- "version": "1.2.5",
+ "version": "1.2.6",
"description": "parse argument options",
"main": "index.js",
"devDependencies": {
diff --git a/node_modules/minimist/readme.markdown b/node_modules/minimist/readme.markdown
index 5fd97ab..859d1ab 100644
--- a/node_modules/minimist/readme.markdown
+++ b/node_modules/minimist/readme.markdown
@@ -34,7 +34,10 @@
Previous versions had a prototype pollution bug that could cause privilege
escalation in some circumstances when handling untrusted user input.
-Please use version 1.2.3 or later: https://snyk.io/vuln/SNYK-JS-MINIMIST-559764
+Please use version 1.2.6 or later:
+
+* https://security.snyk.io/vuln/SNYK-JS-MINIMIST-2429795 (version <=1.2.5)
+* https://snyk.io/vuln/SNYK-JS-MINIMIST-559764 (version <=1.2.3)
# methods
diff --git a/node_modules/minimist/test/proto.js b/node_modules/minimist/test/proto.js
index 8649107..4ac62df 100644
--- a/node_modules/minimist/test/proto.js
+++ b/node_modules/minimist/test/proto.js
@@ -42,3 +42,19 @@
t.equal(argv.y, undefined);
t.end();
});
+
+test('proto pollution (constructor function)', function (t) {
+ var argv = parse(['--_.concat.constructor.prototype.y', '123']);
+ function fnToBeTested() {}
+ t.equal(fnToBeTested.y, undefined);
+ t.equal(argv.y, undefined);
+ t.end();
+});
+
+// powered by snyk - https://github.com/backstage/backstage/issues/10343
+test('proto pollution (constructor function) snyk', function (t) {
+ var argv = parse('--_.constructor.constructor.prototype.foo bar'.split(' '));
+ t.equal((function(){}).foo, undefined);
+ t.equal(argv.y, undefined);
+ t.end();
+})
diff --git a/node_modules/nth-check/lib/index.js b/node_modules/nth-check/lib/index.js
index fcab3e2..afa219d 100644
--- a/node_modules/nth-check/lib/index.js
+++ b/node_modules/nth-check/lib/index.js
@@ -29,6 +29,6 @@
* check(6); // `true`
*/
function nthCheck(formula) {
- return compile_1.compile(parse_1.parse(formula));
+ return (0, compile_1.compile)((0, parse_1.parse)(formula));
}
exports.default = nthCheck;
diff --git a/node_modules/nth-check/lib/parse.d.ts.map b/node_modules/nth-check/lib/parse.d.ts.map
index 3ddc186..b697621 100644
--- a/node_modules/nth-check/lib/parse.d.ts.map
+++ b/node_modules/nth-check/lib/parse.d.ts.map
@@ -1 +1 @@
-{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CA6B7D"}
\ No newline at end of file
+{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../src/parse.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CA6E7D"}
\ No newline at end of file
diff --git a/node_modules/nth-check/lib/parse.js b/node_modules/nth-check/lib/parse.js
index f98d920..eaea29b 100644
--- a/node_modules/nth-check/lib/parse.js
+++ b/node_modules/nth-check/lib/parse.js
@@ -2,8 +2,10 @@
// Following http://www.w3.org/TR/css3-selectors/#nth-child-pseudo
Object.defineProperty(exports, "__esModule", { value: true });
exports.parse = void 0;
-// [ ['-'|'+']? INTEGER? {N} [ S* ['-'|'+'] S* INTEGER ]?
-var RE_NTH_ELEMENT = /^([+-]?\d*n)?\s*(?:([+-]?)\s*(\d+))?$/;
+// Whitespace as per https://www.w3.org/TR/selectors-3/#lex is " \t\r\n\f"
+var whitespace = new Set([9, 10, 12, 13, 32]);
+var ZERO = "0".charCodeAt(0);
+var NINE = "9".charCodeAt(0);
/**
* Parses an expression.
*
@@ -19,21 +21,56 @@
else if (formula === "odd") {
return [2, 1];
}
- var parsed = formula.match(RE_NTH_ELEMENT);
- if (!parsed) {
- throw new Error("n-th rule couldn't be parsed ('" + formula + "')");
- }
- var a;
- if (parsed[1]) {
- a = parseInt(parsed[1], 10);
- if (isNaN(a)) {
- a = parsed[1].startsWith("-") ? -1 : 1;
+ // Parse [ ['-'|'+']? INTEGER? {N} [ S* ['-'|'+'] S* INTEGER ]?
+ var idx = 0;
+ var a = 0;
+ var sign = readSign();
+ var number = readNumber();
+ if (idx < formula.length && formula.charAt(idx) === "n") {
+ idx++;
+ a = sign * (number !== null && number !== void 0 ? number : 1);
+ skipWhitespace();
+ if (idx < formula.length) {
+ sign = readSign();
+ skipWhitespace();
+ number = readNumber();
+ }
+ else {
+ sign = number = 0;
}
}
- else
- a = 0;
- var b = (parsed[2] === "-" ? -1 : 1) *
- (parsed[3] ? parseInt(parsed[3], 10) : 0);
- return [a, b];
+ // Throw if there is anything else
+ if (number === null || idx < formula.length) {
+ throw new Error("n-th rule couldn't be parsed ('" + formula + "')");
+ }
+ return [a, sign * number];
+ function readSign() {
+ if (formula.charAt(idx) === "-") {
+ idx++;
+ return -1;
+ }
+ if (formula.charAt(idx) === "+") {
+ idx++;
+ }
+ return 1;
+ }
+ function readNumber() {
+ var start = idx;
+ var value = 0;
+ while (idx < formula.length &&
+ formula.charCodeAt(idx) >= ZERO &&
+ formula.charCodeAt(idx) <= NINE) {
+ value = value * 10 + (formula.charCodeAt(idx) - ZERO);
+ idx++;
+ }
+ // Return `null` if we didn't read anything.
+ return idx === start ? null : value;
+ }
+ function skipWhitespace() {
+ while (idx < formula.length &&
+ whitespace.has(formula.charCodeAt(idx))) {
+ idx++;
+ }
+ }
}
exports.parse = parse;
diff --git a/node_modules/nth-check/package.json b/node_modules/nth-check/package.json
index 5396700..b2099a1 100644
--- a/node_modules/nth-check/package.json
+++ b/node_modules/nth-check/package.json
@@ -1,6 +1,6 @@
{
"name": "nth-check",
- "version": "2.0.0",
+ "version": "2.0.1",
"description": "Parses and compiles CSS nth-checks to highly optimized functions.",
"author": "Felix Boehm <me@feedic.com>",
"license": "BSD-2-Clause",
@@ -17,8 +17,8 @@
"lib/**/*"
],
"scripts": {
- "test": "jest --coverage && npm run lint",
- "coverage": "cat coverage/lcov.info | coveralls",
+ "test": "npm run test:jest && npm run lint",
+ "test:jest": "jest",
"lint": "npm run lint:es && npm run lint:prettier",
"lint:es": "eslint .",
"lint:prettier": "npm run prettier -- --check",
@@ -46,16 +46,16 @@
"boolbase": "^1.0.0"
},
"devDependencies": {
- "@types/jest": "^26.0.0",
- "@types/node": "^14.0.5",
- "@typescript-eslint/eslint-plugin": "^4.1.0",
- "@typescript-eslint/parser": "^4.1.0",
- "eslint": "^7.0.0",
- "eslint-config-prettier": "^6.0.0",
- "jest": "^26.0.1",
- "prettier": "^2.1.1",
- "ts-jest": "^26.0.0",
- "typescript": "^4.0.2"
+ "@types/jest": "^27.0.1",
+ "@types/node": "^16.9.1",
+ "@typescript-eslint/eslint-plugin": "^4.31.1",
+ "@typescript-eslint/parser": "^4.31.1",
+ "eslint": "^7.32.0",
+ "eslint-config-prettier": "^8.3.0",
+ "jest": "^27.2.0",
+ "prettier": "^2.4.1",
+ "ts-jest": "^27.0.5",
+ "typescript": "^4.4.3"
},
"jest": {
"preset": "ts-jest",
diff --git a/node_modules/path-parse/.travis.yml b/node_modules/path-parse/.travis.yml
deleted file mode 100644
index dae31da..0000000
--- a/node_modules/path-parse/.travis.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-language: node_js
-node_js:
- - "0.12"
- - "0.11"
- - "0.10"
- - "0.10.12"
- - "0.8"
- - "0.6"
- - "iojs"
diff --git a/node_modules/path-parse/index.js b/node_modules/path-parse/index.js
index 3b7601f..f062d0a 100644
--- a/node_modules/path-parse/index.js
+++ b/node_modules/path-parse/index.js
@@ -2,29 +2,14 @@
var isWindows = process.platform === 'win32';
-// Regex to split a windows path into three parts: [*, device, slash,
-// tail] windows-only
-var splitDeviceRe =
- /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
-
-// Regex to split the tail part of the above into [*, dir, basename, ext]
-var splitTailRe =
- /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/;
+// Regex to split a windows path into into [dir, root, basename, name, ext]
+var splitWindowsRe =
+ /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/;
var win32 = {};
-// Function to split a filename into [root, dir, basename, ext]
function win32SplitPath(filename) {
- // Separate device+slash from tail
- var result = splitDeviceRe.exec(filename),
- device = (result[1] || '') + (result[2] || ''),
- tail = result[3] || '';
- // Split the tail into dir, basename and extension
- var result2 = splitTailRe.exec(tail),
- dir = result2[1],
- basename = result2[2],
- ext = result2[3];
- return [device, dir, basename, ext];
+ return splitWindowsRe.exec(filename).slice(1);
}
win32.parse = function(pathString) {
@@ -34,24 +19,24 @@
);
}
var allParts = win32SplitPath(pathString);
- if (!allParts || allParts.length !== 4) {
+ if (!allParts || allParts.length !== 5) {
throw new TypeError("Invalid path '" + pathString + "'");
}
return {
- root: allParts[0],
- dir: allParts[0] + allParts[1].slice(0, -1),
+ root: allParts[1],
+ dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),
base: allParts[2],
- ext: allParts[3],
- name: allParts[2].slice(0, allParts[2].length - allParts[3].length)
+ ext: allParts[4],
+ name: allParts[3]
};
};
-// Split a filename into [root, dir, basename, ext], unix version
+// Split a filename into [dir, root, basename, name, ext], unix version
// 'root' is just a slash, or nothing.
var splitPathRe =
- /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
+ /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/;
var posix = {};
@@ -67,19 +52,16 @@
);
}
var allParts = posixSplitPath(pathString);
- if (!allParts || allParts.length !== 4) {
+ if (!allParts || allParts.length !== 5) {
throw new TypeError("Invalid path '" + pathString + "'");
}
- allParts[1] = allParts[1] || '';
- allParts[2] = allParts[2] || '';
- allParts[3] = allParts[3] || '';
-
+
return {
- root: allParts[0],
- dir: allParts[0] + allParts[1].slice(0, -1),
+ root: allParts[1],
+ dir: allParts[0].slice(0, -1),
base: allParts[2],
- ext: allParts[3],
- name: allParts[2].slice(0, allParts[2].length - allParts[3].length)
+ ext: allParts[4],
+ name: allParts[3],
};
};
diff --git a/node_modules/path-parse/package.json b/node_modules/path-parse/package.json
index 21332bb..36c23f8 100644
--- a/node_modules/path-parse/package.json
+++ b/node_modules/path-parse/package.json
@@ -1,6 +1,6 @@
{
"name": "path-parse",
- "version": "1.0.6",
+ "version": "1.0.7",
"description": "Node.js path.parse() ponyfill",
"main": "index.js",
"scripts": {
diff --git a/node_modules/path-parse/test.js b/node_modules/path-parse/test.js
deleted file mode 100644
index 0b30c12..0000000
--- a/node_modules/path-parse/test.js
+++ /dev/null
@@ -1,77 +0,0 @@
-var assert = require('assert');
-var pathParse = require('./index');
-
-var winParseTests = [
- [{ root: 'C:\\', dir: 'C:\\path\\dir', base: 'index.html', ext: '.html', name: 'index' }, 'C:\\path\\dir\\index.html'],
- [{ root: 'C:\\', dir: 'C:\\another_path\\DIR\\1\\2\\33', base: 'index', ext: '', name: 'index' }, 'C:\\another_path\\DIR\\1\\2\\33\\index'],
- [{ root: '', dir: 'another_path\\DIR with spaces\\1\\2\\33', base: 'index', ext: '', name: 'index' }, 'another_path\\DIR with spaces\\1\\2\\33\\index'],
- [{ root: '\\', dir: '\\foo', base: 'C:', ext: '', name: 'C:' }, '\\foo\\C:'],
- [{ root: '', dir: '', base: 'file', ext: '', name: 'file' }, 'file'],
- [{ root: '', dir: '.', base: 'file', ext: '', name: 'file' }, '.\\file'],
-
- // unc
- [{ root: '\\\\server\\share\\', dir: '\\\\server\\share\\', base: 'file_path', ext: '', name: 'file_path' }, '\\\\server\\share\\file_path'],
- [{ root: '\\\\server two\\shared folder\\', dir: '\\\\server two\\shared folder\\', base: 'file path.zip', ext: '.zip', name: 'file path' }, '\\\\server two\\shared folder\\file path.zip'],
- [{ root: '\\\\teela\\admin$\\', dir: '\\\\teela\\admin$\\', base: 'system32', ext: '', name: 'system32' }, '\\\\teela\\admin$\\system32'],
- [{ root: '\\\\?\\UNC\\', dir: '\\\\?\\UNC\\server', base: 'share', ext: '', name: 'share' }, '\\\\?\\UNC\\server\\share']
-];
-
-var winSpecialCaseFormatTests = [
- [{dir: 'some\\dir'}, 'some\\dir\\'],
- [{base: 'index.html'}, 'index.html'],
- [{}, '']
-];
-
-var unixParseTests = [
- [{ root: '/', dir: '/home/user/dir', base: 'file.txt', ext: '.txt', name: 'file' }, '/home/user/dir/file.txt'],
- [{ root: '/', dir: '/home/user/a dir', base: 'another File.zip', ext: '.zip', name: 'another File' }, '/home/user/a dir/another File.zip'],
- [{ root: '/', dir: '/home/user/a dir/', base: 'another&File.', ext: '.', name: 'another&File' }, '/home/user/a dir//another&File.'],
- [{ root: '/', dir: '/home/user/a$$$dir/', base: 'another File.zip', ext: '.zip', name: 'another File' }, '/home/user/a$$$dir//another File.zip'],
- [{ root: '', dir: 'user/dir', base: 'another File.zip', ext: '.zip', name: 'another File' }, 'user/dir/another File.zip'],
- [{ root: '', dir: '', base: 'file', ext: '', name: 'file' }, 'file'],
- [{ root: '', dir: '', base: '.\\file', ext: '', name: '.\\file' }, '.\\file'],
- [{ root: '', dir: '.', base: 'file', ext: '', name: 'file' }, './file'],
- [{ root: '', dir: '', base: 'C:\\foo', ext: '', name: 'C:\\foo' }, 'C:\\foo']
-];
-
-var unixSpecialCaseFormatTests = [
- [{dir: 'some/dir'}, 'some/dir/'],
- [{base: 'index.html'}, 'index.html'],
- [{}, '']
-];
-
-var errors = [
- {input: null, message: /Parameter 'pathString' must be a string, not/},
- {input: {}, message: /Parameter 'pathString' must be a string, not object/},
- {input: true, message: /Parameter 'pathString' must be a string, not boolean/},
- {input: 1, message: /Parameter 'pathString' must be a string, not number/},
- {input: undefined, message: /Parameter 'pathString' must be a string, not undefined/},
-];
-
-checkParseFormat(pathParse.win32, winParseTests);
-checkParseFormat(pathParse.posix, unixParseTests);
-checkErrors(pathParse.win32);
-checkErrors(pathParse.posix);
-
-function checkErrors(parse) {
- errors.forEach(function(errorCase) {
- try {
- parse(errorCase.input);
- } catch(err) {
- assert.ok(err instanceof TypeError);
- assert.ok(
- errorCase.message.test(err.message),
- 'expected ' + errorCase.message + ' to match ' + err.message
- );
- return;
- }
-
- assert.fail('should have thrown');
- });
-}
-
-function checkParseFormat(parse, testCases) {
- testCases.forEach(function(testCase) {
- assert.deepEqual(parse(testCase[1]), testCase[0]);
- });
-}
diff --git a/node_modules/rfdc/index.js b/node_modules/rfdc/index.js
index 98b42f6..3b438a4 100644
--- a/node_modules/rfdc/index.js
+++ b/node_modules/rfdc/index.js
@@ -38,6 +38,8 @@
if (typeof o !== 'object' || o === null) return o
if (o instanceof Date) return new Date(o)
if (Array.isArray(o)) return cloneArray(o, clone)
+ if (o instanceof Map) return new Map(cloneArray(Array.from(o), clone))
+ if (o instanceof Set) return new Set(cloneArray(Array.from(o), clone))
var o2 = {}
for (var k in o) {
if (Object.hasOwnProperty.call(o, k) === false) continue
@@ -46,6 +48,10 @@
o2[k] = cur
} else if (cur instanceof Date) {
o2[k] = new Date(cur)
+ } else if (cur instanceof Map) {
+ o2[k] = new Map(cloneArray(Array.from(cur), clone))
+ } else if (cur instanceof Set) {
+ o2[k] = new Set(cloneArray(Array.from(cur), clone))
} else if (ArrayBuffer.isView(cur)) {
o2[k] = copyBuffer(cur)
} else {
@@ -59,6 +65,8 @@
if (typeof o !== 'object' || o === null) return o
if (o instanceof Date) return new Date(o)
if (Array.isArray(o)) return cloneArray(o, cloneProto)
+ if (o instanceof Map) return new Map(cloneArray(Array.from(o), cloneProto))
+ if (o instanceof Set) return new Set(cloneArray(Array.from(o), cloneProto))
var o2 = {}
for (var k in o) {
var cur = o[k]
@@ -66,6 +74,10 @@
o2[k] = cur
} else if (cur instanceof Date) {
o2[k] = new Date(cur)
+ } else if (cur instanceof Map) {
+ o2[k] = new Map(cloneArray(Array.from(cur), cloneProto))
+ } else if (cur instanceof Set) {
+ o2[k] = new Set(cloneArray(Array.from(cur), cloneProto))
} else if (ArrayBuffer.isView(cur)) {
o2[k] = copyBuffer(cur)
} else {
@@ -110,6 +122,8 @@
if (typeof o !== 'object' || o === null) return o
if (o instanceof Date) return new Date(o)
if (Array.isArray(o)) return cloneArray(o, clone)
+ if (o instanceof Map) return new Map(cloneArray(Array.from(o), clone))
+ if (o instanceof Set) return new Set(cloneArray(Array.from(o), clone))
var o2 = {}
refs.push(o)
refsNew.push(o2)
@@ -120,6 +134,10 @@
o2[k] = cur
} else if (cur instanceof Date) {
o2[k] = new Date(cur)
+ } else if (cur instanceof Map) {
+ o2[k] = new Map(cloneArray(Array.from(cur), clone))
+ } else if (cur instanceof Set) {
+ o2[k] = new Set(cloneArray(Array.from(cur), clone))
} else if (ArrayBuffer.isView(cur)) {
o2[k] = copyBuffer(cur)
} else {
@@ -140,6 +158,8 @@
if (typeof o !== 'object' || o === null) return o
if (o instanceof Date) return new Date(o)
if (Array.isArray(o)) return cloneArray(o, cloneProto)
+ if (o instanceof Map) return new Map(cloneArray(Array.from(o), cloneProto))
+ if (o instanceof Set) return new Set(cloneArray(Array.from(o), cloneProto))
var o2 = {}
refs.push(o)
refsNew.push(o2)
@@ -149,6 +169,10 @@
o2[k] = cur
} else if (cur instanceof Date) {
o2[k] = new Date(cur)
+ } else if (cur instanceof Map) {
+ o2[k] = new Map(cloneArray(Array.from(cur), cloneProto))
+ } else if (cur instanceof Set) {
+ o2[k] = new Set(cloneArray(Array.from(cur), cloneProto))
} else if (ArrayBuffer.isView(cur)) {
o2[k] = copyBuffer(cur)
} else {
diff --git a/node_modules/rfdc/package.json b/node_modules/rfdc/package.json
index e7a3e50..ecaefae 100644
--- a/node_modules/rfdc/package.json
+++ b/node_modules/rfdc/package.json
@@ -1,6 +1,6 @@
{
"name": "rfdc",
- "version": "1.2.0",
+ "version": "1.3.0",
"description": "Really Fast Deep Clone",
"main": "index.js",
"exports": {
diff --git a/node_modules/rfdc/readme.md b/node_modules/rfdc/readme.md
index 7cffe62..6110c1c 100644
--- a/node_modules/rfdc/readme.md
+++ b/node_modules/rfdc/readme.md
@@ -73,6 +73,8 @@
* `undefined` (copied)
* `Buffer` (copied)
* `TypedArray` (copied)
+* `Map` (copied)
+* `Set` (copied)
* `Function` (referenced)
* `AsyncFunction` (referenced)
* `GeneratorFunction` (referenced)
diff --git a/node_modules/rfdc/test/index.js b/node_modules/rfdc/test/index.js
index 19b2663..458712f 100644
--- a/node_modules/rfdc/test/index.js
+++ b/node_modules/rfdc/test/index.js
@@ -265,4 +265,24 @@
deepEqual(Array.from(cloned.view2), [input2, input3], 'cloned value content is correct')
deepEqual(Array.from(cloned.view3), [input1, 0, input2, input3], 'cloned value content is correct')
})
+ test(`${label} - maps`, async ({ same, isNot }) => {
+ const map = new Map([['a', 1]])
+ same(Array.from(clone(map)), [['a', 1]], 'same value')
+ isNot(clone(map), map, 'different object')
+ })
+ test(`${label} - sets`, async ({ same, isNot }) => {
+ const set = new Set([1])
+ same(Array.from(clone(set)), [1])
+ isNot(clone(set), set, 'different object')
+ })
+ test(`${label} - nested maps`, async ({ same, isNot }) => {
+ const data = { m: new Map([['a', 1]]) }
+ same(Array.from(clone(data).m), [['a', 1]], 'same value')
+ isNot(clone(data).m, data.m, 'different object')
+ })
+ test(`${label} - nested sets`, async ({ same, isNot }) => {
+ const data = { s: new Set([1]) }
+ same(Array.from(clone(data).s), [1], 'same value')
+ isNot(clone(data).s, data.s, 'different object')
+ })
}
diff --git a/node_modules/streamroller/.travis.yml b/node_modules/streamroller/.travis.yml
deleted file mode 100644
index b4041fc..0000000
--- a/node_modules/streamroller/.travis.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-language: node_js
-sudo: false
-node_js:
- - "12"
- - "10"
- - "8"
diff --git a/node_modules/streamroller/CHANGELOG.md b/node_modules/streamroller/CHANGELOG.md
index 4211686..850ae49 100644
--- a/node_modules/streamroller/CHANGELOG.md
+++ b/node_modules/streamroller/CHANGELOG.md
@@ -1,4 +1,116 @@
-# Streamroller Changelog
+# streamroller Changelog
+
+## 3.0.7
+
+- [chore(dep): temporary fix for fs-extra issue (to be reverted when fs-extra patches it)](https://github.com/log4js-node/streamroller/pull/116) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(dep): updated dependencies](https://github.com/log4js-node/streamroller/pull/117) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(dep): bump date-format from 4.0.6 to 4.0.7
+ - chore(dep): updated package-lock.json
+- [chore(dep): updated dependencies](https://github.com/log4js-node/streamroller/pull/113) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(dev): bump @types/node from 17.0.23 to 17.0.24
+ - updated package-lock.json
+- [chore(dep): updated dependencies](https://github.com/log4js-node/streamroller/pull/112) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(dev): bump @types/node from 17.0.22 to 17.0.23
+ - chore(dev): bump eslint from 8.11.0 to 8.13.0
+ - updated package-lock.json
+
+## 3.0.6
+
+- [chore(dep): updated dependencies](https://github.com/log4js-node/streamroller/pull/110) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(dep): bump debug from 4.3.3 to 4.3.4
+ - chore(dep): bump date-format from 4.0.5 to 4.0.6
+ - chore(dev): bump @types/node from 17.0.21 to 17.0.22
+ - chore(dev): bump @commitlint/cli from 16.2.1 to 16.2.3
+ - package-lock.json
+
+## 3.0.5
+
+- [chore(validation): added filename validation](https://github.com/log4js-node/streamroller/pull/101) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(dep): updated dependencies](https://github.com/log4js-node/streamroller/pull/109) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(dev): eslint from 8.10.0 to 8.11.0
+ - chore(dev): mocha from 9.2.1 to 9.2.2
+ - chore(dep): date-format from 4.0.4 to 4.0.5
+ - package-lock.json
+- [chore(docs): updated README.md with badges](https://github.com/log4js-node/streamroller/pull/105) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(docs): updated README.md for DateRollingFileStream](https://github.com/log4js-node/streamroller/pull/106) - thanks [@peteriman](https://github.com/peteriman)
+- [chore(docs): added docs for istanbul ignore](https://github.com/log4js-node/streamroller/pull/107) - thanks [@peteriman](https://github.com/peteriman)
+
+## 3.0.4
+
+- [test: remove test file/folder remnants](https://github.com/log4js-node/streamroller/pull/99) - thanks [@peteriman](https://github.com/peteriman)
+
+## 3.0.3
+
+- [compat: backward compatibility for RollingFileWriteStream to recursively create directory](https://github.com/log4js-node/streamroller/pull/96) - thanks [@peteriman](https://github.com/peteriman)
+- [test: 100% test coverage](https://github.com/log4js-node/streamroller/pull/94) - thanks [@peteriman](https://github.com/peteriman)
+- [Updated dependencies](https://github.com/log4js-node/streamroller/pull/97) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(deps-dev): bump @commitlint/cli from 16.1.0 to 16.2.1
+ - chore(deps-dev): bump @commitlint/config-conventional from 16.0.0 to 16.2.1
+ - chore(deps-dev): bump @types/node from 17.0.16 to 17.0.21
+ - chore(deps-dev): bump eslint from 8.8.0 to 8.10.0
+ - chore(deps-dev): bump mocha from 9.2.0 to 9.2.1
+ - chore(deps): bump date-format from 4.0.3 to 4.0.4
+ - chore(deps): bump fs-extra from 10.0.0 to 10.0.1
+- [Updated dependencies](https://github.com/log4js-node/streamroller/pull/95) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(deps-dev): bump @commitlint/cli from 16.0.2 to 16.1.0
+ - chore(deps-dev): bump @types/node from 17.0.9 to 17.0.16
+ - chore(deps-dev): bump eslint from 8.7.0 to 8.8.0
+ - chore(deps-dev): bump proxyquire from 2.1.1 to 2.1.3
+ - chore(deps): bump debug from 4.1.1 to 4.3.3
+- [Updated dependencies](https://github.com/log4js-node/streamroller/pull/92) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(deps): updated package-lock.json
+- [Updated dependencies](https://github.com/log4js-node/streamroller/pull/91) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(deps-dev): bump mocha from 9.1.4 to 9.2.0
+
+## 3.0.2
+
+- [Changed default file modes from 0o644 to 0o600 for better security](https://github.com/log4js-node/streamroller/pull/87) - thanks [@peteriman](https://github.com/peteriman)
+- [Housekeeping for comments and .gitignore](https://github.com/log4js-node/streamroller/pull/89) - thanks [@peteriman](https://github.com/peteriman)
+- [Updated dependencies](https://github.com/log4js-node/streamroller/pull/88) - thanks [@peteriman](https://github.com/peteriman)
+ - chore(deps-dev): bump caniuse-lite from 1.0.30001299 to 1.0.30001300
+ - chore(deps-dev): bump electron-to-chromium from 1.4.45 to 1.4.47
+ - chore(deps-dev): bump @types/node from 17.0.8 to 17.0.9
+ - chore(deps-dev): bump eslint from 8.6.0 to 8.7.0
+ - chore(deps-dev): bump mocha from 9.1.3 to 9.1.4
+ - chore(deps): bump date-format from 4.0.2 to 4.0.3
+
+## 3.0.1
+
+- [Not to publish misc files to NPM](https://github.com/log4js-node/streamroller/pull/82) - thanks [@peteriman](https://github.com/peteriman)
+- Updated dependencies - thanks [@peteriman](https://github.com/peteriman)
+ - [date-format from 4.0.1 to 4.0.2](https://github.com/log4js-node/streamroller/pull/86)
+ - [electron-to-chromium from 1.4.44 to 1.4.45](https://github.com/log4js-node/streamroller/pull/81)
+
+## 3.0.0
+
+- [Fix for mode to apply to compressed file](https://github.com/log4js-node/streamroller/pull/65) - thanks [@rnd-debug](https://github.com/rnd-debug)
+- [Allow for 0 backups (only hot file)](https://github.com/log4js-node/streamroller/pull/74) - thanks [@peteriman](https://github.com/peteriman)
+- [Exposed fileNameSep to be configurable](https://github.com/log4js-node/streamroller/pull/67) - thanks [@laidaxian](https://github.com/laidaxian)
+ - [Fix for fileNameSep affecting globally](https://github.com/log4js-node/streamroller/pull/79) - thanks [@peteriman](https://github.com/peteriman)
+- [Fix for extra separator in filenames](https://github.com/log4js-node/streamroller/pull/75) - thanks [@peteriman](https://github.com/peteriman)
+- [Moved to options.numBackups instead of options.daysToKeep](https://github.com/log4js-node/streamroller/pull/78) - thanks [@peteriman](https://github.com/peteriman)
+- [Improved test case performance for fakeNow](https://github.com/log4js-node/streamroller/pull/76) - thanks [@peteriman](https://github.com/peteriman)
+- Updated dependencies - thanks <a href="https://github.com/peteriman">@peteriman</a></summary>
+ - [package.json](https://github.com/log4js-node/streamroller/pull/70)
+ - @commitlint/cli from 8.1.0 to 16.0.2
+ - @commitlint/config-conventional from 8.1.0 to 16.0.0
+ - @type/nodes 17.0.8
+ - eslint from 6.0.1 to 8.6.0
+ - mocha from 6.1.4 to 9.1.3
+ - nyc from 14.1.1 to 15.1.0
+ - [package-lock.json](https://github.com/log4js-node/streamroller/pull/71)
+ - @babel/compat-data from 7.16.4 to 7.16.8
+ - @babel/generator from 7.16.7 to 7.16.8
+ - @babel/parser from 7.16.7 to 7.16.8
+ - @babel/travers from 7.16.7 to 7.16.8
+ - @babel/types from 7.16.7 to 7.16.8
+ - [package-lock.json](https://github.com/log4js-node/streamroller/pull/77)
+ - caniuse-lite from 1.0.30001298 to 1.0.30001299
+ - electron-to-chromium from 1.4.39 to 1.4.44
+ - [package.json](https://github.com/log4js-node/streamroller/pull/80)
+ - date-format from 3.0.0 to 4.0.1
+ - husky from 3.0.0 to 7.0.4
+ - fs-extra from 8.1.0 to 10.0.0
## 2.2.4
diff --git a/node_modules/streamroller/README.md b/node_modules/streamroller/README.md
index 5eb0265..b36aed5 100644
--- a/node_modules/streamroller/README.md
+++ b/node_modules/streamroller/README.md
@@ -1,29 +1,36 @@
-streamroller
+streamroller [](https://github.com/log4js-node/streamroller/actions/workflows/codeql-analysis.yml) [](https://github.com/log4js-node/streamroller/actions/workflows/node.js.yml)
============
+[](https://nodei.co/npm/streamroller/)
+
node.js file streams that roll over when they reach a maximum size, or a date/time.
- npm install streamroller
+```sh
+npm install streamroller
+```
## usage
- var rollers = require('streamroller');
- var stream = new rollers.RollingFileStream('myfile', 1024, 3);
- stream.write("stuff");
- stream.end();
+```javascript
+var rollers = require('streamroller');
+var stream = new rollers.RollingFileStream('myfile', 1024, 3);
+stream.write("stuff");
+stream.end();
+```
The streams behave the same as standard node.js streams, except that when certain conditions are met they will rename the current file to a backup and start writing to a new file.
### new RollingFileStream(filename [, maxSize, numBackups, options])
-* `filename` (String)
-* `maxSize` - the size in bytes to trigger a rollover, if not provided this defaults to MAX_SAFE_INTEGER and the stream will not roll.
-* `numBackups` - the number of old files to keep
-* `options` - Object
- * `encoding` - defaults to 'utf8'
- * `mode` - defaults to 0644
- * `flags` - defaults to 'a' (see [fs.open](https://nodejs.org/dist/latest-v8.x/docs/api/fs.html#fs_fs_open_path_flags_mode_callback) for more details)
- * `compress` - (boolean) defaults to `false` - compress the backup files using gzip (files will have `.gz` extension).
- * `keepFileExt` - (boolean) defaults to `false` - keep the file original extension. e.g.: `abc.log -> abc.1.log`.
+* `filename` \<string\>
+* `maxSize` \<integer\> - defaults to `MAX_SAFE_INTEGER` - the size in bytes to trigger a rollover
+* `numBackups` \<integer\> - defaults to `1` - the number of old files to keep (excluding the hot file)
+* `options` \<Object\>
+ * `encoding` \<string\> - defaults to `'utf8'`
+ * `mode` \<integer\> - defaults to `0o600` (see [node.js file modes](https://nodejs.org/dist/latest-v12.x/docs/api/fs.html#fs_file_modes))
+ * `flags` \<string\> - defaults to `'a'` (see [node.js file flags](https://nodejs.org/dist/latest-v12.x/docs/api/fs.html#fs_file_system_flags))
+ * `compress` \<boolean\> - defaults to `false` - compress the backup files using gzip (backup files will have `.gz` extension)
+ * `keepFileExt` \<boolean\> - defaults to `false` - preserve the file extension when rotating log files (`file.log` becomes `file.1.log` instead of `file.log.1`).
+ * `fileNameSep` \<string\> - defaults to `'.'` - the filename separator when rolling. e.g.: abc.log`.`1 or abc`.`1.log (keepFileExt)
This returns a `WritableStream`. When the current file being written to (given by `filename`) gets up to or larger than `maxSize`, then the current file will be renamed to `filename.1` and a new file will start being written to. Up to `numBackups` of old files are maintained, so if `numBackups` is 3 then there will be 4 files:
<pre>
@@ -41,17 +48,24 @@
filename is a new file
</pre>
-### new DateRollingFileStream(filename, pattern, options)
-* `filename` (String)
-* `pattern` (String) - the date pattern to trigger rolling (see below)
-* `options` - Object
- * `encoding` - defaults to 'utf8'
- * `mode` defaults to 0644
- * `flags` defaults to 'a' (see [fs.open](https://nodejs.org/dist/latest-v8.x/docs/api/fs.html#fs_fs_open_path_flags_mode_callback) for more details)
- * `compress` - (boolean) compress the backup files, defaults to false
- * `keepFileExt` - (boolean) defaults to `false` - keep the file original extension. e.g.: `abc.log -> abc.2013-08-30.log`.
- * `alwaysIncludePattern` - (boolean) extend the initial file with the pattern, defaults to false
- * `daysToKeep` - (integer) if this is greater than 0, then files older than `daysToKeep` days will be deleted during file rolling.
+### new DateRollingFileStream(filename [, pattern, options])
+* `filename` \<string\>
+* `pattern` \<string\> - defaults to `yyyy-MM-dd` - the date pattern to trigger rolling (see below)
+* `options` \<Object\>
+ * `encoding` \<string\> - defaults to `'utf8'`
+ * `mode` \<integer\> - defaults to `0o600` (see [node.js file modes](https://nodejs.org/dist/latest-v12.x/docs/api/fs.html#fs_file_modes))
+ * `flags` \<string\> - defaults to `'a'` (see [node.js file flags](https://nodejs.org/dist/latest-v12.x/docs/api/fs.html#fs_file_system_flags))
+ * `compress` \<boolean\> - defaults to `false` - compress the backup files using gzip (backup files will have `.gz` extension)
+ * `keepFileExt` \<boolean\> - defaults to `false` - preserve the file extension when rotating log files (`file.log` becomes `file.2017-05-30.log` instead of `file.log.2017-05-30`).
+ * `fileNameSep` \<string\> - defaults to `'.'` - the filename separator when rolling. e.g.: abc.log`.`2013-08-30 or abc`.`2013-08-30.log (keepFileExt)
+ * `alwaysIncludePattern` \<boolean\> - defaults to `false` - extend the initial file with the pattern
+ * <strike>`daysToKeep`</strike> `numBackups` \<integer\> - defaults to `1` - the number of old files that matches the pattern to keep (excluding the hot file)
+ * `maxSize` \<integer\> - defaults to `MAX_SAFE_INTEGER` - the size in bytes to trigger a rollover
-
-This returns a `WritableStream`. When the current time, formatted as `pattern`, changes then the current file will be renamed to `filename.formattedDate` where `formattedDate` is the result of processing the date through the pattern, and a new file will begin to be written. Streamroller uses [date-format](http://github.com/nomiddlename/date-format) to format dates, and the `pattern` should use the date-format format. e.g. with a `pattern` of `".yyyy-MM-dd"`, and assuming today is August 29, 2013 then writing to the stream today will just write to `filename`. At midnight (or more precisely, at the next file write after midnight), `filename` will be renamed to `filename.2013-08-29` and a new `filename` will be created. If `options.alwaysIncludePattern` is true, then the initial file will be `filename.2013-08-29` and no renaming will occur at midnight, but a new file will be written to with the name `filename.2013-08-30`.
+This returns a `WritableStream`. When the current time, formatted as `pattern`, changes then the current file will be renamed to `filename.formattedDate` where `formattedDate` is the result of processing the date through the pattern, and a new file will begin to be written. Streamroller uses [date-format](http://github.com/nomiddlename/date-format) to format dates, and the `pattern` should use the date-format format. e.g. with a `pattern` of `"yyyy-MM-dd"`, and assuming today is August 29, 2013 then writing to the stream today will just write to `filename`. At midnight (or more precisely, at the next file write after midnight), `filename` will be renamed to `filename.2013-08-29` and a new `filename` will be created. If `options.alwaysIncludePattern` is true, then the initial file will be `filename.2013-08-29` and no renaming will occur at midnight, but a new file will be written to with the name `filename.2013-08-30`. If `maxSize` is populated, when the current file being written to (given by `filename`) gets up to or larger than `maxSize`, then the current file will be renamed to `filename.pattern.1` and a new file will start being written to. Up to `numBackups` of old files are maintained, so if `numBackups` is 3 then there will be 4 files:
+<pre>
+ filename
+ filename.20220131.1
+ filename.20220131.2
+ filename.20220131.3
+</pre>
diff --git a/node_modules/streamroller/lib/DateRollingFileStream.js b/node_modules/streamroller/lib/DateRollingFileStream.js
index 9bf52f7..ea7209a 100644
--- a/node_modules/streamroller/lib/DateRollingFileStream.js
+++ b/node_modules/streamroller/lib/DateRollingFileStream.js
@@ -13,13 +13,21 @@
if (!pattern) {
pattern = 'yyyy-MM-dd';
}
- if (options.daysToKeep) {
- options.numToKeep = options.daysToKeep;
- }
- if (pattern.startsWith('.')) {
- pattern = pattern.substring(1);
- }
options.pattern = pattern;
+ if (!options.numBackups && options.numBackups !== 0) {
+ if (!options.daysToKeep && options.daysToKeep !== 0) {
+ options.daysToKeep = 1;
+ } else {
+ process.emitWarning(
+ "options.daysToKeep is deprecated due to the confusion it causes when used " +
+ "together with file size rolling. Please use options.numBackups instead.",
+ "DeprecationWarning", "streamroller-DEP0001"
+ );
+ }
+ options.numBackups = options.daysToKeep;
+ } else {
+ options.daysToKeep = options.numBackups;
+ }
super(filename, options);
this.mode = this.options.mode;
}
diff --git a/node_modules/streamroller/lib/RollingFileStream.js b/node_modules/streamroller/lib/RollingFileStream.js
index ec794c3..7e01c0c 100644
--- a/node_modules/streamroller/lib/RollingFileStream.js
+++ b/node_modules/streamroller/lib/RollingFileStream.js
@@ -9,12 +9,14 @@
if (size) {
options.maxSize = size;
}
- if (!backups) {
- backups = 1;
+ if (!options.numBackups && options.numBackups !== 0) {
+ if (!backups && backups !== 0) {
+ backups = 1;
+ }
+ options.numBackups = backups;
}
- options.numToKeep = backups;
super(filename, options);
- this.backups = this.options.numToKeep;
+ this.backups = options.numBackups;
this.size = this.options.maxSize;
}
diff --git a/node_modules/streamroller/lib/RollingFileWriteStream.js b/node_modules/streamroller/lib/RollingFileWriteStream.js
index 34e60e4..47b1232 100644
--- a/node_modules/streamroller/lib/RollingFileWriteStream.js
+++ b/node_modules/streamroller/lib/RollingFileWriteStream.js
@@ -1,5 +1,11 @@
const debug = require("debug")("streamroller:RollingFileWriteStream");
-const fs = require("fs-extra");
+
+const realFs = require('fs');
+const current = realFs.realpath.native;
+if (!realFs.realpath.native) realFs.realpath.native = realFs.realpath;
+const fs = require('fs-extra');
+realFs.realpath.native = current;
+
const path = require("path");
const newNow = require("./now");
const format = require("date-format");
@@ -21,7 +27,7 @@
* @param {number} options.numToKeep - The max numbers of files to keep.
* @param {number} options.maxSize - The maxSize one file can reach. Unit is Byte.
* This should be more than 1024. The default is Number.MAX_SAFE_INTEGER.
- * @param {string} options.mode - The mode of the files. The default is '0644'. Refer to stream.writable for more.
+ * @param {string} options.mode - The mode of the files. The default is '0600'. Refer to stream.writable for more.
* @param {string} options.flags - The default is 'a'. Refer to stream.flags for more.
* @param {boolean} options.compress - Whether to compress backup files.
* @param {boolean} options.keepFileExt - Whether to keep the file extension.
@@ -30,6 +36,9 @@
*/
constructor(filePath, options) {
debug(`constructor: creating RollingFileWriteStream. path=${filePath}`);
+ if (typeof filePath !== "string" || filePath.length === 0) {
+ throw new Error(`Invalid filename: ${filePath}`);
+ }
super(options);
this.options = this._parseOption(options);
this.fileObject = path.parse(filePath);
@@ -41,13 +50,15 @@
alwaysIncludeDate: this.options.alwaysIncludePattern,
needsIndex: this.options.maxSize < Number.MAX_SAFE_INTEGER,
compress: this.options.compress,
- keepFileExt: this.options.keepFileExt
+ keepFileExt: this.options.keepFileExt,
+ fileNameSep: this.options.fileNameSep
});
this.fileNameParser = fileNameParser({
file: this.fileObject,
keepFileExt: this.options.keepFileExt,
- pattern: this.options.pattern
+ pattern: this.options.pattern,
+ fileNameSep: this.options.fileNameSep
});
this.state = {
@@ -92,7 +103,7 @@
maxSize: Number.MAX_SAFE_INTEGER,
numToKeep: Number.MAX_SAFE_INTEGER,
encoding: "utf8",
- mode: parseInt("0644", 8),
+ mode: parseInt("0600", 8),
flags: "a",
compress: false,
keepFileExt: false,
@@ -102,7 +113,17 @@
if (options.maxSize <= 0) {
throw new Error(`options.maxSize (${options.maxSize}) should be > 0`);
}
- if (options.numToKeep <= 0) {
+ // options.numBackups will supercede options.numToKeep
+ if (options.numBackups || options.numBackups === 0) {
+ if (options.numBackups < 0) {
+ throw new Error(`options.numBackups (${options.numBackups}) should be >= 0`);
+ } else if (options.numBackups >= Number.MAX_SAFE_INTEGER) {
+ // to cater for numToKeep (include the hot file) at Number.MAX_SAFE_INTEGER
+ throw new Error(`options.numBackups (${options.numBackups}) should be < Number.MAX_SAFE_INTEGER`);
+ } else {
+ options.numToKeep = options.numBackups + 1;
+ }
+ } else if (options.numToKeep <= 0) {
throw new Error(`options.numToKeep (${options.numToKeep}) should be > 0`);
}
debug(
@@ -177,10 +198,14 @@
index: i + 1
});
+ const moveAndCompressOptions = {
+ compress: this.options.compress && i === 0,
+ mode: this.options.mode
+ }
await moveAndMaybeCompressFile(
sourceFilePath,
targetFilePath,
- this.options.compress && i === 0
+ moveAndCompressOptions
);
}
@@ -207,7 +232,7 @@
// Sorted from the oldest to the latest
async _getExistingFiles() {
- const files = await fs.readdir(this.fileObject.dir).catch(() => []);
+ const files = await fs.readdir(this.fileObject.dir).catch( /* istanbul ignore next: will not happen on windows */ () => []);
debug(`_getExistingFiles: files=${files}`);
const existingFileDetails = files
@@ -222,7 +247,38 @@
}
_renewWriteStream() {
- fs.ensureDirSync(this.fileObject.dir);
+ const mkdir = (dir) => {
+ try {
+ return fs.mkdirSync(dir, {recursive: true});
+ }
+ // backward-compatible fs.mkdirSync for nodejs pre-10.12.0 (without recursive option)
+ catch (e) {
+ // recursive creation of parent first
+ if (e.code === "ENOENT") {
+ mkdir(path.dirname(dir));
+ return mkdir(dir);
+ }
+
+ // throw error for all except EEXIST and EROFS (read-only filesystem)
+ if (e.code !== "EEXIST" && e.code !== "EROFS") {
+ throw e;
+ }
+
+ // EEXIST: throw if file and not directory
+ // EROFS : throw if directory not found
+ else {
+ try {
+ if (fs.statSync(dir).isDirectory()) {
+ return dir;
+ }
+ throw e;
+ } catch (err) {
+ throw e;
+ }
+ }
+ }
+ };
+ mkdir(this.fileObject.dir);
const filePath = this.fileFormatter({
date: this.state.currentDate,
index: 0
@@ -246,7 +302,7 @@
debug("_clean: existing files are: ", existingFileDetails);
if (this._tooManyFiles(existingFileDetails.length)) {
const fileNamesToRemove = existingFileDetails
- .slice(0, existingFileDetails.length - this.options.numToKeep - 1)
+ .slice(0, existingFileDetails.length - this.options.numToKeep)
.map(f => path.format({ dir: this.fileObject.dir, base: f.filename }));
await deleteFiles(fileNamesToRemove);
}
diff --git a/node_modules/streamroller/lib/fileNameFormatter.js b/node_modules/streamroller/lib/fileNameFormatter.js
index 81897cf..2e6de3d 100644
--- a/node_modules/streamroller/lib/fileNameFormatter.js
+++ b/node_modules/streamroller/lib/fileNameFormatter.js
@@ -1,15 +1,17 @@
const debug = require("debug")("streamroller:fileNameFormatter");
const path = require("path");
-const FILENAME_SEP = ".";
const ZIP_EXT = ".gz";
+const DEFAULT_FILENAME_SEP = ".";
module.exports = ({
file,
keepFileExt,
needsIndex,
alwaysIncludeDate,
- compress
+ compress,
+ fileNameSep
}) => {
+ let FILENAME_SEP = fileNameSep || DEFAULT_FILENAME_SEP;
const dirAndName = path.join(file.dir, file.name);
const ext = f => f + file.ext;
diff --git a/node_modules/streamroller/lib/fileNameParser.js b/node_modules/streamroller/lib/fileNameParser.js
index 8de9a3b..b9e1e38 100644
--- a/node_modules/streamroller/lib/fileNameParser.js
+++ b/node_modules/streamroller/lib/fileNameParser.js
@@ -1,9 +1,10 @@
const debug = require("debug")("streamroller:fileNameParser");
-const FILENAME_SEP = ".";
const ZIP_EXT = ".gz";
const format = require("date-format");
+const DEFAULT_FILENAME_SEP = ".";
-module.exports = ({ file, keepFileExt, pattern }) => {
+module.exports = ({ file, keepFileExt, pattern, fileNameSep }) => {
+ let FILENAME_SEP = fileNameSep || DEFAULT_FILENAME_SEP;
// All these functions take two arguments: f, the filename, and p, the result placeholder
// They return the filename with any matching parts removed.
// The "zip" function, for instance, removes the ".gz" part of the filename (if present)
diff --git a/node_modules/streamroller/lib/moveAndMaybeCompressFile.js b/node_modules/streamroller/lib/moveAndMaybeCompressFile.js
index b9b6068..497933b 100644
--- a/node_modules/streamroller/lib/moveAndMaybeCompressFile.js
+++ b/node_modules/streamroller/lib/moveAndMaybeCompressFile.js
@@ -1,12 +1,31 @@
const debug = require('debug')('streamroller:moveAndMaybeCompressFile');
-const fs = require('fs-extra');
+
+const realFs = require('fs');
+const current = realFs.realpath.native;
+if (!realFs.realpath.native) realFs.realpath.native = realFs.realpath;
+let fs = require('fs-extra');
+realFs.realpath.native = current;
+
const zlib = require('zlib');
+const _parseOption = function(rawOptions){
+ const defaultOptions = {
+ mode: parseInt("0600", 8),
+ compress: false,
+ };
+ const options = Object.assign({}, defaultOptions, rawOptions);
+ debug(
+ `_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(options)}`
+ );
+ return options;
+}
+
const moveAndMaybeCompressFile = async (
sourceFilePath,
targetFilePath,
- needCompress
+ options
) => {
+ options = _parseOption(options);
if (sourceFilePath === targetFilePath) {
debug(
`moveAndMaybeCompressFile: source and target are the same, not doing anything`
@@ -17,14 +36,14 @@
debug(
`moveAndMaybeCompressFile: moving file from ${sourceFilePath} to ${targetFilePath} ${
- needCompress ? "with" : "without"
+ options.compress ? "with" : "without"
} compress`
);
- if (needCompress) {
+ if (options.compress) {
await new Promise((resolve, reject) => {
fs.createReadStream(sourceFilePath)
.pipe(zlib.createGzip())
- .pipe(fs.createWriteStream(targetFilePath))
+ .pipe(fs.createWriteStream(targetFilePath, {mode: options.mode}))
.on("finish", () => {
debug(
`moveAndMaybeCompressFile: finished compressing ${targetFilePath}, deleting ${sourceFilePath}`
diff --git a/node_modules/streamroller/node_modules/date-format/.eslintrc b/node_modules/streamroller/node_modules/date-format/.eslintrc
deleted file mode 100644
index 54dbae8..0000000
--- a/node_modules/streamroller/node_modules/date-format/.eslintrc
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "extends": [
- "eslint:recommended"
- ],
- "env": {
- "node": true,
- "mocha": true
- },
- "plugins": [
- "mocha"
- ]
-}
diff --git a/node_modules/streamroller/node_modules/date-format/.travis.yml b/node_modules/streamroller/node_modules/date-format/.travis.yml
deleted file mode 100644
index 19b7cc8..0000000
--- a/node_modules/streamroller/node_modules/date-format/.travis.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-language: node_js
-sudo: false
-node_js:
- - "10"
- - "8"
- - "6"
diff --git a/node_modules/streamroller/node_modules/date-format/LICENSE b/node_modules/streamroller/node_modules/date-format/LICENSE
deleted file mode 100644
index f03266b..0000000
--- a/node_modules/streamroller/node_modules/date-format/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2013 Gareth Jones
-
-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.
diff --git a/node_modules/streamroller/node_modules/date-format/README.md b/node_modules/streamroller/node_modules/date-format/README.md
deleted file mode 100644
index cca25e0..0000000
--- a/node_modules/streamroller/node_modules/date-format/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-date-format
-===========
-
-node.js formatting of Date objects as strings. Probably exactly the same as some other library out there.
-
-```sh
-npm install date-format
-```
-
-usage
-=====
-
-Formatting dates as strings
-----
-
-```javascript
-var format = require('date-format');
-format.asString(); //defaults to ISO8601 format and current date.
-format.asString(new Date()); //defaults to ISO8601 format
-format.asString('hh:mm:ss.SSS', new Date()); //just the time
-```
-
-or
-
-```javascript
-var format = require('date-format');
-format(); //defaults to ISO8601 format and current date.
-format(new Date());
-format('hh:mm:ss.SSS', new Date());
-```
-
-Format string can be anything, but the following letters will be replaced (and leading zeroes added if necessary):
-* dd - `date.getDate()`
-* MM - `date.getMonth() + 1`
-* yy - `date.getFullYear().toString().substring(2, 4)`
-* yyyy - `date.getFullYear()`
-* hh - `date.getHours()`
-* mm - `date.getMinutes()`
-* ss - `date.getSeconds()`
-* SSS - `date.getMilliseconds()`
-* O - timezone offset in +hm format (note that time will be in UTC if displaying offset)
-
-Built-in formats:
-* `format.ISO8601_FORMAT` - `2017-03-14T14:10:20.391` (local time used)
-* `format.ISO8601_WITH_TZ_OFFSET_FORMAT` - `2017-03-14T03:10:20.391+1100` (UTC + TZ used)
-* `format.DATETIME_FORMAT` - `14 03 2017 14:10:20.391` (local time used)
-* `format.ABSOLUTETIME_FORMAT` - `14:10:20.391` (local time used)
-
-Parsing strings as dates
-----
-The date format library has limited ability to parse strings into dates. It can convert strings created using date format patterns (as above), but if you're looking for anything more sophisticated than that you should probably look for a better library ([momentjs](https://momentjs.com) does pretty much everything).
-
-```javascript
-var format = require('date-format');
-// pass in the format of the string as first argument
-format.parse(format.ISO8601_FORMAT, '2017-03-14T14:10:20.391');
-// returns Date
-```
diff --git a/node_modules/streamroller/node_modules/date-format/lib/index.js b/node_modules/streamroller/node_modules/date-format/lib/index.js
deleted file mode 100644
index 59abf55..0000000
--- a/node_modules/streamroller/node_modules/date-format/lib/index.js
+++ /dev/null
@@ -1,195 +0,0 @@
-"use strict";
-
-function padWithZeros(vNumber, width) {
- var numAsString = vNumber.toString();
- while (numAsString.length < width) {
- numAsString = "0" + numAsString;
- }
- return numAsString;
-}
-
-function addZero(vNumber) {
- return padWithZeros(vNumber, 2);
-}
-
-/**
- * Formats the TimeOffset
- * Thanks to http://www.svendtofte.com/code/date_format/
- * @private
- */
-function offset(timezoneOffset) {
- var os = Math.abs(timezoneOffset);
- var h = String(Math.floor(os / 60));
- var m = String(os % 60);
- if (h.length === 1) {
- h = "0" + h;
- }
- if (m.length === 1) {
- m = "0" + m;
- }
- return timezoneOffset < 0 ? "+" + h + m : "-" + h + m;
-}
-
-function datePart(date, displayUTC, part) {
- return displayUTC ? date["getUTC" + part]() : date["get" + part]();
-}
-
-function asString(format, date) {
- if (typeof format !== "string") {
- date = format;
- format = module.exports.ISO8601_FORMAT;
- }
- if (!date) {
- date = module.exports.now();
- }
-
- var displayUTC = format.indexOf("O") > -1;
-
- var vDay = addZero(datePart(date, displayUTC, "Date"));
- var vMonth = addZero(datePart(date, displayUTC, "Month") + 1);
- var vYearLong = addZero(datePart(date, displayUTC, "FullYear"));
- var vYearShort = addZero(vYearLong.substring(2, 4));
- var vYear = format.indexOf("yyyy") > -1 ? vYearLong : vYearShort;
- var vHour = addZero(datePart(date, displayUTC, "Hours"));
- var vMinute = addZero(datePart(date, displayUTC, "Minutes"));
- var vSecond = addZero(datePart(date, displayUTC, "Seconds"));
- var vMillisecond = padWithZeros(
- datePart(date, displayUTC, "Milliseconds"),
- 3
- );
- var vTimeZone = offset(date.getTimezoneOffset());
- var formatted = format
- .replace(/dd/g, vDay)
- .replace(/MM/g, vMonth)
- .replace(/y{1,4}/g, vYear)
- .replace(/hh/g, vHour)
- .replace(/mm/g, vMinute)
- .replace(/ss/g, vSecond)
- .replace(/SSS/g, vMillisecond)
- .replace(/O/g, vTimeZone);
- return formatted;
-}
-
-function extractDateParts(pattern, str, missingValuesDate) {
- var matchers = [
- {
- pattern: /y{1,4}/,
- regexp: "\\d{1,4}",
- fn: function(date, value) {
- date.setFullYear(value);
- }
- },
- {
- pattern: /MM/,
- regexp: "\\d{1,2}",
- fn: function(date, value) {
- date.setMonth(value - 1);
- }
- },
- {
- pattern: /dd/,
- regexp: "\\d{1,2}",
- fn: function(date, value) {
- date.setDate(value);
- }
- },
- {
- pattern: /hh/,
- regexp: "\\d{1,2}",
- fn: function(date, value) {
- date.setHours(value);
- }
- },
- {
- pattern: /mm/,
- regexp: "\\d\\d",
- fn: function(date, value) {
- date.setMinutes(value);
- }
- },
- {
- pattern: /ss/,
- regexp: "\\d\\d",
- fn: function(date, value) {
- date.setSeconds(value);
- }
- },
- {
- pattern: /SSS/,
- regexp: "\\d\\d\\d",
- fn: function(date, value) {
- date.setMilliseconds(value);
- }
- },
- {
- pattern: /O/,
- regexp: "[+-]\\d{3,4}|Z",
- fn: function(date, value) {
- if (value === "Z") {
- value = 0;
- }
- var offset = Math.abs(value);
- var minutes = (offset % 100) + Math.floor(offset / 100) * 60;
- date.setMinutes(date.getMinutes() + (value > 0 ? minutes : -minutes));
- }
- }
- ];
-
- var parsedPattern = matchers.reduce(
- function(p, m) {
- if (m.pattern.test(p.regexp)) {
- m.index = p.regexp.match(m.pattern).index;
- p.regexp = p.regexp.replace(m.pattern, "(" + m.regexp + ")");
- } else {
- m.index = -1;
- }
- return p;
- },
- { regexp: pattern, index: [] }
- );
-
- var dateFns = matchers.filter(function(m) {
- return m.index > -1;
- });
- dateFns.sort(function(a, b) {
- return a.index - b.index;
- });
-
- var matcher = new RegExp(parsedPattern.regexp);
- var matches = matcher.exec(str);
- if (matches) {
- var date = missingValuesDate || module.exports.now();
- dateFns.forEach(function(f, i) {
- f.fn(date, matches[i + 1]);
- });
- return date;
- }
-
- throw new Error(
- "String '" + str + "' could not be parsed as '" + pattern + "'"
- );
-}
-
-function parse(pattern, str, missingValuesDate) {
- if (!pattern) {
- throw new Error("pattern must be supplied");
- }
-
- return extractDateParts(pattern, str, missingValuesDate);
-}
-
-/**
- * Used for testing - replace this function with a fixed date.
- */
-function now() {
- return new Date();
-}
-
-module.exports = asString;
-module.exports.asString = asString;
-module.exports.parse = parse;
-module.exports.now = now;
-module.exports.ISO8601_FORMAT = "yyyy-MM-ddThh:mm:ss.SSS";
-module.exports.ISO8601_WITH_TZ_OFFSET_FORMAT = "yyyy-MM-ddThh:mm:ss.SSSO";
-module.exports.DATETIME_FORMAT = "dd MM yyyy hh:mm:ss.SSS";
-module.exports.ABSOLUTETIME_FORMAT = "hh:mm:ss.SSS";
diff --git a/node_modules/streamroller/node_modules/date-format/package.json b/node_modules/streamroller/node_modules/date-format/package.json
deleted file mode 100644
index ee2ad84..0000000
--- a/node_modules/streamroller/node_modules/date-format/package.json
+++ /dev/null
@@ -1,33 +0,0 @@
-{
- "name": "date-format",
- "version": "2.1.0",
- "description": "Formatting Date objects as strings since 2013",
- "main": "lib/index.js",
- "repository": {
- "type": "git",
- "url": "https://github.com/nomiddlename/date-format.git"
- },
- "engines": {
- "node": ">=4.0"
- },
- "scripts": {
- "lint": "eslint lib/* test/*",
- "pretest": "eslint lib/* test/*",
- "test": "mocha"
- },
- "keywords": [
- "date",
- "format",
- "string"
- ],
- "author": "Gareth Jones <gareth.nomiddlename@gmail.com>",
- "license": "MIT",
- "readmeFilename": "README.md",
- "gitHead": "bf59015ab6c9e86454b179374f29debbdb403522",
- "devDependencies": {
- "eslint": "^5.16.0",
- "eslint-plugin-mocha": "^5.3.0",
- "mocha": "^5.2.0",
- "should": "^13.2.3"
- }
-}
diff --git a/node_modules/streamroller/node_modules/date-format/test/date_format-test.js b/node_modules/streamroller/node_modules/date-format/test/date_format-test.js
deleted file mode 100644
index 9394c1f..0000000
--- a/node_modules/streamroller/node_modules/date-format/test/date_format-test.js
+++ /dev/null
@@ -1,64 +0,0 @@
-'use strict';
-
-require('should');
-
-var dateFormat = require('../lib');
-
-function createFixedDate() {
- return new Date(2010, 0, 11, 14, 31, 30, 5);
-}
-
-describe('date_format', function() {
- var date = createFixedDate();
-
- it('should default to now when a date is not provided', function() {
- dateFormat.asString(dateFormat.DATETIME_FORMAT).should.not.be.empty();
- });
-
- it('should be usable directly without calling asString', function() {
- dateFormat(dateFormat.DATETIME_FORMAT, date).should.eql('11 01 2010 14:31:30.005');
- });
-
- it('should format a date as string using a pattern', function() {
- dateFormat.asString(dateFormat.DATETIME_FORMAT, date).should.eql('11 01 2010 14:31:30.005');
- });
-
- it('should default to the ISO8601 format', function() {
- dateFormat.asString(date).should.eql('2010-01-11T14:31:30.005');
- });
-
- it('should provide a ISO8601 with timezone offset format', function() {
- var tzDate = createFixedDate();
- tzDate.setMinutes(tzDate.getMinutes() - tzDate.getTimezoneOffset() - 660);
- tzDate.getTimezoneOffset = function () {
- return -660;
- };
-
- // when tz offset is in the pattern, the date should be in UTC
- dateFormat.asString(dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT, tzDate)
- .should.eql('2010-01-11T03:31:30.005+1100');
-
- tzDate = createFixedDate();
- tzDate.setMinutes((tzDate.getMinutes() - tzDate.getTimezoneOffset()) + 120);
- tzDate.getTimezoneOffset = function () {
- return 120;
- };
-
- dateFormat.asString(dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT, tzDate)
- .should.eql('2010-01-11T16:31:30.005-0200');
- });
-
- it('should provide a just-the-time format', function() {
- dateFormat.asString(dateFormat.ABSOLUTETIME_FORMAT, date).should.eql('14:31:30.005');
- });
-
- it('should provide a custom format', function() {
- var customDate = createFixedDate();
- customDate.setMinutes((customDate.getMinutes() - customDate.getTimezoneOffset()) + 120);
- customDate.getTimezoneOffset = function () {
- return 120;
- };
-
- dateFormat.asString('O.SSS.ss.mm.hh.dd.MM.yy', customDate).should.eql('-0200.005.30.31.16.11.01.10');
- });
-});
diff --git a/node_modules/streamroller/node_modules/date-format/test/parse-test.js b/node_modules/streamroller/node_modules/date-format/test/parse-test.js
deleted file mode 100644
index 44bcc27..0000000
--- a/node_modules/streamroller/node_modules/date-format/test/parse-test.js
+++ /dev/null
@@ -1,177 +0,0 @@
-"use strict";
-
-require("should");
-var dateFormat = require("../lib");
-
-describe("dateFormat.parse", function() {
- it("should require a pattern", function() {
- (function() {
- dateFormat.parse();
- }.should.throw(/pattern must be supplied/));
- (function() {
- dateFormat.parse(null);
- }.should.throw(/pattern must be supplied/));
- (function() {
- dateFormat.parse("");
- }.should.throw(/pattern must be supplied/));
- });
-
- describe("with a pattern that has no replacements", function() {
- it("should return a new date when the string matches", function() {
- dateFormat.parse("cheese", "cheese").should.be.a.Date();
- });
-
- it("should throw if the string does not match", function() {
- (function() {
- dateFormat.parse("cheese", "biscuits");
- }.should.throw(/String 'biscuits' could not be parsed as 'cheese'/));
- });
- });
-
- describe("with a full pattern", function() {
- var pattern = "yyyy-MM-dd hh:mm:ss.SSSO";
-
- it("should return the correct date if the string matches", function() {
- var testDate = new Date();
- testDate.setFullYear(2018);
- testDate.setMonth(8);
- testDate.setDate(13);
- testDate.setHours(18);
- testDate.setMinutes(10);
- testDate.setSeconds(12);
- testDate.setMilliseconds(392);
- testDate.getTimezoneOffset = function() {
- return 600;
- };
-
- dateFormat
- .parse(pattern, "2018-09-13 08:10:12.392+1000")
- .getTime()
- .should.eql(testDate.getTime());
- });
-
- it("should throw if the string does not match", function() {
- (function() {
- dateFormat.parse(pattern, "biscuits");
- }.should.throw(
- /String 'biscuits' could not be parsed as 'yyyy-MM-dd hh:mm:ss.SSSO'/
- ));
- });
- });
-
- describe("with a partial pattern", function() {
- var testDate = new Date();
- dateFormat.now = function() {
- return testDate;
- };
-
- function verifyDate(actual, expected) {
- actual.getFullYear().should.eql(expected.year || testDate.getFullYear());
- actual.getMonth().should.eql(expected.month || testDate.getMonth());
- actual.getDate().should.eql(expected.day || testDate.getDate());
- actual.getHours().should.eql(expected.hours || testDate.getHours());
- actual.getMinutes().should.eql(expected.minutes || testDate.getMinutes());
- actual.getSeconds().should.eql(expected.seconds || testDate.getSeconds());
- actual
- .getMilliseconds()
- .should.eql(expected.milliseconds || testDate.getMilliseconds());
- }
-
- it("should return a date with missing values defaulting to current time", function() {
- var date = dateFormat.parse("yyyy-MM", "2015-09");
- verifyDate(date, { year: 2015, month: 8 });
- });
-
- it("should use a passed in date for missing values", function() {
- var missingValueDate = new Date(2010, 1, 11, 10, 30, 12, 100);
- var date = dateFormat.parse("yyyy-MM", "2015-09", missingValueDate);
- verifyDate(date, {
- year: 2015,
- month: 8,
- day: 11,
- hours: 10,
- minutes: 30,
- seconds: 12,
- milliseconds: 100
- });
- });
-
- it("should handle variations on the same pattern", function() {
- var date = dateFormat.parse("MM-yyyy", "09-2015");
- verifyDate(date, { year: 2015, month: 8 });
-
- date = dateFormat.parse("yyyy MM", "2015 09");
- verifyDate(date, { year: 2015, month: 8 });
-
- date = dateFormat.parse("MM, yyyy.", "09, 2015.");
- verifyDate(date, { year: 2015, month: 8 });
- });
-
- it("should match all the date parts", function() {
- var date = dateFormat.parse("dd", "21");
- verifyDate(date, { day: 21 });
-
- date = dateFormat.parse("hh", "12");
- verifyDate(date, { hours: 12 });
-
- date = dateFormat.parse("mm", "34");
- verifyDate(date, { minutes: 34 });
-
- date = dateFormat.parse("ss", "59");
- verifyDate(date, { seconds: 59 });
-
- date = dateFormat.parse("ss.SSS", "23.452");
- verifyDate(date, { seconds: 23, milliseconds: 452 });
-
- date = dateFormat.parse("hh:mm O", "05:23 +1000");
- verifyDate(date, { hours: 15, minutes: 23 });
-
- date = dateFormat.parse("hh:mm O", "05:23 -200");
- verifyDate(date, { hours: 3, minutes: 23 });
-
- date = dateFormat.parse("hh:mm O", "05:23 +0930");
- verifyDate(date, { hours: 14, minutes: 53 });
- });
- });
-
- describe("with a date formatted by this library", function() {
- var testDate = new Date();
- testDate.setUTCFullYear(2018);
- testDate.setUTCMonth(8);
- testDate.setUTCDate(13);
- testDate.setUTCHours(18);
- testDate.setUTCMinutes(10);
- testDate.setUTCSeconds(12);
- testDate.setUTCMilliseconds(392);
-
- it("should format and then parse back to the same date", function() {
- dateFormat
- .parse(
- dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT,
- dateFormat(dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT, testDate)
- )
- .should.eql(testDate);
-
- dateFormat
- .parse(
- dateFormat.ISO8601_FORMAT,
- dateFormat(dateFormat.ISO8601_FORMAT, testDate)
- )
- .should.eql(testDate);
-
- dateFormat
- .parse(
- dateFormat.DATETIME_FORMAT,
- dateFormat(dateFormat.DATETIME_FORMAT, testDate)
- )
- .should.eql(testDate);
-
- dateFormat
- .parse(
- dateFormat.ABSOLUTETIME_FORMAT,
- dateFormat(dateFormat.ABSOLUTETIME_FORMAT, testDate)
- )
- .should.eql(testDate);
- });
- });
-});
diff --git a/node_modules/streamroller/node_modules/debug/LICENSE b/node_modules/streamroller/node_modules/debug/LICENSE
new file mode 100644
index 0000000..1a9820e
--- /dev/null
+++ b/node_modules/streamroller/node_modules/debug/LICENSE
@@ -0,0 +1,20 @@
+(The MIT License)
+
+Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
+Copyright (c) 2018-2021 Josh Junon
+
+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.
+
diff --git a/node_modules/streamroller/node_modules/debug/README.md b/node_modules/streamroller/node_modules/debug/README.md
new file mode 100644
index 0000000..e9c3e04
--- /dev/null
+++ b/node_modules/streamroller/node_modules/debug/README.md
@@ -0,0 +1,481 @@
+# debug
+[](https://travis-ci.org/debug-js/debug) [](https://coveralls.io/github/debug-js/debug?branch=master) [](https://visionmedia-community-slackin.now.sh/) [](#backers)
+[](#sponsors)
+
+<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
+
+A tiny JavaScript debugging utility modelled after Node.js core's debugging
+technique. Works in Node.js and web browsers.
+
+## Installation
+
+```bash
+$ npm install debug
+```
+
+## Usage
+
+`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.
+
+Example [_app.js_](./examples/node/app.js):
+
+```js
+var debug = require('debug')('http')
+ , http = require('http')
+ , name = 'My App';
+
+// fake app
+
+debug('booting %o', name);
+
+http.createServer(function(req, res){
+ debug(req.method + ' ' + req.url);
+ res.end('hello\n');
+}).listen(3000, function(){
+ debug('listening');
+});
+
+// fake worker of some kind
+
+require('./worker');
+```
+
+Example [_worker.js_](./examples/node/worker.js):
+
+```js
+var a = require('debug')('worker:a')
+ , b = require('debug')('worker:b');
+
+function work() {
+ a('doing lots of uninteresting work');
+ setTimeout(work, Math.random() * 1000);
+}
+
+work();
+
+function workb() {
+ b('doing some work');
+ setTimeout(workb, Math.random() * 2000);
+}
+
+workb();
+```
+
+The `DEBUG` environment variable is then used to enable these based on space or
+comma-delimited names.
+
+Here are some examples:
+
+<img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png">
+<img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png">
+<img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png">
+
+#### Windows command prompt notes
+
+##### CMD
+
+On Windows the environment variable is set using the `set` command.
+
+```cmd
+set DEBUG=*,-not_this
+```
+
+Example:
+
+```cmd
+set DEBUG=* & node app.js
+```
+
+##### PowerShell (VS Code default)
+
+PowerShell uses different syntax to set environment variables.
+
+```cmd
+$env:DEBUG = "*,-not_this"
+```
+
+Example:
+
+```cmd
+$env:DEBUG='app';node app.js
+```
+
+Then, run the program to be debugged as usual.
+
+npm script example:
+```js
+ "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js",
+```
+
+## Namespace Colors
+
+Every debug instance has a color generated for it based on its namespace name.
+This helps when visually parsing the debug output to identify which debug instance
+a debug line belongs to.
+
+#### Node.js
+
+In Node.js, colors are enabled when stderr is a TTY. You also _should_ install
+the [`supports-color`](https://npmjs.org/supports-color) module alongside debug,
+otherwise debug will only use a small handful of basic colors.
+
+<img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png">
+
+#### Web Browser
+
+Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
+option. These are WebKit web inspectors, Firefox ([since version
+31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
+and the Firebug plugin for Firefox (any version).
+
+<img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png">
+
+
+## Millisecond diff
+
+When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
+
+<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">
+
+When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below:
+
+<img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png">
+
+
+## Conventions
+
+If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser". If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable. You can then use it for normal output as well as debug output.
+
+## Wildcards
+
+The `*` character may be used as a wildcard. Suppose for example your library has
+debuggers named "connect:bodyParser", "connect:compress", "connect:session",
+instead of listing all three with
+`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do
+`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
+
+You can also exclude specific debuggers by prefixing them with a "-" character.
+For example, `DEBUG=*,-connect:*` would include all debuggers except those
+starting with "connect:".
+
+## Environment Variables
+
+When running through Node.js, you can set a few environment variables that will
+change the behavior of the debug logging:
+
+| Name | Purpose |
+|-----------|-------------------------------------------------|
+| `DEBUG` | Enables/disables specific debugging namespaces. |
+| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY). |
+| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
+| `DEBUG_DEPTH` | Object inspection depth. |
+| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |
+
+
+__Note:__ The environment variables beginning with `DEBUG_` end up being
+converted into an Options object that gets used with `%o`/`%O` formatters.
+See the Node.js documentation for
+[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
+for the complete list.
+
+## Formatters
+
+Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting.
+Below are the officially supported formatters:
+
+| Formatter | Representation |
+|-----------|----------------|
+| `%O` | Pretty-print an Object on multiple lines. |
+| `%o` | Pretty-print an Object all on a single line. |
+| `%s` | String. |
+| `%d` | Number (both integer and float). |
+| `%j` | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
+| `%%` | Single percent sign ('%'). This does not consume an argument. |
+
+
+### Custom formatters
+
+You can add custom formatters by extending the `debug.formatters` object.
+For example, if you wanted to add support for rendering a Buffer as hex with
+`%h`, you could do something like:
+
+```js
+const createDebug = require('debug')
+createDebug.formatters.h = (v) => {
+ return v.toString('hex')
+}
+
+// …elsewhere
+const debug = createDebug('foo')
+debug('this is hex: %h', new Buffer('hello world'))
+// foo this is hex: 68656c6c6f20776f726c6421 +0ms
+```
+
+
+## Browser Support
+
+You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
+or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
+if you don't want to build it yourself.
+
+Debug's enable state is currently persisted by `localStorage`.
+Consider the situation shown below where you have `worker:a` and `worker:b`,
+and wish to debug both. You can enable this using `localStorage.debug`:
+
+```js
+localStorage.debug = 'worker:*'
+```
+
+And then refresh the page.
+
+```js
+a = debug('worker:a');
+b = debug('worker:b');
+
+setInterval(function(){
+ a('doing some work');
+}, 1000);
+
+setInterval(function(){
+ b('doing some work');
+}, 1200);
+```
+
+In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_.
+
+<img width="647" src="https://user-images.githubusercontent.com/7143133/152083257-29034707-c42c-4959-8add-3cee850e6fcf.png">
+
+## Output streams
+
+ By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:
+
+Example [_stdout.js_](./examples/node/stdout.js):
+
+```js
+var debug = require('debug');
+var error = debug('app:error');
+
+// by default stderr is used
+error('goes to stderr!');
+
+var log = debug('app:log');
+// set this namespace to log via console.log
+log.log = console.log.bind(console); // don't forget to bind to console!
+log('goes to stdout');
+error('still goes to stderr!');
+
+// set all output to go via console.info
+// overrides all per-namespace log settings
+debug.log = console.info.bind(console);
+error('now goes to stdout via console.info');
+log('still goes to stdout, but via console.info now');
+```
+
+## Extend
+You can simply extend debugger
+```js
+const log = require('debug')('auth');
+
+//creates new debug instance with extended namespace
+const logSign = log.extend('sign');
+const logLogin = log.extend('login');
+
+log('hello'); // auth hello
+logSign('hello'); //auth:sign hello
+logLogin('hello'); //auth:login hello
+```
+
+## Set dynamically
+
+You can also enable debug dynamically by calling the `enable()` method :
+
+```js
+let debug = require('debug');
+
+console.log(1, debug.enabled('test'));
+
+debug.enable('test');
+console.log(2, debug.enabled('test'));
+
+debug.disable();
+console.log(3, debug.enabled('test'));
+
+```
+
+print :
+```
+1 false
+2 true
+3 false
+```
+
+Usage :
+`enable(namespaces)`
+`namespaces` can include modes separated by a colon and wildcards.
+
+Note that calling `enable()` completely overrides previously set DEBUG variable :
+
+```
+$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))'
+=> false
+```
+
+`disable()`
+
+Will disable all namespaces. The functions returns the namespaces currently
+enabled (and skipped). This can be useful if you want to disable debugging
+temporarily without knowing what was enabled to begin with.
+
+For example:
+
+```js
+let debug = require('debug');
+debug.enable('foo:*,-foo:bar');
+let namespaces = debug.disable();
+debug.enable(namespaces);
+```
+
+Note: There is no guarantee that the string will be identical to the initial
+enable string, but semantically they will be identical.
+
+## Checking whether a debug target is enabled
+
+After you've created a debug instance, you can determine whether or not it is
+enabled by checking the `enabled` property:
+
+```javascript
+const debug = require('debug')('http');
+
+if (debug.enabled) {
+ // do stuff...
+}
+```
+
+You can also manually toggle this property to force the debug instance to be
+enabled or disabled.
+
+## Usage in child processes
+
+Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process.
+For example:
+
+```javascript
+worker = fork(WORKER_WRAP_PATH, [workerPath], {
+ stdio: [
+ /* stdin: */ 0,
+ /* stdout: */ 'pipe',
+ /* stderr: */ 'pipe',
+ 'ipc',
+ ],
+ env: Object.assign({}, process.env, {
+ DEBUG_COLORS: 1 // without this settings, colors won't be shown
+ }),
+});
+
+worker.stderr.pipe(process.stderr, { end: false });
+```
+
+
+## Authors
+
+ - TJ Holowaychuk
+ - Nathan Rajlich
+ - Andrew Rhyne
+ - Josh Junon
+
+## Backers
+
+Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]
+
+<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>
+
+
+## Sponsors
+
+Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]
+
+<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
+<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
+Copyright (c) 2018-2021 Josh Junon
+
+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.
diff --git a/node_modules/streamroller/node_modules/debug/package.json b/node_modules/streamroller/node_modules/debug/package.json
new file mode 100644
index 0000000..3bcdc24
--- /dev/null
+++ b/node_modules/streamroller/node_modules/debug/package.json
@@ -0,0 +1,59 @@
+{
+ "name": "debug",
+ "version": "4.3.4",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/debug-js/debug.git"
+ },
+ "description": "Lightweight debugging utility for Node.js and the browser",
+ "keywords": [
+ "debug",
+ "log",
+ "debugger"
+ ],
+ "files": [
+ "src",
+ "LICENSE",
+ "README.md"
+ ],
+ "author": "Josh Junon <josh.junon@protonmail.com>",
+ "contributors": [
+ "TJ Holowaychuk <tj@vision-media.ca>",
+ "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)",
+ "Andrew Rhyne <rhyneandrew@gmail.com>"
+ ],
+ "license": "MIT",
+ "scripts": {
+ "lint": "xo",
+ "test": "npm run test:node && npm run test:browser && npm run lint",
+ "test:node": "istanbul cover _mocha -- test.js",
+ "test:browser": "karma start --single-run",
+ "test:coverage": "cat ./coverage/lcov.info | coveralls"
+ },
+ "dependencies": {
+ "ms": "2.1.2"
+ },
+ "devDependencies": {
+ "brfs": "^2.0.1",
+ "browserify": "^16.2.3",
+ "coveralls": "^3.0.2",
+ "istanbul": "^0.4.5",
+ "karma": "^3.1.4",
+ "karma-browserify": "^6.0.0",
+ "karma-chrome-launcher": "^2.2.0",
+ "karma-mocha": "^1.3.0",
+ "mocha": "^5.2.0",
+ "mocha-lcov-reporter": "^1.2.0",
+ "xo": "^0.23.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ },
+ "main": "./src/index.js",
+ "browser": "./src/browser.js",
+ "engines": {
+ "node": ">=6.0"
+ }
+}
diff --git a/node_modules/streamroller/node_modules/debug/src/browser.js b/node_modules/streamroller/node_modules/debug/src/browser.js
new file mode 100644
index 0000000..cd0fc35
--- /dev/null
+++ b/node_modules/streamroller/node_modules/debug/src/browser.js
@@ -0,0 +1,269 @@
+/* eslint-env browser */
+
+/**
+ * This is the web browser implementation of `debug()`.
+ */
+
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.storage = localstorage();
+exports.destroy = (() => {
+ let warned = false;
+
+ return () => {
+ if (!warned) {
+ warned = true;
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
+ }
+ };
+})();
+
+/**
+ * Colors.
+ */
+
+exports.colors = [
+ '#0000CC',
+ '#0000FF',
+ '#0033CC',
+ '#0033FF',
+ '#0066CC',
+ '#0066FF',
+ '#0099CC',
+ '#0099FF',
+ '#00CC00',
+ '#00CC33',
+ '#00CC66',
+ '#00CC99',
+ '#00CCCC',
+ '#00CCFF',
+ '#3300CC',
+ '#3300FF',
+ '#3333CC',
+ '#3333FF',
+ '#3366CC',
+ '#3366FF',
+ '#3399CC',
+ '#3399FF',
+ '#33CC00',
+ '#33CC33',
+ '#33CC66',
+ '#33CC99',
+ '#33CCCC',
+ '#33CCFF',
+ '#6600CC',
+ '#6600FF',
+ '#6633CC',
+ '#6633FF',
+ '#66CC00',
+ '#66CC33',
+ '#9900CC',
+ '#9900FF',
+ '#9933CC',
+ '#9933FF',
+ '#99CC00',
+ '#99CC33',
+ '#CC0000',
+ '#CC0033',
+ '#CC0066',
+ '#CC0099',
+ '#CC00CC',
+ '#CC00FF',
+ '#CC3300',
+ '#CC3333',
+ '#CC3366',
+ '#CC3399',
+ '#CC33CC',
+ '#CC33FF',
+ '#CC6600',
+ '#CC6633',
+ '#CC9900',
+ '#CC9933',
+ '#CCCC00',
+ '#CCCC33',
+ '#FF0000',
+ '#FF0033',
+ '#FF0066',
+ '#FF0099',
+ '#FF00CC',
+ '#FF00FF',
+ '#FF3300',
+ '#FF3333',
+ '#FF3366',
+ '#FF3399',
+ '#FF33CC',
+ '#FF33FF',
+ '#FF6600',
+ '#FF6633',
+ '#FF9900',
+ '#FF9933',
+ '#FFCC00',
+ '#FFCC33'
+];
+
+/**
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+ * and the Firebug extension (any Firefox version) are known
+ * to support "%c" CSS customizations.
+ *
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
+ */
+
+// eslint-disable-next-line complexity
+function useColors() {
+ // NB: In an Electron preload script, document will be defined but not fully
+ // initialized. Since we know we're in Chrome, we'll just detect this case
+ // explicitly
+ if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
+ return true;
+ }
+
+ // Internet Explorer and Edge do not support colors.
+ if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
+ return false;
+ }
+
+ // Is webkit? http://stackoverflow.com/a/16459606/376773
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+ return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+ // Is firebug? http://stackoverflow.com/a/398120/376773
+ (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+ // Is firefox >= v31?
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
+ // Double check webkit in userAgent just in case we are in a worker
+ (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+}
+
+/**
+ * Colorize log arguments if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+ args[0] = (this.useColors ? '%c' : '') +
+ this.namespace +
+ (this.useColors ? ' %c' : ' ') +
+ args[0] +
+ (this.useColors ? '%c ' : ' ') +
+ '+' + module.exports.humanize(this.diff);
+
+ if (!this.useColors) {
+ return;
+ }
+
+ const c = 'color: ' + this.color;
+ args.splice(1, 0, c, 'color: inherit');
+
+ // The final "%c" is somewhat tricky, because there could be other
+ // arguments passed either before or after the %c, so we need to
+ // figure out the correct index to insert the CSS into
+ let index = 0;
+ let lastC = 0;
+ args[0].replace(/%[a-zA-Z%]/g, match => {
+ if (match === '%%') {
+ return;
+ }
+ index++;
+ if (match === '%c') {
+ // We only are interested in the *last* %c
+ // (the user may have provided their own)
+ lastC = index;
+ }
+ });
+
+ args.splice(lastC, 0, c);
+}
+
+/**
+ * Invokes `console.debug()` when available.
+ * No-op when `console.debug` is not a "function".
+ * If `console.debug` is not available, falls back
+ * to `console.log`.
+ *
+ * @api public
+ */
+exports.log = console.debug || console.log || (() => {});
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+function save(namespaces) {
+ try {
+ if (namespaces) {
+ exports.storage.setItem('debug', namespaces);
+ } else {
+ exports.storage.removeItem('debug');
+ }
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+function load() {
+ let r;
+ try {
+ r = exports.storage.getItem('debug');
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+
+ // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+ if (!r && typeof process !== 'undefined' && 'env' in process) {
+ r = process.env.DEBUG;
+ }
+
+ return r;
+}
+
+/**
+ * Localstorage attempts to return the localstorage.
+ *
+ * This is necessary because safari throws
+ * when a user disables cookies/localstorage
+ * and you attempt to access it.
+ *
+ * @return {LocalStorage}
+ * @api private
+ */
+
+function localstorage() {
+ try {
+ // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
+ // The Browser also has localStorage in the global context.
+ return localStorage;
+ } catch (error) {
+ // Swallow
+ // XXX (@Qix-) should we be logging these?
+ }
+}
+
+module.exports = require('./common')(exports);
+
+const {formatters} = module.exports;
+
+/**
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+ */
+
+formatters.j = function (v) {
+ try {
+ return JSON.stringify(v);
+ } catch (error) {
+ return '[UnexpectedJSONParseError]: ' + error.message;
+ }
+};
diff --git a/node_modules/streamroller/node_modules/debug/src/common.js b/node_modules/streamroller/node_modules/debug/src/common.js
new file mode 100644
index 0000000..e3291b2
--- /dev/null
+++ b/node_modules/streamroller/node_modules/debug/src/common.js
@@ -0,0 +1,274 @@
+
+/**
+ * This is the common logic for both the Node.js and web browser
+ * implementations of `debug()`.
+ */
+
+function setup(env) {
+ createDebug.debug = createDebug;
+ createDebug.default = createDebug;
+ createDebug.coerce = coerce;
+ createDebug.disable = disable;
+ createDebug.enable = enable;
+ createDebug.enabled = enabled;
+ createDebug.humanize = require('ms');
+ createDebug.destroy = destroy;
+
+ Object.keys(env).forEach(key => {
+ createDebug[key] = env[key];
+ });
+
+ /**
+ * The currently active debug mode names, and names to skip.
+ */
+
+ createDebug.names = [];
+ createDebug.skips = [];
+
+ /**
+ * Map of special "%n" handling functions, for the debug "format" argument.
+ *
+ * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+ */
+ createDebug.formatters = {};
+
+ /**
+ * Selects a color for a debug namespace
+ * @param {String} namespace The namespace string for the debug instance to be colored
+ * @return {Number|String} An ANSI color code for the given namespace
+ * @api private
+ */
+ function selectColor(namespace) {
+ let hash = 0;
+
+ for (let i = 0; i < namespace.length; i++) {
+ hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
+ hash |= 0; // Convert to 32bit integer
+ }
+
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
+ }
+ createDebug.selectColor = selectColor;
+
+ /**
+ * Create a debugger with the given `namespace`.
+ *
+ * @param {String} namespace
+ * @return {Function}
+ * @api public
+ */
+ function createDebug(namespace) {
+ let prevTime;
+ let enableOverride = null;
+ let namespacesCache;
+ let enabledCache;
+
+ function debug(...args) {
+ // Disabled?
+ if (!debug.enabled) {
+ return;
+ }
+
+ const self = debug;
+
+ // Set `diff` timestamp
+ const curr = Number(new Date());
+ const ms = curr - (prevTime || curr);
+ self.diff = ms;
+ self.prev = prevTime;
+ self.curr = curr;
+ prevTime = curr;
+
+ args[0] = createDebug.coerce(args[0]);
+
+ if (typeof args[0] !== 'string') {
+ // Anything else let's inspect with %O
+ args.unshift('%O');
+ }
+
+ // Apply any `formatters` transformations
+ let index = 0;
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
+ // If we encounter an escaped % then don't increase the array index
+ if (match === '%%') {
+ return '%';
+ }
+ index++;
+ const formatter = createDebug.formatters[format];
+ if (typeof formatter === 'function') {
+ const val = args[index];
+ match = formatter.call(self, val);
+
+ // Now we need to remove `args[index]` since it's inlined in the `format`
+ args.splice(index, 1);
+ index--;
+ }
+ return match;
+ });
+
+ // Apply env-specific formatting (colors, etc.)
+ createDebug.formatArgs.call(self, args);
+
+ const logFn = self.log || createDebug.log;
+ logFn.apply(self, args);
+ }
+
+ debug.namespace = namespace;
+ debug.useColors = createDebug.useColors();
+ debug.color = createDebug.selectColor(namespace);
+ debug.extend = extend;
+ debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
+
+ Object.defineProperty(debug, 'enabled', {
+ enumerable: true,
+ configurable: false,
+ get: () => {
+ if (enableOverride !== null) {
+ return enableOverride;
+ }
+ if (namespacesCache !== createDebug.namespaces) {
+ namespacesCache = createDebug.namespaces;
+ enabledCache = createDebug.enabled(namespace);
+ }
+
+ return enabledCache;
+ },
+ set: v => {
+ enableOverride = v;
+ }
+ });
+
+ // Env-specific initialization logic for debug instances
+ if (typeof createDebug.init === 'function') {
+ createDebug.init(debug);
+ }
+
+ return debug;
+ }
+
+ function extend(namespace, delimiter) {
+ const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
+ newDebug.log = this.log;
+ return newDebug;
+ }
+
+ /**
+ * Enables a debug mode by namespaces. This can include modes
+ * separated by a colon and wildcards.
+ *
+ * @param {String} namespaces
+ * @api public
+ */
+ function enable(namespaces) {
+ createDebug.save(namespaces);
+ createDebug.namespaces = namespaces;
+
+ createDebug.names = [];
+ createDebug.skips = [];
+
+ let i;
+ const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+ const len = split.length;
+
+ for (i = 0; i < len; i++) {
+ if (!split[i]) {
+ // ignore empty strings
+ continue;
+ }
+
+ namespaces = split[i].replace(/\*/g, '.*?');
+
+ if (namespaces[0] === '-') {
+ createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
+ } else {
+ createDebug.names.push(new RegExp('^' + namespaces + '$'));
+ }
+ }
+ }
+
+ /**
+ * Disable debug output.
+ *
+ * @return {String} namespaces
+ * @api public
+ */
+ function disable() {
+ const namespaces = [
+ ...createDebug.names.map(toNamespace),
+ ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
+ ].join(',');
+ createDebug.enable('');
+ return namespaces;
+ }
+
+ /**
+ * Returns true if the given mode name is enabled, false otherwise.
+ *
+ * @param {String} name
+ * @return {Boolean}
+ * @api public
+ */
+ function enabled(name) {
+ if (name[name.length - 1] === '*') {
+ return true;
+ }
+
+ let i;
+ let len;
+
+ for (i = 0, len = createDebug.skips.length; i < len; i++) {
+ if (createDebug.skips[i].test(name)) {
+ return false;
+ }
+ }
+
+ for (i = 0, len = createDebug.names.length; i < len; i++) {
+ if (createDebug.names[i].test(name)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Convert regexp to namespace
+ *
+ * @param {RegExp} regxep
+ * @return {String} namespace
+ * @api private
+ */
+ function toNamespace(regexp) {
+ return regexp.toString()
+ .substring(2, regexp.toString().length - 2)
+ .replace(/\.\*\?$/, '*');
+ }
+
+ /**
+ * Coerce `val`.
+ *
+ * @param {Mixed} val
+ * @return {Mixed}
+ * @api private
+ */
+ function coerce(val) {
+ if (val instanceof Error) {
+ return val.stack || val.message;
+ }
+ return val;
+ }
+
+ /**
+ * XXX DO NOT USE. This is a temporary stub function.
+ * XXX It WILL be removed in the next major release.
+ */
+ function destroy() {
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
+ }
+
+ createDebug.enable(createDebug.load());
+
+ return createDebug;
+}
+
+module.exports = setup;
diff --git a/node_modules/streamroller/node_modules/debug/src/index.js b/node_modules/streamroller/node_modules/debug/src/index.js
new file mode 100644
index 0000000..bf4c57f
--- /dev/null
+++ b/node_modules/streamroller/node_modules/debug/src/index.js
@@ -0,0 +1,10 @@
+/**
+ * Detect Electron renderer / nwjs process, which is node, but we should
+ * treat as a browser.
+ */
+
+if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
+ module.exports = require('./browser.js');
+} else {
+ module.exports = require('./node.js');
+}
diff --git a/node_modules/streamroller/node_modules/debug/src/node.js b/node_modules/streamroller/node_modules/debug/src/node.js
new file mode 100644
index 0000000..79bc085
--- /dev/null
+++ b/node_modules/streamroller/node_modules/debug/src/node.js
@@ -0,0 +1,263 @@
+/**
+ * Module dependencies.
+ */
+
+const tty = require('tty');
+const util = require('util');
+
+/**
+ * This is the Node.js implementation of `debug()`.
+ */
+
+exports.init = init;
+exports.log = log;
+exports.formatArgs = formatArgs;
+exports.save = save;
+exports.load = load;
+exports.useColors = useColors;
+exports.destroy = util.deprecate(
+ () => {},
+ 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
+);
+
+/**
+ * Colors.
+ */
+
+exports.colors = [6, 2, 3, 4, 5, 1];
+
+try {
+ // Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
+ // eslint-disable-next-line import/no-extraneous-dependencies
+ const supportsColor = require('supports-color');
+
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
+ exports.colors = [
+ 20,
+ 21,
+ 26,
+ 27,
+ 32,
+ 33,
+ 38,
+ 39,
+ 40,
+ 41,
+ 42,
+ 43,
+ 44,
+ 45,
+ 56,
+ 57,
+ 62,
+ 63,
+ 68,
+ 69,
+ 74,
+ 75,
+ 76,
+ 77,
+ 78,
+ 79,
+ 80,
+ 81,
+ 92,
+ 93,
+ 98,
+ 99,
+ 112,
+ 113,
+ 128,
+ 129,
+ 134,
+ 135,
+ 148,
+ 149,
+ 160,
+ 161,
+ 162,
+ 163,
+ 164,
+ 165,
+ 166,
+ 167,
+ 168,
+ 169,
+ 170,
+ 171,
+ 172,
+ 173,
+ 178,
+ 179,
+ 184,
+ 185,
+ 196,
+ 197,
+ 198,
+ 199,
+ 200,
+ 201,
+ 202,
+ 203,
+ 204,
+ 205,
+ 206,
+ 207,
+ 208,
+ 209,
+ 214,
+ 215,
+ 220,
+ 221
+ ];
+ }
+} catch (error) {
+ // Swallow - we only care if `supports-color` is available; it doesn't have to be.
+}
+
+/**
+ * Build up the default `inspectOpts` object from the environment variables.
+ *
+ * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+ */
+
+exports.inspectOpts = Object.keys(process.env).filter(key => {
+ return /^debug_/i.test(key);
+}).reduce((obj, key) => {
+ // Camel-case
+ const prop = key
+ .substring(6)
+ .toLowerCase()
+ .replace(/_([a-z])/g, (_, k) => {
+ return k.toUpperCase();
+ });
+
+ // Coerce string value into JS value
+ let val = process.env[key];
+ if (/^(yes|on|true|enabled)$/i.test(val)) {
+ val = true;
+ } else if (/^(no|off|false|disabled)$/i.test(val)) {
+ val = false;
+ } else if (val === 'null') {
+ val = null;
+ } else {
+ val = Number(val);
+ }
+
+ obj[prop] = val;
+ return obj;
+}, {});
+
+/**
+ * Is stdout a TTY? Colored output is enabled when `true`.
+ */
+
+function useColors() {
+ return 'colors' in exports.inspectOpts ?
+ Boolean(exports.inspectOpts.colors) :
+ tty.isatty(process.stderr.fd);
+}
+
+/**
+ * Adds ANSI color escape codes if enabled.
+ *
+ * @api public
+ */
+
+function formatArgs(args) {
+ const {namespace: name, useColors} = this;
+
+ if (useColors) {
+ const c = this.color;
+ const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
+ const prefix = ` ${colorCode};1m${name} \u001B[0m`;
+
+ args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+ args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
+ } else {
+ args[0] = getDate() + name + ' ' + args[0];
+ }
+}
+
+function getDate() {
+ if (exports.inspectOpts.hideDate) {
+ return '';
+ }
+ return new Date().toISOString() + ' ';
+}
+
+/**
+ * Invokes `util.format()` with the specified arguments and writes to stderr.
+ */
+
+function log(...args) {
+ return process.stderr.write(util.format(...args) + '\n');
+}
+
+/**
+ * Save `namespaces`.
+ *
+ * @param {String} namespaces
+ * @api private
+ */
+function save(namespaces) {
+ if (namespaces) {
+ process.env.DEBUG = namespaces;
+ } else {
+ // If you set a process.env field to null or undefined, it gets cast to the
+ // string 'null' or 'undefined'. Just delete instead.
+ delete process.env.DEBUG;
+ }
+}
+
+/**
+ * Load `namespaces`.
+ *
+ * @return {String} returns the previously persisted debug modes
+ * @api private
+ */
+
+function load() {
+ return process.env.DEBUG;
+}
+
+/**
+ * Init logic for `debug` instances.
+ *
+ * Create a new `inspectOpts` object in case `useColors` is set
+ * differently for a particular `debug` instance.
+ */
+
+function init(debug) {
+ debug.inspectOpts = {};
+
+ const keys = Object.keys(exports.inspectOpts);
+ for (let i = 0; i < keys.length; i++) {
+ debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+ }
+}
+
+module.exports = require('./common')(exports);
+
+const {formatters} = module.exports;
+
+/**
+ * Map %o to `util.inspect()`, all on a single line.
+ */
+
+formatters.o = function (v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts)
+ .split('\n')
+ .map(str => str.trim())
+ .join(' ');
+};
+
+/**
+ * Map %O to `util.inspect()`, allowing multiple lines if needed.
+ */
+
+formatters.O = function (v) {
+ this.inspectOpts.colors = this.useColors;
+ return util.inspect(v, this.inspectOpts);
+};
diff --git a/node_modules/streamroller/package.json b/node_modules/streamroller/package.json
index 38345f4..dfebf75 100644
--- a/node_modules/streamroller/package.json
+++ b/node_modules/streamroller/package.json
@@ -1,8 +1,12 @@
{
"name": "streamroller",
- "version": "2.2.4",
+ "version": "3.0.7",
"description": "file streams that roll over when size limits, or dates are reached",
"main": "lib/index.js",
+ "files": [
+ "lib",
+ "CHANGELOG.md"
+ ],
"directories": {
"test": "test"
},
@@ -11,7 +15,7 @@
"prepublishOnly": "npm test",
"pretest": "npm run codecheck",
"clean": "rm -rf node_modules/",
- "test": "nyc --check-coverage --lines 100 --branches 100 --functions 100 mocha",
+ "test": "nyc --check-coverage mocha",
"html-report": "nyc report --reporter=html"
},
"repository": {
@@ -27,19 +31,20 @@
"readmeFilename": "README.md",
"gitHead": "ece35d7d86c87c04ff09e8604accae81cf36a0ce",
"devDependencies": {
- "@commitlint/cli": "^8.1.0",
- "@commitlint/config-conventional": "^8.1.0",
- "eslint": "^6.0.1",
- "husky": "^3.0.0",
- "mocha": "^6.1.4",
- "nyc": "^14.1.1",
- "proxyquire": "^2.1.1",
+ "@commitlint/cli": "^16.2.3",
+ "@commitlint/config-conventional": "^16.2.1",
+ "@types/node": "^17.0.24",
+ "eslint": "^8.13.0",
+ "husky": "^7.0.4",
+ "mocha": "^9.2.2",
+ "nyc": "^15.1.0",
+ "proxyquire": "^2.1.3",
"should": "^13.2.3"
},
"dependencies": {
- "date-format": "^2.1.0",
- "debug": "^4.1.1",
- "fs-extra": "^8.1.0"
+ "date-format": "^4.0.7",
+ "debug": "^4.3.4",
+ "fs-extra": "^10.0.1"
},
"engines": {
"node": ">=8.0"
@@ -57,7 +62,7 @@
"mocha": true
},
"parserOptions": {
- "ecmaVersion": 8
+ "ecmaVersion": 2018
},
"extends": "eslint:recommended",
"rules": {
@@ -68,5 +73,13 @@
"hooks": {
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS"
}
+ },
+ "nyc": {
+ "include": [
+ "lib/**"
+ ],
+ "branches": 100,
+ "lines": 100,
+ "functions": 100
}
}
diff --git a/node_modules/streamroller/test/DateRollingFileStream-test.js b/node_modules/streamroller/test/DateRollingFileStream-test.js
deleted file mode 100644
index 8d98e6b..0000000
--- a/node_modules/streamroller/test/DateRollingFileStream-test.js
+++ /dev/null
@@ -1,560 +0,0 @@
-require("should");
-
-const fs = require("fs-extra"),
- path = require("path"),
- zlib = require("zlib"),
- proxyquire = require("proxyquire").noPreserveCache(),
- util = require("util"),
- streams = require("stream");
-
-let fakeNow = new Date(2012, 8, 12, 10, 37, 11);
-const mockNow = () => fakeNow;
-const RollingFileWriteStream = proxyquire("../lib/RollingFileWriteStream", {
- "./now": mockNow
-});
-const DateRollingFileStream = proxyquire("../lib/DateRollingFileStream", {
- "./RollingFileWriteStream": RollingFileWriteStream
-});
-
-const gunzip = util.promisify(zlib.gunzip);
-const gzip = util.promisify(zlib.gzip);
-const remove = filename => fs.unlink(filename).catch(() => {});
-const close = async (stream) => new Promise(
- (resolve, reject) => stream.end(e => e ? reject(e) : resolve())
-);
-
-describe("DateRollingFileStream", function() {
- describe("arguments", function() {
- let stream;
-
- before(function() {
- stream = new DateRollingFileStream(
- path.join(__dirname, "test-date-rolling-file-stream-1"),
- "yyyy-MM-dd.hh"
- );
- });
-
- after(async function() {
- await close(stream);
- await remove(path.join(__dirname, "test-date-rolling-file-stream-1"));
- });
-
- it("should take a filename and a pattern and return a WritableStream", function() {
- stream.filename.should.eql(
- path.join(__dirname, "test-date-rolling-file-stream-1")
- );
- stream.options.pattern.should.eql("yyyy-MM-dd.hh");
- stream.should.be.instanceOf(streams.Writable);
- });
-
- it("with default settings for the underlying stream", function() {
- stream.currentFileStream.mode.should.eql(420);
- stream.currentFileStream.flags.should.eql("a");
- });
- });
-
- describe("default arguments", function() {
- var stream;
-
- before(function() {
- stream = new DateRollingFileStream(
- path.join(__dirname, "test-date-rolling-file-stream-2")
- );
- });
-
- after(async function() {
- await close(stream);
- await remove(path.join(__dirname, "test-date-rolling-file-stream-2"));
- });
-
- it("should have pattern of .yyyy-MM-dd", function() {
- stream.options.pattern.should.eql("yyyy-MM-dd");
- });
- });
-
- describe("with stream arguments", function() {
- var stream;
-
- before(function() {
- stream = new DateRollingFileStream(
- path.join(__dirname, "test-date-rolling-file-stream-3"),
- "yyyy-MM-dd",
- { mode: parseInt("0666", 8) }
- );
- });
-
- after(async function() {
- await close(stream);
- await remove(path.join(__dirname, "test-date-rolling-file-stream-3"));
- });
-
- it("should pass them to the underlying stream", function() {
- stream.theStream.mode.should.eql(parseInt("0666", 8));
- });
- });
-
- describe("with stream arguments but no pattern", function() {
- var stream;
-
- before(function() {
- stream = new DateRollingFileStream(
- path.join(__dirname, "test-date-rolling-file-stream-4"),
- { mode: parseInt("0666", 8) }
- );
- });
-
- after(async function() {
- await close(stream);
- await remove(path.join(__dirname, "test-date-rolling-file-stream-4"));
- });
-
- it("should pass them to the underlying stream", function() {
- stream.theStream.mode.should.eql(parseInt("0666", 8));
- });
-
- it("should use default pattern", function() {
- stream.options.pattern.should.eql("yyyy-MM-dd");
- });
- });
-
- describe("with a pattern of .yyyy-MM-dd", function() {
- var stream;
-
- before(function(done) {
- stream = new DateRollingFileStream(
- path.join(__dirname, "test-date-rolling-file-stream-5"),
- ".yyyy-MM-dd",
- null
- );
- stream.write("First message\n", "utf8", done);
- });
-
- after(async function() {
- await close(stream);
- await remove(path.join(__dirname, "test-date-rolling-file-stream-5"));
- });
-
- it("should create a file with the base name", async function() {
- const contents = await fs.readFile(
- path.join(__dirname, "test-date-rolling-file-stream-5"),
- "utf8"
- );
- contents.should.eql("First message\n");
- });
-
- describe("when the day changes", function() {
- before(function(done) {
- fakeNow = new Date(2012, 8, 13, 0, 10, 12);
- stream.write("Second message\n", "utf8", done);
- });
-
- after(async function() {
- await remove(
- path.join(__dirname, "test-date-rolling-file-stream-5.2012-09-12")
- );
- });
-
- describe("the number of files", function() {
- it("should be two", async function() {
- const files = await fs.readdir(__dirname);
- files
- .filter(
- file => file.indexOf("test-date-rolling-file-stream-5") > -1
- )
- .should.have.length(2);
- });
- });
-
- describe("the file without a date", function() {
- it("should contain the second message", async function() {
- const contents = await fs.readFile(
- path.join(__dirname, "test-date-rolling-file-stream-5"),
- "utf8"
- );
- contents.should.eql("Second message\n");
- });
- });
-
- describe("the file with the date", function() {
- it("should contain the first message", async function() {
- const contents = await fs.readFile(
- path.join(__dirname, "test-date-rolling-file-stream-5.2012-09-12"),
- "utf8"
- );
- contents.should.eql("First message\n");
- });
- });
- });
- });
-
- describe("with alwaysIncludePattern", function() {
- var stream;
-
- before(async function() {
- fakeNow = new Date(2012, 8, 12, 11, 10, 12);
- await remove(
- path.join(
- __dirname,
- "test-date-rolling-file-stream-pattern.2012-09-12-11.log"
- )
- );
- stream = new DateRollingFileStream(
- path.join(__dirname, "test-date-rolling-file-stream-pattern"),
- ".yyyy-MM-dd-hh.log",
- { alwaysIncludePattern: true }
- );
-
- await new Promise(resolve => {
- setTimeout(function() {
- stream.write("First message\n", "utf8", () => resolve());
- }, 50);
- });
- });
-
- after(async function() {
- await close(stream);
- await remove(
- path.join(
- __dirname,
- "test-date-rolling-file-stream-pattern.2012-09-12-11.log"
- )
- );
- });
-
- it("should create a file with the pattern set", async function() {
- const contents = await fs.readFile(
- path.join(
- __dirname,
- "test-date-rolling-file-stream-pattern.2012-09-12-11.log"
- ),
- "utf8"
- );
- contents.should.eql("First message\n");
- });
-
- describe("when the day changes", function() {
- before(function(done) {
- fakeNow = new Date(2012, 8, 12, 12, 10, 12);
- stream.write("Second message\n", "utf8", done);
- });
-
- after(async function() {
- await remove(
- path.join(
- __dirname,
- "test-date-rolling-file-stream-pattern.2012-09-12-12.log"
- )
- );
- });
-
- describe("the number of files", function() {
- it("should be two", async function() {
- const files = await fs.readdir(__dirname);
- files
- .filter(
- file => file.indexOf("test-date-rolling-file-stream-pattern") > -1
- )
- .should.have.length(2);
- });
- });
-
- describe("the file with the later date", function() {
- it("should contain the second message", async function() {
- const contents = await fs.readFile(
- path.join(
- __dirname,
- "test-date-rolling-file-stream-pattern.2012-09-12-12.log"
- ),
- "utf8"
- );
- contents.should.eql("Second message\n");
- });
- });
-
- describe("the file with the date", function() {
- it("should contain the first message", async function() {
- const contents = await fs.readFile(
- path.join(
- __dirname,
- "test-date-rolling-file-stream-pattern.2012-09-12-11.log"
- ),
- "utf8"
- );
- contents.should.eql("First message\n");
- });
- });
- });
- });
-
- describe("with a pattern that evaluates to digits", function() {
- let stream;
- before(done => {
- fakeNow = new Date(2012, 8, 12, 0, 10, 12);
- stream = new DateRollingFileStream(
- path.join(__dirname, "digits.log"),
- ".yyyyMMdd"
- );
- stream.write("First message\n", "utf8", done);
- });
-
- describe("when the day changes", function() {
- before(function(done) {
- fakeNow = new Date(2012, 8, 13, 0, 10, 12);
- stream.write("Second message\n", "utf8", done);
- });
-
- it("should be two files (it should not get confused by indexes)", async function() {
- const files = await fs.readdir(__dirname);
- var logFiles = files.filter(file => file.indexOf("digits.log") > -1);
- logFiles.should.have.length(2);
-
- const contents = await fs.readFile(
- path.join(__dirname, "digits.log.20120912"),
- "utf8"
- );
- contents.should.eql("First message\n");
- const c = await fs.readFile(path.join(__dirname, "digits.log"), "utf8");
- c.should.eql("Second message\n");
- });
- });
-
- after(async function() {
- await close(stream);
- await remove(path.join(__dirname, "digits.log"));
- await remove(path.join(__dirname, "digits.log.20120912"));
- });
- });
-
- describe("with compress option", function() {
- var stream;
-
- before(function(done) {
- fakeNow = new Date(2012, 8, 12, 0, 10, 12);
- stream = new DateRollingFileStream(
- path.join(__dirname, "compressed.log"),
- ".yyyy-MM-dd",
- { compress: true }
- );
- stream.write("First message\n", "utf8", done);
- });
-
- describe("when the day changes", function() {
- before(function(done) {
- fakeNow = new Date(2012, 8, 13, 0, 10, 12);
- stream.write("Second message\n", "utf8", done);
- });
-
- it("should be two files, one compressed", async function() {
- const files = await fs.readdir(__dirname);
- var logFiles = files.filter(
- file => file.indexOf("compressed.log") > -1
- );
- logFiles.should.have.length(2);
-
- const gzipped = await fs.readFile(
- path.join(__dirname, "compressed.log.2012-09-12.gz")
- );
- const contents = await gunzip(gzipped);
- contents.toString("utf8").should.eql("First message\n");
-
- (await fs.readFile(
- path.join(__dirname, "compressed.log"),
- "utf8"
- )).should.eql("Second message\n");
- });
- });
-
- after(async function() {
- await close(stream);
- await remove(path.join(__dirname, "compressed.log"));
- await remove(path.join(__dirname, "compressed.log.2012-09-12.gz"));
- });
- });
-
- describe("with keepFileExt option", function() {
- var stream;
-
- before(function(done) {
- fakeNow = new Date(2012, 8, 12, 0, 10, 12);
- stream = new DateRollingFileStream(
- path.join(__dirname, "keepFileExt.log"),
- ".yyyy-MM-dd",
- { keepFileExt: true }
- );
- stream.write("First message\n", "utf8", done);
- });
-
- describe("when the day changes", function() {
- before(function(done) {
- fakeNow = new Date(2012, 8, 13, 0, 10, 12);
- stream.write("Second message\n", "utf8", done);
- });
-
- it("should be two files", async function() {
- const files = await fs.readdir(__dirname);
- var logFiles = files.filter(file => file.indexOf("keepFileExt") > -1);
- logFiles.should.have.length(2);
-
- (await fs.readFile(
- path.join(__dirname, "keepFileExt.2012-09-12.log"),
- "utf8"
- )).should.eql("First message\n");
- (await fs.readFile(
- path.join(__dirname, "keepFileExt.log"),
- "utf8"
- )).should.eql("Second message\n");
- });
- });
-
- after(async function() {
- await close(stream);
- await remove(path.join(__dirname, "keepFileExt.log"));
- await remove(path.join(__dirname, "keepFileExt.2012-09-12.log"));
- });
- });
-
- describe("with compress option and keepFileExt option", function() {
- var stream;
-
- before(function(done) {
- fakeNow = new Date(2012, 8, 12, 0, 10, 12);
- stream = new DateRollingFileStream(
- path.join(__dirname, "compressedAndKeepExt.log"),
- ".yyyy-MM-dd",
- { compress: true, keepFileExt: true }
- );
- stream.write("First message\n", "utf8", done);
- });
-
- describe("when the day changes", function() {
- before(function(done) {
- fakeNow = new Date(2012, 8, 13, 0, 10, 12);
- stream.write("Second message\n", "utf8", done);
- });
-
- it("should be two files, one compressed", async function() {
- const files = await fs.readdir(__dirname);
- var logFiles = files.filter(
- file => file.indexOf("compressedAndKeepExt") > -1
- );
- logFiles.should.have.length(2);
-
- const gzipped = await fs.readFile(
- path.join(__dirname, "compressedAndKeepExt.2012-09-12.log.gz")
- );
- const contents = await gunzip(gzipped);
- contents.toString("utf8").should.eql("First message\n");
- (await fs.readFile(
- path.join(__dirname, "compressedAndKeepExt.log"),
- "utf8"
- )).should.eql("Second message\n");
- });
- });
-
- after(async function() {
- await close(stream);
- await remove(path.join(__dirname, "compressedAndKeepExt.log"));
- await remove(
- path.join(__dirname, "compressedAndKeepExt.2012-09-12.log.gz")
- );
- });
- });
-
- describe("with daysToKeep option", function() {
- let stream;
- var daysToKeep = 4;
- var numOriginalLogs = 10;
-
- before(async function() {
- for (let i = 0; i < numOriginalLogs; i += 1) {
- await fs.writeFile(
- path.join(__dirname, `daysToKeep.log.2012-09-${20-i}`),
- `Message on day ${i}\n`,
- { encoding: "utf-8" }
- );
- }
- stream = new DateRollingFileStream(
- path.join(__dirname, "daysToKeep.log"),
- ".yyyy-MM-dd",
- {
- alwaysIncludePattern: true,
- daysToKeep: daysToKeep
- }
- );
- });
-
- describe("when the day changes", function() {
- before(function(done) {
- fakeNow = new Date(2012, 8, 21, 0, 10, 12);
- stream.write("Second message\n", "utf8", done);
- });
-
- it("should be daysToKeep + 1 files left from numOriginalLogs", async function() {
- const files = await fs.readdir(__dirname);
- var logFiles = files.filter(
- file => file.indexOf("daysToKeep.log") > -1
- );
- logFiles.should.have.length(daysToKeep + 1);
- });
- });
-
- after(async function() {
- await close(stream);
- const files = await fs.readdir(__dirname);
- const logFiles = files
- .filter(file => file.indexOf("daysToKeep.log") > -1)
- .map(f => remove(path.join(__dirname, f)));
- await Promise.all(logFiles);
- });
- });
-
- describe("with daysToKeep and compress options", function() {
- let stream;
- const daysToKeep = 4;
- const numOriginalLogs = 10;
-
- before(async function() {
- for (let i = numOriginalLogs; i >= 0; i -= 1) {
- fakeNow = new Date(2012, 8, 20 - i, 0, 10, 12);
- const contents = await gzip(`Message on day ${i}\n`);
- await fs.writeFile(
- path.join(__dirname, `compressedDaysToKeep.log.2012-09-${20-i}.gz`),
- contents
- );
- }
- stream = new DateRollingFileStream(
- path.join(__dirname, "compressedDaysToKeep.log"),
- ".yyyy-MM-dd",
- {
- alwaysIncludePattern: true,
- compress: true,
- daysToKeep: daysToKeep
- }
- );
- });
-
- describe("when the day changes", function() {
- before(function(done) {
- fakeNow = new Date(2012, 8, 21, 0, 10, 12);
- stream.write("New file message\n", "utf8", done);
- });
-
- it("should be 4 files left from original 3", async function() {
- const files = await fs.readdir(__dirname);
- var logFiles = files.filter(
- file => file.indexOf("compressedDaysToKeep.log") > -1
- );
- logFiles.should.have.length(daysToKeep + 1);
- });
- });
-
- after(async function() {
- await close(stream);
- const files = await fs.readdir(__dirname);
- const logFiles = files
- .filter(file => file.indexOf("compressedDaysToKeep.log") > -1)
- .map(f => remove(path.join(__dirname, f)));
- await Promise.all(logFiles);
- });
- });
-});
diff --git a/node_modules/streamroller/test/RollingFileStream-test.js b/node_modules/streamroller/test/RollingFileStream-test.js
deleted file mode 100644
index c08f4dd..0000000
--- a/node_modules/streamroller/test/RollingFileStream-test.js
+++ /dev/null
@@ -1,451 +0,0 @@
-require("should");
-
-const fs = require("fs-extra"),
- path = require("path"),
- util = require("util"),
- zlib = require("zlib"),
- streams = require("stream"),
- RollingFileStream = require("../lib").RollingFileStream;
-
-const gunzip = util.promisify(zlib.gunzip);
-const fullPath = f => path.join(__dirname, f);
-const remove = filename => fs.unlink(fullPath(filename)).catch(() => {});
-const create = filename => fs.writeFile(fullPath(filename), "test file");
-
-const write = (stream, data) => {
- return new Promise((resolve, reject) => {
- stream.write(data, "utf8", e => {
- if (e) {
- reject(e);
- } else {
- resolve();
- }
- });
- });
-};
-
-const writeInSequence = async (stream, messages) => {
- for (let i = 0; i < messages.length; i += 1) {
- await write(stream, messages[i] + "\n");
- }
- return new Promise(resolve => {
- stream.end(resolve);
- });
-};
-
-const close = async (stream) => new Promise(
- (resolve, reject) => stream.end(e => e ? reject(e) : resolve())
-);
-
-describe("RollingFileStream", function() {
- describe("arguments", function() {
- let stream;
-
- before(async function() {
- await remove("test-rolling-file-stream");
- stream = new RollingFileStream(
- path.join(__dirname, "test-rolling-file-stream"),
- 1024,
- 5
- );
- });
-
- after(async function() {
- await close(stream);
- await remove("test-rolling-file-stream");
- });
-
- it("should take a filename, file size (bytes), no. backups, return Writable", function() {
- stream.should.be.an.instanceOf(streams.Writable);
- stream.filename.should.eql(
- path.join(__dirname, "test-rolling-file-stream")
- );
- stream.size.should.eql(1024);
- stream.backups.should.eql(5);
- });
-
- it("should apply default settings to the underlying stream", function() {
- stream.theStream.mode.should.eql(420);
- stream.theStream.flags.should.eql("a");
- });
- });
-
- describe("with stream arguments", function() {
- let stream;
- it("should pass them to the underlying stream", function() {
- stream = new RollingFileStream(
- path.join(__dirname, "test-rolling-file-stream"),
- 1024,
- 5,
- { mode: parseInt("0666", 8) }
- );
- stream.theStream.mode.should.eql(parseInt("0666", 8));
- });
-
- after(async function() {
- await close(stream);
- await remove("test-rolling-file-stream");
- });
- });
-
- describe("without size", function() {
- let stream;
- it("should default to max int size", function() {
- stream = new RollingFileStream(
- path.join(__dirname, "test-rolling-file-stream")
- );
- stream.size.should.eql(Number.MAX_SAFE_INTEGER);
- });
-
- after(async function() {
- await close(stream);
- await remove("test-rolling-file-stream");
- });
- });
-
- describe("without number of backups", function() {
- let stream;
- it("should default to 1 backup", function() {
- stream = new RollingFileStream(
- path.join(__dirname, "test-rolling-file-stream"),
- 1024
- );
- stream.backups.should.eql(1);
- });
-
- after(async function() {
- await close(stream);
- await remove("test-rolling-file-stream");
- });
- });
-
- describe("writing less than the file size", function() {
- before(async function() {
- await remove("test-rolling-file-stream-write-less");
- const stream = new RollingFileStream(
- path.join(__dirname, "test-rolling-file-stream-write-less"),
- 100
- );
- await writeInSequence(stream, ["cheese"]);
- });
-
- after(async function() {
- await remove("test-rolling-file-stream-write-less");
- });
-
- it("should write to the file", async function() {
- const contents = await fs.readFile(
- path.join(__dirname, "test-rolling-file-stream-write-less"),
- "utf8"
- );
- contents.should.eql("cheese\n");
- });
-
- it("should write one file", async function() {
- const files = await fs.readdir(__dirname);
- files
- .filter(
- file => file.indexOf("test-rolling-file-stream-write-less") > -1
- )
- .should.have.length(1);
- });
- });
-
- describe("writing more than the file size", function() {
- before(async function() {
- await remove("test-rolling-file-stream-write-more");
- await remove("test-rolling-file-stream-write-more.1");
- const stream = new RollingFileStream(
- path.join(__dirname, "test-rolling-file-stream-write-more"),
- 45
- );
- await writeInSequence(
- stream,
- [0, 1, 2, 3, 4, 5, 6].map(i => i + ".cheese")
- );
- });
-
- after(async function() {
- await remove("test-rolling-file-stream-write-more");
- await remove("test-rolling-file-stream-write-more.1");
- });
-
- it("should write two files", async function() {
- const files = await fs.readdir(__dirname);
- files
- .filter(
- file => file.indexOf("test-rolling-file-stream-write-more") > -1
- )
- .should.have.length(2);
- });
-
- it("should write the last two log messages to the first file", async function() {
- const contents = await fs.readFile(
- path.join(__dirname, "test-rolling-file-stream-write-more"),
- "utf8"
- );
- contents.should.eql("5.cheese\n6.cheese\n");
- });
-
- it("should write the first five log messages to the second file", async function() {
- const contents = await fs.readFile(
- path.join(__dirname, "test-rolling-file-stream-write-more.1"),
- "utf8"
- );
- contents.should.eql("0.cheese\n1.cheese\n2.cheese\n3.cheese\n4.cheese\n");
- });
- });
-
- describe("with options.compress = true", function() {
- before(async function() {
- const stream = new RollingFileStream(
- path.join(__dirname, "compressed-backups.log"),
- 30, //30 bytes max size
- 2, //two backup files to keep
- { compress: true }
- );
- const messages = [
- "This is the first log message.",
- "This is the second log message.",
- "This is the third log message.",
- "This is the fourth log message."
- ];
- await writeInSequence(stream, messages);
- });
-
- it("should produce three files, with the backups compressed", async function() {
- const files = await fs.readdir(__dirname);
- const testFiles = files
- .filter(f => f.indexOf("compressed-backups.log") > -1)
- .sort();
-
- testFiles.length.should.eql(3);
- testFiles.should.eql([
- "compressed-backups.log",
- "compressed-backups.log.1.gz",
- "compressed-backups.log.2.gz"
- ]);
-
- let contents = await fs.readFile(
- path.join(__dirname, testFiles[0]),
- "utf8"
- );
- contents.should.eql("This is the fourth log message.\n");
-
- let gzipped = await fs.readFile(path.join(__dirname, testFiles[1]));
- contents = await gunzip(gzipped);
- contents.toString("utf8").should.eql("This is the third log message.\n");
-
- gzipped = await fs.readFile(path.join(__dirname, testFiles[2]));
- contents = await gunzip(gzipped);
- contents.toString("utf8").should.eql("This is the second log message.\n");
- });
-
- after(function() {
- return Promise.all([
- remove("compressed-backups.log"),
- remove("compressed-backups.log.1.gz"),
- remove("compressed-backups.log.2.gz")
- ]);
- });
- });
-
- describe("with options.keepFileExt = true", function() {
- before(async function() {
- const stream = new RollingFileStream(
- path.join(__dirname, "extKept-backups.log"),
- 30, //30 bytes max size
- 2, //two backup files to keep
- { keepFileExt: true }
- );
- const messages = [
- "This is the first log message.",
- "This is the second log message.",
- "This is the third log message.",
- "This is the fourth log message."
- ];
- await writeInSequence(stream, messages);
- });
-
- it("should produce three files, with the file-extension kept", async function() {
- const files = await fs.readdir(__dirname);
- const testFiles = files
- .filter(f => f.indexOf("extKept-backups") > -1)
- .sort();
-
- testFiles.length.should.eql(3);
- testFiles.should.eql([
- "extKept-backups.1.log",
- "extKept-backups.2.log",
- "extKept-backups.log"
- ]);
-
- let contents = await fs.readFile(
- path.join(__dirname, testFiles[0]),
- "utf8"
- );
- contents.should.eql("This is the third log message.\n");
-
- contents = await fs.readFile(path.join(__dirname, testFiles[1]), "utf8");
- contents.toString("utf8").should.eql("This is the second log message.\n");
- contents = await fs.readFile(path.join(__dirname, testFiles[2]), "utf8");
- contents.toString("utf8").should.eql("This is the fourth log message.\n");
- });
-
- after(function() {
- return Promise.all([
- remove("extKept-backups.log"),
- remove("extKept-backups.1.log"),
- remove("extKept-backups.2.log")
- ]);
- });
- });
-
- describe("with options.compress = true and keepFileExt = true", function() {
- before(async function() {
- const stream = new RollingFileStream(
- path.join(__dirname, "compressed-backups.log"),
- 30, //30 bytes max size
- 2, //two backup files to keep
- { compress: true, keepFileExt: true }
- );
- const messages = [
- "This is the first log message.",
- "This is the second log message.",
- "This is the third log message.",
- "This is the fourth log message."
- ];
- await writeInSequence(stream, messages);
- });
-
- it("should produce three files, with the backups compressed", async function() {
- const files = await fs.readdir(__dirname);
- const testFiles = files
- .filter(f => f.indexOf("compressed-backups") > -1)
- .sort();
-
- testFiles.length.should.eql(3);
- testFiles.should.eql([
- "compressed-backups.1.log.gz",
- "compressed-backups.2.log.gz",
- "compressed-backups.log"
- ]);
-
- let contents = await fs.readFile(
- path.join(__dirname, testFiles[2]),
- "utf8"
- );
- contents.should.eql("This is the fourth log message.\n");
-
- let gzipped = await fs.readFile(path.join(__dirname, testFiles[1]));
- contents = await gunzip(gzipped);
- contents.toString("utf8").should.eql("This is the second log message.\n");
- gzipped = await fs.readFile(path.join(__dirname, testFiles[0]));
- contents = await gunzip(gzipped);
- contents.toString("utf8").should.eql("This is the third log message.\n");
- });
-
- after(function() {
- return Promise.all([
- remove("compressed-backups.log"),
- remove("compressed-backups.1.log.gz"),
- remove("compressed-backups.2.log.gz")
- ]);
- });
- });
-
- describe("when many files already exist", function() {
- before(async function() {
- await Promise.all([
- remove("test-rolling-stream-with-existing-files.11"),
- remove("test-rolling-stream-with-existing-files.20"),
- remove("test-rolling-stream-with-existing-files.-1"),
- remove("test-rolling-stream-with-existing-files.1.1"),
- remove("test-rolling-stream-with-existing-files.1")
- ]);
- await Promise.all([
- create("test-rolling-stream-with-existing-files.11"),
- create("test-rolling-stream-with-existing-files.20"),
- create("test-rolling-stream-with-existing-files.-1"),
- create("test-rolling-stream-with-existing-files.1.1"),
- create("test-rolling-stream-with-existing-files.1")
- ]);
-
- const stream = new RollingFileStream(
- path.join(__dirname, "test-rolling-stream-with-existing-files"),
- 18,
- 5
- );
-
- await writeInSequence(
- stream,
- [0, 1, 2, 3, 4, 5, 6].map(i => i + ".cheese")
- );
- });
-
- after(function() {
- return Promise.all(
- [
- "test-rolling-stream-with-existing-files.-1",
- "test-rolling-stream-with-existing-files",
- "test-rolling-stream-with-existing-files.1.1",
- "test-rolling-stream-with-existing-files.0",
- "test-rolling-stream-with-existing-files.1",
- "test-rolling-stream-with-existing-files.2",
- "test-rolling-stream-with-existing-files.3",
- "test-rolling-stream-with-existing-files.4",
- "test-rolling-stream-with-existing-files.5",
- "test-rolling-stream-with-existing-files.6",
- "test-rolling-stream-with-existing-files.11",
- "test-rolling-stream-with-existing-files.20"
- ].map(remove)
- );
- });
-
- it("should roll the files, removing the highest indices", async function() {
- const files = await fs.readdir(__dirname);
- files.should.containEql("test-rolling-stream-with-existing-files");
- files.should.containEql("test-rolling-stream-with-existing-files.1");
- files.should.containEql("test-rolling-stream-with-existing-files.2");
- files.should.containEql("test-rolling-stream-with-existing-files.3");
- files.should.containEql("test-rolling-stream-with-existing-files.4");
- });
- });
-
- // in windows, you can't delete a directory if there is an open file handle
- if (process.platform !== "win32") {
-
- describe("when the directory gets deleted", function() {
- var stream;
- before(function(done) {
- stream = new RollingFileStream(
- path.join("subdir", "test-rolling-file-stream"),
- 5,
- 5
- );
- stream.write("initial", "utf8", done);
- });
-
- after(async () => {
- await fs.unlink(path.join("subdir", "test-rolling-file-stream"));
- await fs.rmdir("subdir");
- });
-
- it("handles directory deletion gracefully", async function() {
- stream.theStream.on("error", e => {
- throw e;
- });
-
- await fs.unlink(path.join("subdir", "test-rolling-file-stream"));
- await fs.rmdir("subdir");
- await new Promise(resolve => stream.write("rollover", "utf8", resolve));
- await close(stream);
- (await fs.readFile(
- path.join("subdir", "test-rolling-file-stream"),
- "utf8"
- )).should.eql("rollover");
- });
- });
-}
-
-});
diff --git a/node_modules/streamroller/test/RollingFileWriteStream-test.js b/node_modules/streamroller/test/RollingFileWriteStream-test.js
deleted file mode 100644
index b90f091..0000000
--- a/node_modules/streamroller/test/RollingFileWriteStream-test.js
+++ /dev/null
@@ -1,1441 +0,0 @@
-require("should");
-
-const path = require("path");
-const zlib = require("zlib");
-const stream = require("stream");
-const fs = require("fs-extra");
-const proxyquire = require("proxyquire").noPreserveCache();
-
-let fakeNow = new Date(2012, 8, 12, 10, 37, 11);
-const mockNow = () => fakeNow;
-const RollingFileWriteStream = proxyquire("../lib/RollingFileWriteStream", {
- "./now": mockNow
-});
-let fakedFsDate = fakeNow;
-const mockFs = require("fs-extra");
-const oldStatSync = mockFs.statSync;
-mockFs.statSync = fd => {
- const result = oldStatSync(fd);
- result.mtime = fakedFsDate;
- return result;
-};
-
-function generateTestFile(fileName) {
- const dirName = path.join(
- __dirname,
- "tmp_" + Math.floor(Math.random() * new Date())
- );
- fileName = fileName || "ignored.log";
- const fileNameObj = path.parse(fileName);
- return {
- dir: dirName,
- base: fileNameObj.base,
- name: fileNameObj.name,
- ext: fileNameObj.ext,
- path: path.join(dirName, fileName)
- };
-}
-
-function resetTime() {
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- fakedFsDate = fakeNow;
-}
-
-describe("RollingFileWriteStream", () => {
- beforeEach(() => {
- resetTime();
- });
-
- after(() => {
- fs.readdirSync(__dirname)
- .filter(f => f.startsWith("tmp_"))
- .forEach(f => fs.removeSync(path.join(__dirname, f)));
- });
-
- describe("with no arguments", () => {
- it("should throw an error", () => {
- (() => new RollingFileWriteStream()).should.throw(
- /(the )?"?path"? (argument )?must be (a|of type) string\. received (type )?undefined/i
- );
- });
- });
-
- describe("with invalid options", () => {
- after(done => {
- fs.remove("filename", done);
- });
-
- it("should complain about a negative maxSize", () => {
- (() => {
- new RollingFileWriteStream("filename", { maxSize: -3 });
- }).should.throw("options.maxSize (-3) should be > 0");
- (() => {
- new RollingFileWriteStream("filename", { maxSize: 0 });
- }).should.throw("options.maxSize (0) should be > 0");
- });
-
- it("should complain about a negative numToKeep", () => {
- (() => {
- new RollingFileWriteStream("filename", { numToKeep: -3 });
- }).should.throw("options.numToKeep (-3) should be > 0");
- (() => {
- new RollingFileWriteStream("filename", { numToKeep: 0 });
- }).should.throw("options.numToKeep (0) should be > 0");
- });
- });
-
- describe("with default arguments", () => {
- const fileObj = generateTestFile();
- let s;
-
- before(() => {
- s = new RollingFileWriteStream(fileObj.path);
- });
-
- after(() => {
- s.end(() => fs.removeSync(fileObj.dir));
- });
-
- it("should take a filename and options, return Writable", () => {
- s.should.be.an.instanceOf(stream.Writable);
- s.currentFileStream.path.should.eql(fileObj.path);
- s.currentFileStream.mode.should.eql(420);
- s.currentFileStream.flags.should.eql("a");
- });
-
- it("should apply default options", () => {
- s.options.maxSize.should.eql(Number.MAX_SAFE_INTEGER);
- s.options.encoding.should.eql("utf8");
- s.options.mode.should.eql(420);
- s.options.flags.should.eql("a");
- s.options.compress.should.eql(false);
- s.options.keepFileExt.should.eql(false);
- });
- });
-
- describe("with 5 maxSize, rotating daily", () => {
- const fileObj = generateTestFile("noExtension");
- let s;
-
- before(async () => {
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- s = new RollingFileWriteStream(fileObj.path, {
- pattern: "yyyy-MM-dd",
- maxSize: 5
- });
- const flows = Array.from(Array(38).keys()).map(i => () => {
- fakeNow = new Date(2012, 8, 12 + parseInt(i / 5, 10), 10, 37, 11);
- return new Promise(resolve => {
- s.write(i.toString(), "utf8", () => resolve());
- });
- });
- for (let i = 0; i < flows.length; i += 1) {
- await flows[i]();
- }
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync(fileObj.dir);
- done();
- });
- });
-
- it("should rotate using filename with no extension", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [
- fileObj.base, //353637
- fileObj.base + ".2012-09-12.1", // 01234
- fileObj.base + ".2012-09-13.1", // 56789
- fileObj.base + ".2012-09-14.2", // 101112
- fileObj.base + ".2012-09-14.1", // 1314
- fileObj.base + ".2012-09-15.2", // 151617
- fileObj.base + ".2012-09-15.1", // 1819
- fileObj.base + ".2012-09-16.2", // 202122
- fileObj.base + ".2012-09-16.1", // 2324
- fileObj.base + ".2012-09-17.2", // 252627
- fileObj.base + ".2012-09-17.1", // 2829
- fileObj.base + ".2012-09-18.2", // 303132
- fileObj.base + ".2012-09-18.1" // 3334
- ];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
- fs.readFileSync(path.format(fileObj))
- .toString()
- .should.equal("353637");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-12.1"
- })
- )
- )
- .toString()
- .should.equal("01234");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-13.1"
- })
- )
- )
- .toString()
- .should.equal("56789");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-14.2"
- })
- )
- )
- .toString()
- .should.equal("101112");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-14.1"
- })
- )
- )
- .toString()
- .should.equal("1314");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-15.2"
- })
- )
- )
- .toString()
- .should.equal("151617");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-15.1"
- })
- )
- )
- .toString()
- .should.equal("1819");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-16.2"
- })
- )
- )
- .toString()
- .should.equal("202122");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-16.1"
- })
- )
- )
- .toString()
- .should.equal("2324");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-17.2"
- })
- )
- )
- .toString()
- .should.equal("252627");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-17.1"
- })
- )
- )
- .toString()
- .should.equal("2829");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-18.2"
- })
- )
- )
- .toString()
- .should.equal("303132");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-18.1"
- })
- )
- )
- .toString()
- .should.equal("3334");
- });
- });
-
- describe("with default arguments and recreated in the same day", () => {
- const fileObj = generateTestFile();
- let s;
-
- before(async () => {
- const flows = Array.from(Array(3).keys()).map(() => () => {
- s = new RollingFileWriteStream(fileObj.path);
- return new Promise(resolve => {
- s.end("abc", "utf8", () => resolve());
- });
- });
- for (let i = 0; i < flows.length; i += 1) {
- await flows[i]();
- }
- });
-
- after(() => {
- fs.removeSync(fileObj.dir);
- });
-
- it("should have only 1 file", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [fileObj.base];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base
- })
- )
- )
- .toString()
- .should.equal("abcabcabc");
- });
- });
-
- describe("with 5 maxSize, using filename with extension", () => {
- const fileObj = generateTestFile("withExtension.log");
- let s;
-
- before(async () => {
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- s = new RollingFileWriteStream(fileObj.path, {
- pattern: "yyyy-MM-dd",
- maxSize: 5
- });
- const flows = Array.from(Array(38).keys()).map(i => () => {
- fakeNow = new Date(2012, 8, 12 + parseInt(i / 10, 10), 10, 37, 11);
- return new Promise(resolve => {
- s.write(i.toString(), "utf8", () => resolve());
- });
- });
- for (let i = 0; i < flows.length; i += 1) {
- await flows[i]();
- }
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync(fileObj.dir);
- done();
- })
- });
-
- it("should rotate files within the day, and when the day changes", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [
- fileObj.base, //3637
- fileObj.base + ".2012-09-12.2", //01234
- fileObj.base + ".2012-09-12.1", //56789
- fileObj.base + ".2012-09-13.4", //101112
- fileObj.base + ".2012-09-13.3", //131415
- fileObj.base + ".2012-09-13.2", //161718
- fileObj.base + ".2012-09-13.1", //19
- fileObj.base + ".2012-09-14.4", //202122
- fileObj.base + ".2012-09-14.3", //232425
- fileObj.base + ".2012-09-14.2", //262728
- fileObj.base + ".2012-09-14.1", //29
- fileObj.base + ".2012-09-15.2", //303132
- fileObj.base + ".2012-09-15.1" //333435
- ];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
- fs.readFileSync(path.format(fileObj))
- .toString()
- .should.equal("3637");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-12.2"
- })
- )
- )
- .toString()
- .should.equal("01234");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-12.1"
- })
- )
- )
- .toString()
- .should.equal("56789");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-13.4"
- })
- )
- )
- .toString()
- .should.equal("101112");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-13.3"
- })
- )
- )
- .toString()
- .should.equal("131415");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-13.2"
- })
- )
- )
- .toString()
- .should.equal("161718");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-13.1"
- })
- )
- )
- .toString()
- .should.equal("19");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-14.4"
- })
- )
- )
- .toString()
- .should.equal("202122");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-14.3"
- })
- )
- )
- .toString()
- .should.equal("232425");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-14.2"
- })
- )
- )
- .toString()
- .should.equal("262728");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-14.1"
- })
- )
- )
- .toString()
- .should.equal("29");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-15.2"
- })
- )
- )
- .toString()
- .should.equal("303132");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-15.1"
- })
- )
- )
- .toString()
- .should.equal("333435");
- });
- });
-
- describe("with 5 maxSize and 3 files limit", () => {
- const fileObj = generateTestFile();
- let s;
-
- before(async () => {
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- s = new RollingFileWriteStream(fileObj.path, {
- maxSize: 5,
- numToKeep: 3
- });
- const flows = Array.from(Array(38).keys()).map(i => () => {
- fakeNow = new Date(2012, 8, 12 + parseInt(i / 5), 10, 37, 11);
- return new Promise(resolve => {
- s.write(i.toString(), "utf8", () => resolve());
- });
- });
- for (let i = 0; i < flows.length; i += 1) {
- await flows[i]();
- }
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync(fileObj.dir);
- done();
- });
- });
-
- it("should rotate with at most 3 backup files not including the hot one", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [
- fileObj.base,
- fileObj.base + ".1",
- fileObj.base + ".2",
- fileObj.base + ".3"
- ];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
- fs.readFileSync(path.format(fileObj))
- .toString()
- .should.equal("37");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".1"
- })
- )
- )
- .toString()
- .should.equal("343536");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2"
- })
- )
- )
- .toString()
- .should.equal("313233");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".3"
- })
- )
- )
- .toString()
- .should.equal("282930");
- });
- });
-
- describe("with 5 maxSize and 3 files limit, rotating daily", () => {
- const fileObj = generateTestFile();
- let s;
-
- before(async () => {
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- s = new RollingFileWriteStream(fileObj.path, {
- maxSize: 5,
- pattern: "yyyy-MM-dd",
- numToKeep: 3
- });
- const flows = Array.from(Array(38).keys()).map(i => () => {
- fakeNow = new Date(2012, 8, 12 + parseInt(i / 10), 10, 37, 11);
- return new Promise(resolve => {
- s.write(i.toString(), "utf8", () => resolve());
- });
- });
- for (let i = 0; i < flows.length; i += 1) {
- await flows[i]();
- }
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync(fileObj.dir);
- done();
- });
- });
-
- it("should rotate with at most 3 backup files not including the hot one", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [
- fileObj.base, //3637
- fileObj.base + ".2012-09-14.1", //29
- fileObj.base + ".2012-09-15.2", //303132
- fileObj.base + ".2012-09-15.1" //333435
- ];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
- fs.readFileSync(path.format(fileObj))
- .toString()
- .should.equal("3637");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-15.1"
- })
- )
- )
- .toString()
- .should.equal("333435");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-15.2"
- })
- )
- )
- .toString()
- .should.equal("303132");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-14.1"
- })
- )
- )
- .toString()
- .should.equal("29");
- });
- });
-
- describe("with date pattern dd-MM-yyyy", () => {
- const fileObj = generateTestFile();
- let s;
-
- before(async () => {
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- s = new RollingFileWriteStream(fileObj.path, {
- maxSize: 5,
- pattern: "dd-MM-yyyy"
- });
- const flows = Array.from(Array(8).keys()).map(i => () => {
- fakeNow = new Date(2012, 8, 12 + parseInt(i / 5, 10), 10, 37, 11);
- return new Promise(resolve => {
- s.write(i.toString(), "utf8", () => resolve());
- });
- });
- for (let i = 0; i < flows.length; i += 1) {
- await flows[i]();
- }
- });
-
- after(done => {
- s.end(() => {
- fs.remove(fileObj.dir, done);
- });
- });
-
- it("should rotate with date pattern dd-MM-yyyy in the file name", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [fileObj.base, fileObj.base + ".12-09-2012.1"];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
- fs.readFileSync(path.format(fileObj))
- .toString()
- .should.equal("567");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".12-09-2012.1"
- })
- )
- )
- .toString()
- .should.equal("01234");
- });
- });
-
- describe("with compress true", () => {
- const fileObj = generateTestFile();
- let s;
-
- before(async () => {
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- s = new RollingFileWriteStream(fileObj.path, {
- maxSize: 5,
- pattern: "yyyy-MM-dd",
- compress: true
- });
- const flows = Array.from(Array(8).keys()).map(i => () => {
- fakeNow = new Date(2012, 8, 12 + parseInt(i / 5, 10), 10, 37, 11);
- return new Promise(resolve => {
- s.write(i.toString(), "utf8", () => resolve());
- });
- });
- for (let i = 0; i < flows.length; i += 1) {
- await flows[i]();
- }
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync(fileObj.dir);
- done();
- });
- });
-
- it("should rotate with gunzip", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [
- fileObj.base,
- fileObj.base + ".2012-09-12.1.gz"
- ];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
-
- fs.readFileSync(path.format(fileObj))
- .toString()
- .should.equal("567");
- const content = fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.base + ".2012-09-12.1.gz"
- })
- )
- );
- zlib
- .gunzipSync(content)
- .toString()
- .should.equal("01234");
- });
- });
-
- describe("with keepFileExt", () => {
- const fileObj = generateTestFile("keepFileExt.log");
- let s;
-
- before(async () => {
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- s = new RollingFileWriteStream(fileObj.path, {
- pattern: "yyyy-MM-dd",
- maxSize: 5,
- keepFileExt: true
- });
- const flows = Array.from(Array(8).keys()).map(i => () => {
- fakeNow = new Date(2012, 8, 12 + parseInt(i / 5, 10), 10, 37, 11);
- return new Promise(resolve => {
- s.write(i.toString(), "utf8", () => resolve());
- });
- });
- for (let i = 0; i < flows.length; i += 1) {
- await flows[i]();
- }
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync(fileObj.dir);
- done();
- });
- });
-
- it("should rotate with the same extension", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [
- fileObj.base,
- fileObj.name + ".2012-09-12.1.log"
- ];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
-
- fs.readFileSync(path.format(fileObj))
- .toString()
- .should.equal("567");
- fs.readFileSync(
- path.format({
- dir: fileObj.dir,
- base: fileObj.name + ".2012-09-12.1" + fileObj.ext
- })
- )
- .toString()
- .should.equal("01234");
- });
- });
-
- describe("with keepFileExt and compress", () => {
- const fileObj = generateTestFile("keepFileExt.log");
- let s;
-
- before(async () => {
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- s = new RollingFileWriteStream(fileObj.path, {
- maxSize: 5,
- pattern: "yyyy-MM-dd",
- keepFileExt: true,
- compress: true
- });
- const flows = Array.from(Array(8).keys()).map(i => () => {
- fakeNow = new Date(2012, 8, 12 + parseInt(i / 5, 10), 10, 37, 11);
- return new Promise(resolve => {
- s.write(i.toString(), "utf8", () => resolve());
- });
- });
- for (let i = 0; i < flows.length; i += 1) {
- await flows[i]();
- }
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync(fileObj.dir);
- done();
- });
- });
-
- it("should rotate with the same extension", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [
- fileObj.base,
- fileObj.name + ".2012-09-12.1.log.gz"
- ];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
-
- fs.readFileSync(path.format(fileObj))
- .toString()
- .should.equal("567");
- const content = fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.name + ".2012-09-12.1.log.gz"
- })
- )
- );
- zlib
- .gunzipSync(content)
- .toString()
- .should.equal("01234");
- });
- });
-
- describe("with alwaysIncludePattern and keepFileExt", () => {
- const fileObj = generateTestFile("keepFileExt.log");
- let s;
-
- before(async () => {
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- s = new RollingFileWriteStream(fileObj.path, {
- maxSize: 5,
- pattern: "yyyy-MM-dd",
- keepFileExt: true,
- alwaysIncludePattern: true
- });
- const flows = Array.from(Array(8).keys()).map(i => () => {
- fakeNow = new Date(2012, 8, 12 + parseInt(i / 5, 10), 10, 37, 11);
- return new Promise(resolve => {
- s.write(i.toString(), "utf8", () => resolve());
- });
- });
- for (let i = 0; i < flows.length; i += 1) {
- await flows[i]();
- }
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync(fileObj.dir);
- done();
- });
- });
-
- it("should rotate with the same extension and keep date in the filename", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [
- fileObj.name + ".2012-09-12.1.log",
- fileObj.name + ".2012-09-13.log"
- ];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.name + ".2012-09-13.log"
- })
- )
- )
- .toString()
- .should.equal("567");
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.name + ".2012-09-12.1.log"
- })
- )
- )
- .toString()
- .should.equal("01234");
- });
- });
-
- describe("with 5 maxSize, compress, keepFileExt and alwaysIncludePattern", () => {
- const fileObj = generateTestFile("keepFileExt.log");
- let s;
-
- before(async () => {
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- s = new RollingFileWriteStream(fileObj.path, {
- maxSize: 5,
- compress: true,
- keepFileExt: true,
- alwaysIncludePattern: true,
- pattern: "yyyy-MM-dd"
- });
- const flows = Array.from(Array(38).keys()).map(i => () => {
- fakeNow = new Date(2012, 8, 12 + parseInt(i / 5, 10), 10, 37, 11);
- return new Promise(resolve => {
- s.write(i.toString(), "utf8", () => resolve());
- });
- });
- for (let i = 0; i < flows.length; i += 1) {
- await flows[i]();
- }
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync(fileObj.dir);
- done();
- });
- });
-
- it("should rotate every day", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [
- fileObj.name + ".2012-09-12.1.log.gz", //01234
- fileObj.name + ".2012-09-13.1.log.gz", //56789
- fileObj.name + ".2012-09-14.2.log.gz", //101112
- fileObj.name + ".2012-09-14.1.log.gz", //1314
- fileObj.name + ".2012-09-15.2.log.gz", //151617
- fileObj.name + ".2012-09-15.1.log.gz", //1819
- fileObj.name + ".2012-09-16.2.log.gz", //202122
- fileObj.name + ".2012-09-16.1.log.gz", //2324
- fileObj.name + ".2012-09-17.2.log.gz", //252627
- fileObj.name + ".2012-09-17.1.log.gz", //2829
- fileObj.name + ".2012-09-18.2.log.gz", //303132
- fileObj.name + ".2012-09-18.1.log.gz", //3334
- fileObj.name + ".2012-09-19.log" //353637
- ];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.name + ".2012-09-19.log"
- })
- )
- )
- .toString()
- .should.equal("353637");
- zlib
- .gunzipSync(
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.name + ".2012-09-18.1.log.gz"
- })
- )
- )
- )
- .toString()
- .should.equal("3334");
- zlib
- .gunzipSync(
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.name + ".2012-09-18.2.log.gz"
- })
- )
- )
- )
- .toString()
- .should.equal("303132");
- zlib
- .gunzipSync(
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.name + ".2012-09-17.1.log.gz"
- })
- )
- )
- )
- .toString()
- .should.equal("2829");
- zlib
- .gunzipSync(
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.name + ".2012-09-17.2.log.gz"
- })
- )
- )
- )
- .toString()
- .should.equal("252627");
- zlib
- .gunzipSync(
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.name + ".2012-09-16.1.log.gz"
- })
- )
- )
- )
- .toString()
- .should.equal("2324");
- zlib
- .gunzipSync(
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.name + ".2012-09-16.2.log.gz"
- })
- )
- )
- )
- .toString()
- .should.equal("202122");
- zlib
- .gunzipSync(
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.name + ".2012-09-15.1.log.gz"
- })
- )
- )
- )
- .toString()
- .should.equal("1819");
- zlib
- .gunzipSync(
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.name + ".2012-09-15.2.log.gz"
- })
- )
- )
- )
- .toString()
- .should.equal("151617");
- zlib
- .gunzipSync(
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.name + ".2012-09-14.1.log.gz"
- })
- )
- )
- )
- .toString()
- .should.equal("1314");
- zlib
- .gunzipSync(
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.name + ".2012-09-14.2.log.gz"
- })
- )
- )
- )
- .toString()
- .should.equal("101112");
- zlib
- .gunzipSync(
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.name + ".2012-09-13.1.log.gz"
- })
- )
- )
- )
- .toString()
- .should.equal("56789");
- zlib
- .gunzipSync(
- fs.readFileSync(
- path.format(
- Object.assign({}, fileObj, {
- base: fileObj.name + ".2012-09-12.1.log.gz"
- })
- )
- )
- )
- .toString()
- .should.equal("01234");
- });
- });
-
- describe("when old files exist", () => {
- const fileObj = generateTestFile();
- let s;
-
- before(done => {
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- fs.ensureFileSync(fileObj.path);
- fs.writeFileSync(fileObj.path, "exist");
- s = new RollingFileWriteStream(fileObj.path);
- s.write("now", "utf8", done);
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync(fileObj.dir);
- done();
- });
- });
-
- it("should use write in the old file if not reach the maxSize limit", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [fileObj.base];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
-
- fs.readFileSync(path.format(fileObj))
- .toString()
- .should.equal("existnow");
- });
- });
-
- describe("when old files exist with contents", () => {
- const fileObj = generateTestFile();
- let s;
-
- before(done => {
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- fs.ensureFileSync(fileObj.path);
- fs.writeFileSync(fileObj.path, "This is exactly 30 bytes long\n");
- s = new RollingFileWriteStream(fileObj.path, { maxSize: 35 });
- s.write("one\n", "utf8"); //34
- s.write("two\n", "utf8"); //38 - file should be rotated next time
- s.write("three\n", "utf8", done); // this should be in a new file.
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync(fileObj.dir);
- done();
- });
- });
-
- it("should respect the existing file size", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [fileObj.base, fileObj.base + ".1"];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
-
- fs.readFileSync(path.format(fileObj))
- .toString()
- .should.equal("three\n");
- fs.readFileSync(path.join(fileObj.dir, fileObj.base + ".1"))
- .toString()
- .should.equal("This is exactly 30 bytes long\none\ntwo\n");
- });
- });
-
- describe("when old files exist with contents and the flag is a+", () => {
- const fileObj = generateTestFile();
- let s;
-
- before(done => {
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- fs.ensureFileSync(fileObj.path);
- fs.writeFileSync(fileObj.path, "This is exactly 30 bytes long\n");
- s = new RollingFileWriteStream(fileObj.path, {
- maxSize: 35,
- flags: "a+"
- });
- s.write("one\n", "utf8"); //34
- s.write("two\n", "utf8"); //38 - file should be rotated next time
- s.write("three\n", "utf8", done); // this should be in a new file.
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync(fileObj.dir);
- done();
- });
- });
-
- it("should respect the existing file size", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [fileObj.base, fileObj.base + ".1"];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
-
- fs.readFileSync(path.format(fileObj))
- .toString()
- .should.equal("three\n");
- fs.readFileSync(path.join(fileObj.dir, fileObj.base + ".1"))
- .toString()
- .should.equal("This is exactly 30 bytes long\none\ntwo\n");
- });
- });
-
- describe("when old files exist with indices", () => {
- const fileObj = generateTestFile();
- let s;
-
- before(done => {
- fs.ensureFileSync(fileObj.path);
- fs.writeFileSync(
- fileObj.path,
- "This was the base file and it should be more than 30 bytes\n"
- ); // base
- fs.writeFileSync(fileObj.path + ".1", "This was the first old file\n"); // base.1
- s = new RollingFileWriteStream(fileObj.path, {
- maxSize: 30,
- numToKeep: 5
- });
- s.write("This is exactly 30 bytes long\n", "utf8"); // base.1 -> base.2, base -> base.1
- s.write("This is exactly 30 bytes long\n", "utf8"); // base.2 -> base.3, base.1 -> base.2, base -> base.1
- s.write("three\n", "utf8", done); // base.3 -> base.4, base.2 -> base.3, base.1 -> base.2, base -> base.1
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync(fileObj.dir);
- done();
- });
- });
-
- it("should rotate the old file indices", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [
- fileObj.base,
- fileObj.base + ".1",
- fileObj.base + ".2",
- fileObj.base + ".3",
- fileObj.base + ".4"
- ];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
-
- fs.readFileSync(path.format(fileObj))
- .toString()
- .should.equal("three\n");
- fs.readFileSync(path.join(fileObj.dir, fileObj.base + ".1"))
- .toString()
- .should.equal("This is exactly 30 bytes long\n");
- fs.readFileSync(path.join(fileObj.dir, fileObj.base + ".2"))
- .toString()
- .should.equal("This is exactly 30 bytes long\n");
- fs.readFileSync(path.join(fileObj.dir, fileObj.base + ".3"))
- .toString()
- .should.equal(
- "This was the base file and it should be more than 30 bytes\n"
- );
- fs.readFileSync(path.join(fileObj.dir, fileObj.base + ".4"))
- .toString()
- .should.equal("This was the first old file\n");
- });
- });
-
- describe("when old files exist with contents and rolling by date", () => {
- const fileObj = generateTestFile();
- let s;
-
- before(done => {
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- fs.ensureFileSync(fileObj.path);
- fs.writeFileSync(fileObj.path, "This was created Sept 12, 2012.\n");
- fakeNow = new Date(2012, 8, 13, 10, 53, 12);
- s = new RollingFileWriteStream(fileObj.path, { pattern: "yyyy-MM-dd" });
- s.write("It is now Sept 13, 2012.\n", "utf8", done); // this should be in a new file.
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync(fileObj.dir);
- done();
- });
- });
-
- it("should respect the existing file date", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [fileObj.base, fileObj.base + ".2012-09-12"];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
-
- fs.readFileSync(path.format(fileObj))
- .toString()
- .should.equal("It is now Sept 13, 2012.\n");
- fs.readFileSync(path.join(fileObj.dir, fileObj.base + ".2012-09-12"))
- .toString()
- .should.equal("This was created Sept 12, 2012.\n");
- });
- });
-
- describe("when old files exist with contents and stream created with overwrite flag", () => {
- const fileObj = generateTestFile();
- let s;
-
- before(done => {
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- fs.ensureFileSync(fileObj.path);
- fs.writeFileSync(fileObj.path, "This is exactly 30 bytes long\n");
- s = new RollingFileWriteStream(fileObj.path, { maxSize: 35, flags: "w" });
- s.write("there should only be this\n", "utf8", done);
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync(fileObj.dir);
- done();
- });
- });
-
- it("should ignore the existing file size", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [fileObj.base];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
-
- s.state.currentSize.should.equal(26);
-
- fs.readFileSync(path.format(fileObj))
- .toString()
- .should.equal("there should only be this\n");
- });
- });
-
- describe("when dir does not exist", () => {
- const fileObj = generateTestFile();
- let s;
-
- before(done => {
- fs.removeSync(fileObj.dir);
- fakeNow = new Date(2012, 8, 12, 10, 37, 11);
- s = new RollingFileWriteStream(fileObj.path);
- s.write("test", "utf8", done);
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync(fileObj.dir);
- done();
- });
- });
-
- it("should create the dir", () => {
- const files = fs.readdirSync(fileObj.dir);
- const expectedFileList = [fileObj.base];
- files.should.containDeep(expectedFileList);
- files.length.should.equal(expectedFileList.length);
-
- fs.readFileSync(path.format(fileObj))
- .toString()
- .should.equal("test");
- });
- });
-
- describe("when given just a base filename with no dir", () => {
- let s;
- before(done => {
- s = new RollingFileWriteStream("test.log");
- s.write("this should not cause any problems", "utf8", done);
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync("test.log");
- done();
- });
- });
-
- it("should use process.cwd() as the dir", () => {
- const files = fs.readdirSync(process.cwd());
- files.should.containDeep(["test.log"]);
-
- fs.readFileSync(path.join(process.cwd(), "test.log"))
- .toString()
- .should.equal("this should not cause any problems");
- });
- });
-
- describe("with no callback to write", () => {
- let s;
- before(done => {
- s = new RollingFileWriteStream("no-callback.log");
- s.write("this is all very nice", "utf8", done);
- });
-
- after(done => {
- fs.remove("no-callback.log", done);
- });
-
- it("should not complain", done => {
- s.write("I am not bothered if this succeeds or not");
- s.end(done);
- });
- });
-
- describe("events", () => {
- let s;
- before(done => {
- s = new RollingFileWriteStream("test-events.log");
- s.write("this should not cause any problems", "utf8", done);
- });
-
- after(done => {
- s.end(() => {
- fs.removeSync("test-events.log");
- done();
- });
- });
-
- it("should emit the error event of the underlying stream", done => {
- s.on("error", e => {
- e.message.should.equal("oh no");
- done();
- });
- s.currentFileStream.emit("error", new Error("oh no"));
- });
- });
-
- describe("when deleting old files and there is an error", () => {
- before(done => {
- fs.ensureDir('/tmp/delete-test/logfile.log.2', done);
- });
-
- it("should not let errors bubble up", done => {
- const s = new RollingFileWriteStream("/tmp/delete-test/logfile.log", {
- maxSize: 10,
- numToKeep: 1
- });
-
- s.write("length is 10", "utf8", () => {
- // if there's an error during deletion, then done never gets called
- s.write("length is 10", "utf8", done);
- });
- });
-
- after(done => {
- fs.remove('/tmp/delete-test', done);
- })
- });
-});
diff --git a/node_modules/streamroller/test/fileNameFormatter-test.js b/node_modules/streamroller/test/fileNameFormatter-test.js
deleted file mode 100644
index b990153..0000000
--- a/node_modules/streamroller/test/fileNameFormatter-test.js
+++ /dev/null
@@ -1,508 +0,0 @@
-require("should");
-const { normalize } = require("path");
-
-describe("fileNameFormatter", () => {
- describe("without a date", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- }
- });
- it("should take an index and return a filename", () => {
- fileNameFormatter({
- index: 0
- }).should.eql(normalize("/path/to/file/thefile.log"));
- fileNameFormatter({ index: 1, date: "" }).should.eql(
- normalize("/path/to/file/thefile.log.1")
- );
- fileNameFormatter({ index: 15, date: undefined }).should.eql(
- normalize("/path/to/file/thefile.log.15")
- );
- fileNameFormatter({ index: 15 }).should.eql(
- normalize("/path/to/file/thefile.log.15")
- );
- });
- });
-
- describe("with a date", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- }
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({ index: 0, date: "2019-07-15" }).should.eql(
- normalize("/path/to/file/thefile.log")
- );
- fileNameFormatter({
- index: 2,
- date: "2019-07-16"
- }).should.eql(normalize("/path/to/file/thefile.log.2019-07-16"));
- });
- });
-
- describe("with the alwaysIncludeDate option", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- alwaysIncludeDate: true
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.log.2019-07-15"));
- fileNameFormatter({ index: 0, date: "2019-07-15" }).should.eql(
- normalize("/path/to/file/thefile.log.2019-07-15")
- );
- fileNameFormatter({
- index: 2,
- date: "2019-07-16"
- }).should.eql(normalize("/path/to/file/thefile.log.2019-07-16"));
- });
- });
-
- describe("with the keepFileExt option", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- keepFileExt: true
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.log"));
- fileNameFormatter({ index: 1 }).should.eql(normalize("/path/to/file/thefile.1.log"));
- fileNameFormatter({ index: 2 }).should.eql(normalize("/path/to/file/thefile.2.log"));
- fileNameFormatter({ index: 15 }).should.eql(
- normalize("/path/to/file/thefile.15.log")
- );
- });
- });
-
- describe("with the keepFileExt option and a date", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- keepFileExt: true
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.log"));
- fileNameFormatter({ index: 1, date: "2019-07-15" }).should.eql(
- normalize("/path/to/file/thefile.2019-07-15.log")
- );
- fileNameFormatter({
- index: 2,
- date: "2019-07-16"
- }).should.eql(normalize("/path/to/file/thefile.2019-07-16.log"));
- });
- });
-
- describe("with the keepFileExt, alwaysIncludeDate options", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- keepFileExt: true,
- alwaysIncludeDate: true
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.2019-07-15.log"));
- fileNameFormatter({ index: 1, date: "2019-07-15" }).should.eql(
- normalize("/path/to/file/thefile.2019-07-15.log")
- );
- fileNameFormatter({
- index: 2,
- date: "2019-07-16"
- }).should.eql(normalize("/path/to/file/thefile.2019-07-16.log"));
- });
- });
-
- describe("with the compress option", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- compress: true
- });
- it("should take an index and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.log"));
- fileNameFormatter({ index: 1 }).should.eql(
- normalize("/path/to/file/thefile.log.1.gz")
- );
- fileNameFormatter({
- index: 2
- }).should.eql(normalize("/path/to/file/thefile.log.2.gz"));
- });
- });
-
- describe("with the compress option and a date", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- compress: true
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.log"));
- fileNameFormatter({ index: 1, date: "2019-07-15" }).should.eql(
- normalize("/path/to/file/thefile.log.2019-07-15.gz")
- );
- fileNameFormatter({
- index: 2,
- date: "2019-07-16"
- }).should.eql(normalize("/path/to/file/thefile.log.2019-07-16.gz"));
- });
- });
-
- describe("with the compress, alwaysIncludeDate option and a date", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- compress: true,
- alwaysIncludeDate: true
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.log.2019-07-15"));
- fileNameFormatter({ index: 1, date: "2019-07-15" }).should.eql(
- normalize("/path/to/file/thefile.log.2019-07-15.gz")
- );
- fileNameFormatter({
- index: 2,
- date: "2019-07-16"
- }).should.eql(normalize("/path/to/file/thefile.log.2019-07-16.gz"));
- });
- });
-
- describe("with the compress, alwaysIncludeDate, keepFileExt option and a date", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- compress: true,
- alwaysIncludeDate: true,
- keepFileExt: true
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.2019-07-15.log"));
- fileNameFormatter({ index: 1, date: "2019-07-15" }).should.eql(
- normalize("/path/to/file/thefile.2019-07-15.log.gz")
- );
- fileNameFormatter({
- index: 2,
- date: "2019-07-16"
- }).should.eql(normalize("/path/to/file/thefile.2019-07-16.log.gz"));
- });
- });
-
- describe("with the needsIndex option", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- compress: true,
- needsIndex: true,
- alwaysIncludeDate: true,
- keepFileExt: true
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.2019-07-15.log"));
- fileNameFormatter({ index: 1, date: "2019-07-15" }).should.eql(
- normalize("/path/to/file/thefile.2019-07-15.1.log.gz")
- );
- fileNameFormatter({
- index: 2,
- date: "2019-07-16"
- }).should.eql(normalize("/path/to/file/thefile.2019-07-16.2.log.gz"));
- });
- });
-
- describe("with a date and needsIndex", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- needsIndex: true
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({ index: 0, date: "2019-07-15" }).should.eql(
- normalize("/path/to/file/thefile.log")
- );
- fileNameFormatter({
- index: 2,
- date: "2019-07-16"
- }).should.eql(normalize("/path/to/file/thefile.log.2019-07-16.2"));
- });
- });
-
- describe("with the alwaysIncludeDate, needsIndex option", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- needsIndex: true,
- alwaysIncludeDate: true
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.log.2019-07-15"));
- fileNameFormatter({ index: 0, date: "2019-07-15" }).should.eql(
- normalize("/path/to/file/thefile.log.2019-07-15")
- );
- fileNameFormatter({
- index: 2,
- date: "2019-07-16"
- }).should.eql(normalize("/path/to/file/thefile.log.2019-07-16.2"));
- });
- });
-
- describe("with the keepFileExt, needsIndex option", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- needsIndex: true,
- keepFileExt: true
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.log"));
- fileNameFormatter({ index: 1 }).should.eql(normalize("/path/to/file/thefile.1.log"));
- fileNameFormatter({ index: 2 }).should.eql(normalize("/path/to/file/thefile.2.log"));
- fileNameFormatter({ index: 15 }).should.eql(
- normalize("/path/to/file/thefile.15.log")
- );
- });
- });
-
- describe("with the keepFileExt, needsIndex option and a date", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- needsIndex: true,
- keepFileExt: true
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.log"));
- fileNameFormatter({ index: 1, date: "2019-07-15" }).should.eql(
- normalize("/path/to/file/thefile.2019-07-15.1.log")
- );
- fileNameFormatter({
- index: 2,
- date: "2019-07-16"
- }).should.eql(normalize("/path/to/file/thefile.2019-07-16.2.log"));
- });
- });
-
- describe("with the keepFileExt, needsIndex, alwaysIncludeDate options", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- needsIndex: true,
- keepFileExt: true,
- alwaysIncludeDate: true
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.2019-07-15.log"));
- fileNameFormatter({ index: 1, date: "2019-07-15" }).should.eql(
- normalize("/path/to/file/thefile.2019-07-15.1.log")
- );
- fileNameFormatter({
- index: 2,
- date: "2019-07-16"
- }).should.eql(normalize("/path/to/file/thefile.2019-07-16.2.log"));
- });
- });
-
- describe("with the compress, needsIndex option", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- needsIndex: true,
- compress: true
- });
- it("should take an index and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.log"));
- fileNameFormatter({ index: 1 }).should.eql(
- normalize("/path/to/file/thefile.log.1.gz")
- );
- fileNameFormatter({
- index: 2
- }).should.eql(normalize("/path/to/file/thefile.log.2.gz"));
- });
- });
-
- describe("with the compress, needsIndex option and a date", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- needsIndex: true,
- compress: true
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.log"));
- fileNameFormatter({ index: 1, date: "2019-07-15" }).should.eql(
- normalize("/path/to/file/thefile.log.2019-07-15.1.gz")
- );
- fileNameFormatter({
- index: 2,
- date: "2019-07-16"
- }).should.eql(normalize("/path/to/file/thefile.log.2019-07-16.2.gz"));
- });
- });
-
- describe("with the compress, alwaysIncludeDate, needsIndex option and a date", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- needsIndex: true,
- compress: true,
- alwaysIncludeDate: true
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.log.2019-07-15"));
- fileNameFormatter({ index: 1, date: "2019-07-15" }).should.eql(
- normalize("/path/to/file/thefile.log.2019-07-15.1.gz")
- );
- fileNameFormatter({
- index: 2,
- date: "2019-07-16"
- }).should.eql(normalize("/path/to/file/thefile.log.2019-07-16.2.gz"));
- });
- });
-
- describe("with the compress, alwaysIncludeDate, keepFileExt, needsIndex option and a date", () => {
- const fileNameFormatter = require("../lib/fileNameFormatter")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- needsIndex: true,
- compress: true,
- alwaysIncludeDate: true,
- keepFileExt: true
- });
- it("should take an index, date and return a filename", () => {
- fileNameFormatter({
- index: 0,
- date: "2019-07-15"
- }).should.eql(normalize("/path/to/file/thefile.2019-07-15.log"));
- fileNameFormatter({ index: 1, date: "2019-07-15" }).should.eql(
- normalize("/path/to/file/thefile.2019-07-15.1.log.gz")
- );
- fileNameFormatter({
- index: 2,
- date: "2019-07-16"
- }).should.eql(normalize("/path/to/file/thefile.2019-07-16.2.log.gz"));
- });
- });
-});
diff --git a/node_modules/streamroller/test/fileNameParser-test.js b/node_modules/streamroller/test/fileNameParser-test.js
deleted file mode 100644
index 2a55904..0000000
--- a/node_modules/streamroller/test/fileNameParser-test.js
+++ /dev/null
@@ -1,180 +0,0 @@
-const should = require("should");
-
-describe("fileNameParser", () => {
- describe("with default options", () => {
- const parser = require("../lib/fileNameParser")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- }
- });
- it("should return null for filenames that do not match", () => {
- should(parser("cheese.txt")).not.be.ok();
- should(parser("thefile.log.biscuits")).not.be.ok();
- });
- it("should take a filename and return the index", () => {
- parser("thefile.log.2").should.eql({
- filename: "thefile.log.2",
- index: 2,
- isCompressed: false
- });
- parser("thefile.log.2.gz").should.eql({
- filename: "thefile.log.2.gz",
- index: 2,
- isCompressed: true
- });
- });
- });
-
- describe("with pattern option", () => {
- const parser = require("../lib/fileNameParser")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- pattern: "yyyy-MM-dd"
- });
- it("should return null for files that do not match", () => {
- should(parser("thefile.log.biscuits")).not.be.ok();
- should(parser("thefile.log.2019")).not.be.ok();
- should(parser("thefile.log.3.2")).not.be.ok();
- should(parser("thefile.log.04-18")).not.be.ok();
- should(parser("anotherfile.log.2020-04-18")).not.be.ok();
- should(parser("2020-05-18")).not.be.ok();
- });
- it("should take a filename and return the date", () => {
- parser("thefile.log.2019-07-17").should.eql({
- filename: "thefile.log.2019-07-17",
- index: 0,
- date: "2019-07-17",
- timestamp: new Date(2019, 6, 17).getTime(),
- isCompressed: false
- });
- parser("thefile.log.gz").should.eql({
- filename: "thefile.log.gz",
- index: 0,
- isCompressed: true
- });
- });
- it("should take a filename and return both date and index", () => {
- parser("thefile.log.2019-07-17.2").should.eql({
- filename: "thefile.log.2019-07-17.2",
- index: 2,
- date: "2019-07-17",
- timestamp: new Date(2019, 6, 17).getTime(),
- isCompressed: false
- });
- parser("thefile.log.2019-07-17.2.gz").should.eql({
- filename: "thefile.log.2019-07-17.2.gz",
- index: 2,
- date: "2019-07-17",
- timestamp: new Date(2019, 6, 17).getTime(),
- isCompressed: true
- });
- });
- });
-
- describe("with keepFileExt option", () => {
- const parser = require("../lib/fileNameParser")({
- file: {
- dir: "/path/to/file",
- base: "thefile.log",
- ext: ".log",
- name: "thefile"
- },
- keepFileExt: true
- });
- it("should take a filename and return the index", () => {
- should(parser("thefile.log.2")).not.be.ok();
- should(parser("thefile.log.2.gz")).not.be.ok();
- parser("thefile.2.log").should.eql({
- filename: "thefile.2.log",
- index: 2,
- isCompressed: false
- });
- parser("thefile.2.log.gz").should.eql({
- filename: "thefile.2.log.gz",
- index: 2,
- isCompressed: true
- });
- });
- });
-
- describe("with a two-digit date pattern", () => {
- const parser = require("../lib/fileNameParser")({
- file: {
- dir: "/path/to/file",
- base: "thing.log",
- ext: ".log",
- name: "thing"
- },
- pattern: "mm"
- });
- it("should take a filename and return the date", () => {
- const expectedTimestamp = new Date(0, 0);
- expectedTimestamp.setMinutes(34);
- parser("thing.log.34").should.eql({
- filename: "thing.log.34",
- date: "34",
- isCompressed: false,
- index: 0,
- timestamp: expectedTimestamp.getTime()
- });
- });
- })
-
- describe("with a four-digit date pattern", () => {
- const parser = require("../lib/fileNameParser")({
- file: {
- dir: "/path/to/file",
- base: "stuff.log",
- ext: ".log",
- name: "stuff"
- },
- pattern: "mm-ss"
- });
- it("should return null for files that do not match", () => {
- should(parser("stuff.log.2020-04-18")).not.be.ok();
- should(parser("09-18")).not.be.ok();
- });
- it("should take a filename and return the date", () => {
- const expectedTimestamp = new Date(0, 0);
- expectedTimestamp.setMinutes(34);
- expectedTimestamp.setSeconds(59);
- parser("stuff.log.34-59").should.eql({
- filename: "stuff.log.34-59",
- date: "34-59",
- isCompressed: false,
- index: 0,
- timestamp: expectedTimestamp.getTime()
- });
- });
- it("should take a filename and return both date and index", () => {
- const expectedTimestamp_1 = new Date(0, 0);
- expectedTimestamp_1.setMinutes(7);
- expectedTimestamp_1.setSeconds(17);
- parser("stuff.log.07-17.2").should.eql({
- filename: "stuff.log.07-17.2",
- index: 2,
- date: "07-17",
- timestamp: expectedTimestamp_1.getTime(),
- isCompressed: false
- });
- const expectedTimestamp_2 = new Date(0, 0);
- expectedTimestamp_2.setMinutes(17);
- expectedTimestamp_2.setSeconds(30);
- parser("stuff.log.17-30.3.gz").should.eql({
- filename: "stuff.log.17-30.3.gz",
- index: 3,
- date: "17-30",
- timestamp: expectedTimestamp_2.getTime(),
- isCompressed: true
- });
- });
- })
-
-});
diff --git a/node_modules/streamroller/test/moveAndMaybeCompressFile-test.js b/node_modules/streamroller/test/moveAndMaybeCompressFile-test.js
deleted file mode 100644
index acbe84b..0000000
--- a/node_modules/streamroller/test/moveAndMaybeCompressFile-test.js
+++ /dev/null
@@ -1,118 +0,0 @@
-require("should");
-
-const fs = require('fs-extra');
-const path = require('path');
-const zlib = require('zlib');
-const proxyquire = require('proxyquire').noPreserveCache();
-const moveAndMaybeCompressFile = require('../lib/moveAndMaybeCompressFile');
-const TEST_DIR = path.normalize(`/tmp/moveAndMaybeCompressFile_${Math.floor(Math.random()*10000)}`);
-
-describe('moveAndMaybeCompressFile', () => {
- beforeEach(async () => {
- await fs.emptyDir(TEST_DIR);
- });
-
- after(async () => {
- await fs.remove(TEST_DIR);
- });
-
- it('should move the source file to a new destination', async () => {
- const source = path.join(TEST_DIR, 'test.log');
- const destination = path.join(TEST_DIR, 'moved-test.log');
- await fs.outputFile(source, 'This is the test file.');
- await moveAndMaybeCompressFile(source, destination);
-
- const contents = await fs.readFile(destination, 'utf8');
- contents.should.equal('This is the test file.');
-
- const exists = await fs.pathExists(source);
- exists.should.be.false();
-
- });
-
- it('should compress the source file at the new destination', async () => {
- const source = path.join(TEST_DIR, 'test.log');
- const destination = path.join(TEST_DIR, 'moved-test.log.gz');
- await fs.outputFile(source, 'This is the test file.');
- await moveAndMaybeCompressFile(source, destination, true);
-
- const zippedContents = await fs.readFile(destination);
- const contents = await new Promise(resolve => {
- zlib.gunzip(zippedContents, (e, data) => {
- resolve(data.toString());
- });
- });
- contents.should.equal('This is the test file.');
-
- const exists = await fs.pathExists(source);
- exists.should.be.false();
- });
-
- it('should do nothing if the source file and destination are the same', async () => {
- const source = path.join(TEST_DIR, 'pants.log');
- const destination = path.join(TEST_DIR, 'pants.log');
- await fs.outputFile(source, 'This is the test file.');
- await moveAndMaybeCompressFile(source, destination);
-
- (await fs.readFile(source, 'utf8')).should.equal('This is the test file.');
- });
-
- it('should do nothing if the source file does not exist', async () => {
- const source = path.join(TEST_DIR, 'pants.log');
- const destination = path.join(TEST_DIR, 'moved-pants.log');
- await moveAndMaybeCompressFile(source, destination);
-
- (await fs.pathExists(destination)).should.be.false();
- });
-
- it('should use copy+truncate if source file is locked (windows)', async () => {
- const moveWithMock = proxyquire('../lib/moveAndMaybeCompressFile', {
- "fs-extra": {
- exists: () => Promise.resolve(true),
- move: () => Promise.reject({ code: 'EBUSY', message: 'all gone wrong'}),
- copy: (fs.copy.bind(fs)),
- truncate: (fs.truncate.bind(fs))
- }
- });
-
- const source = path.join(TEST_DIR, 'test.log');
- const destination = path.join(TEST_DIR, 'moved-test.log');
- await fs.outputFile(source, 'This is the test file.');
- await moveWithMock(source, destination);
-
- const contents = await fs.readFile(destination, 'utf8');
- contents.should.equal('This is the test file.');
-
- // won't delete the source, but it will be empty
- (await fs.readFile(source, 'utf8')).should.be.empty()
-
- });
-
- it('should truncate file if remove fails when compressed (windows)', async () => {
- const moveWithMock = proxyquire('../lib/moveAndMaybeCompressFile', {
- "fs-extra": {
- exists: () => Promise.resolve(true),
- unlink: () => Promise.reject({ code: 'EBUSY', message: 'all gone wrong'}),
- createReadStream: fs.createReadStream.bind(fs),
- truncate: fs.truncate.bind(fs)
- }
- });
-
- const source = path.join(TEST_DIR, 'test.log');
- const destination = path.join(TEST_DIR, 'moved-test.log.gz');
- await fs.outputFile(source, 'This is the test file.');
- await moveWithMock(source, destination, true);
-
- const zippedContents = await fs.readFile(destination);
- const contents = await new Promise(resolve => {
- zlib.gunzip(zippedContents, (e, data) => {
- resolve(data.toString());
- });
- });
- contents.should.equal('This is the test file.');
-
- // won't delete the source, but it will be empty
- (await fs.readFile(source, 'utf8')).should.be.empty()
-
- });
-});
diff --git a/node_modules/universalify/README.md b/node_modules/universalify/README.md
index 487067b..aa12474 100644
--- a/node_modules/universalify/README.md
+++ b/node_modules/universalify/README.md
@@ -21,7 +21,7 @@
Takes a callback-based function to universalify, and returns the universalified function.
-Function must take a callback as the last parameter that will be called with the signature `(error, result)`. `universalify` does not support calling the callback with more than three arguments, and does not ensure that the callback is only called once.
+Function must take a callback as the last parameter that will be called with the signature `(error, result)`. `universalify` does not support calling the callback with three or more arguments, and does not ensure that the callback is only called once.
```js
function callbackFn (n, cb) {
diff --git a/node_modules/universalify/index.js b/node_modules/universalify/index.js
index 0c9ba39..ba6c662 100644
--- a/node_modules/universalify/index.js
+++ b/node_modules/universalify/index.js
@@ -1,25 +1,24 @@
'use strict'
exports.fromCallback = function (fn) {
- return Object.defineProperty(function () {
- if (typeof arguments[arguments.length - 1] === 'function') fn.apply(this, arguments)
+ return Object.defineProperty(function (...args) {
+ if (typeof args[args.length - 1] === 'function') fn.apply(this, args)
else {
return new Promise((resolve, reject) => {
- arguments[arguments.length] = (err, res) => {
- if (err) return reject(err)
- resolve(res)
- }
- arguments.length++
- fn.apply(this, arguments)
+ fn.call(
+ this,
+ ...args,
+ (err, res) => (err != null) ? reject(err) : resolve(res)
+ )
})
}
}, 'name', { value: fn.name })
}
exports.fromPromise = function (fn) {
- return Object.defineProperty(function () {
- const cb = arguments[arguments.length - 1]
- if (typeof cb !== 'function') return fn.apply(this, arguments)
- else fn.apply(this, arguments).then(r => cb(null, r), cb)
+ return Object.defineProperty(function (...args) {
+ const cb = args[args.length - 1]
+ if (typeof cb !== 'function') return fn.apply(this, args)
+ else fn.apply(this, args.slice(0, -1)).then(r => cb(null, r), cb)
}, 'name', { value: fn.name })
}
diff --git a/node_modules/universalify/package.json b/node_modules/universalify/package.json
index 321b192..006d4cc 100644
--- a/node_modules/universalify/package.json
+++ b/node_modules/universalify/package.json
@@ -1,6 +1,6 @@
{
"name": "universalify",
- "version": "0.1.2",
+ "version": "2.0.0",
"description": "Make a callback- or promise-based function support both promises and callbacks.",
"keywords": [
"callback",
@@ -24,11 +24,11 @@
"devDependencies": {
"colortape": "^0.1.2",
"coveralls": "^3.0.1",
- "nyc": "^10.2.0",
- "standard": "^10.0.1",
- "tape": "^4.6.3"
+ "nyc": "^15.0.0",
+ "standard": "^14.3.1",
+ "tape": "^5.0.1"
},
"engines": {
- "node": ">= 4.0.0"
+ "node": ">= 10.0.0"
}
}