fix: express5

This commit is contained in:
SamTV12345 2025-04-29 19:44:56 +02:00
parent 6208a04556
commit 6db14baee7
26 changed files with 200 additions and 207 deletions

View file

@ -17,7 +17,7 @@ const performCheck = async () => {
await db.init();
console.log("Checking if " + padId + " exists")
const padManager = require('ep_etherpad-lite/node/db/PadManager');
if (!await padManager.doesPadExists(padId)) throw new Error('Pad does not exist');
if (!(await padManager.doesPadExists(padId))) throw new Error('Pad does not exist');
const pad = await padManager.getPad(padId);
await pad.check();
console.log('Finished checking pad.');

279
pnpm-lock.yaml generated
View file

@ -165,11 +165,11 @@ importers:
specifier: ^0.25.2
version: 0.25.2
express:
specifier: 4.21.2
version: 4.21.2
specifier: 5.1.0
version: 5.1.0
express-rate-limit:
specifier: ^7.5.0
version: 7.5.0(express@4.21.2)
version: 7.5.0(express@5.1.0)
fast-deep-equal:
specifier: ^3.1.3
version: 3.1.3
@ -262,7 +262,7 @@ importers:
version: 10.2.0
swagger-ui-express:
specifier: ^5.0.1
version: 5.0.1(express@4.21.2)
version: 5.0.1(express@5.1.0)
tinycon:
specifier: 0.6.8
version: 0.6.8
@ -2074,6 +2074,10 @@ packages:
resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==}
engines: {node: '>= 0.6'}
accepts@2.0.0:
resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==}
engines: {node: '>= 0.6'}
acorn-jsx@5.3.2:
resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==}
peerDependencies:
@ -2141,9 +2145,6 @@ packages:
resolution: {integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==}
engines: {node: '>= 0.4'}
array-flatten@1.1.1:
resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==}
array-includes@3.1.8:
resolution: {integrity: sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==}
engines: {node: '>= 0.4'}
@ -2223,9 +2224,9 @@ packages:
birpc@0.2.19:
resolution: {integrity: sha512-5WeXXAvTmitV1RqJFppT5QtUiz2p1mRSYU000Jkft5ZUCLJIk4uQriYNO50HknxKwM6jd8utNc66K1qGIwwWBQ==}
body-parser@1.20.3:
resolution: {integrity: sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==}
engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16}
body-parser@2.2.0:
resolution: {integrity: sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==}
engines: {node: '>=18'}
brace-expansion@1.1.11:
resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
@ -2363,6 +2364,10 @@ packages:
resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==}
engines: {node: '>= 0.6'}
content-disposition@1.0.0:
resolution: {integrity: sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==}
engines: {node: '>= 0.6'}
content-type@1.0.5:
resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==}
engines: {node: '>= 0.6'}
@ -2377,14 +2382,14 @@ packages:
cookie-signature@1.0.6:
resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==}
cookie-signature@1.2.2:
resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==}
engines: {node: '>=6.6.0'}
cookie@0.4.2:
resolution: {integrity: sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==}
engines: {node: '>= 0.6'}
cookie@0.7.1:
resolution: {integrity: sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==}
engines: {node: '>= 0.6'}
cookie@0.7.2:
resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==}
engines: {node: '>= 0.6'}
@ -2457,14 +2462,6 @@ packages:
resolution: {integrity: sha512-39BOQLs9ZjKh0/patS9nrT8wc3ioX3/eA/zgbKNopnF2wCqJEoxywwwElATYvRsXdnOxA/OQeQoFZ3rFjVajhg==}
engines: {node: '>=4.0'}
debug@2.6.9:
resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==}
peerDependencies:
supports-color: '*'
peerDependenciesMeta:
supports-color:
optional: true
debug@3.2.7:
resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==}
peerDependencies:
@ -2897,9 +2894,9 @@ packages:
peerDependencies:
express: ^4.11 || 5 || ^5.0.0-beta.1
express@4.21.2:
resolution: {integrity: sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==}
engines: {node: '>= 0.10.0'}
express@5.1.0:
resolution: {integrity: sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==}
engines: {node: '>= 18'}
extend@3.0.2:
resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==}
@ -2953,8 +2950,8 @@ packages:
resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}
engines: {node: '>=8'}
finalhandler@1.3.1:
resolution: {integrity: sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==}
finalhandler@2.1.0:
resolution: {integrity: sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==}
engines: {node: '>= 0.8'}
find-root@1.1.0:
@ -3021,6 +3018,10 @@ packages:
resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==}
engines: {node: '>= 0.6'}
fresh@2.0.0:
resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==}
engines: {node: '>= 0.8'}
fs-extra@10.1.0:
resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==}
engines: {node: '>=12'}
@ -3255,10 +3256,6 @@ packages:
typescript:
optional: true
iconv-lite@0.4.24:
resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==}
engines: {node: '>=0.10.0'}
iconv-lite@0.6.3:
resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==}
engines: {node: '>=0.10.0'}
@ -3382,6 +3379,9 @@ packages:
is-promise@1.0.1:
resolution: {integrity: sha512-mjWH5XxnhMA8cFnDchr6qRP9S/kLntKuEfIYku+PaN1CnS8v+OG9O/BKpRCVRJvpIkgAZm0Pf5Is3iSSOILlcg==}
is-promise@4.0.0:
resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==}
is-regex@1.2.1:
resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==}
engines: {node: '>= 0.4'}
@ -3658,8 +3658,13 @@ packages:
resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==}
engines: {node: '>= 0.6'}
merge-descriptors@1.0.3:
resolution: {integrity: sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==}
media-typer@1.1.0:
resolution: {integrity: sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==}
engines: {node: '>= 0.8'}
merge-descriptors@2.0.0:
resolution: {integrity: sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==}
engines: {node: '>=18'}
merge2@1.4.1:
resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==}
@ -3704,11 +3709,6 @@ packages:
resolution: {integrity: sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==}
engines: {node: '>= 0.6'}
mime@1.6.0:
resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==}
engines: {node: '>=4'}
hasBin: true
mime@2.6.0:
resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==}
engines: {node: '>=4.0.0'}
@ -3778,9 +3778,6 @@ packages:
mock-json-schema@1.1.1:
resolution: {integrity: sha512-YV23vlsLP1EEOy0EviUvZTluXjLR+rhMzeayP2rcDiezj3RW01MhOSQkbQskdtg0K2fnGas5LKbSXgNjAOSX4A==}
ms@2.0.0:
resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==}
ms@2.1.3:
resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
@ -3801,6 +3798,10 @@ packages:
resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==}
engines: {node: '>= 0.6'}
negotiator@1.0.0:
resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==}
engines: {node: '>= 0.6'}
netmask@2.0.2:
resolution: {integrity: sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==}
engines: {node: '>= 0.4.0'}
@ -3811,6 +3812,7 @@ packages:
node-domexception@1.0.0:
resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}
engines: {node: '>=10.5.0'}
deprecated: Use your platform's native DOMException instead
node-fetch-commonjs@3.3.2:
resolution: {integrity: sha512-VBlAiynj3VMLrotgwOS3OyECFxas5y7ltLcK4t41lMUZeaK15Ym4QRkqN0EQKAFL42q9i21EPKjzLUPfltR72A==}
@ -3970,12 +3972,13 @@ packages:
resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==}
engines: {node: '>=16 || 14 >=14.18'}
path-to-regexp@0.1.12:
resolution: {integrity: sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==}
path-to-regexp@6.3.0:
resolution: {integrity: sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==}
path-to-regexp@8.2.0:
resolution: {integrity: sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ==}
engines: {node: '>=16'}
path-type@4.0.0:
resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
engines: {node: '>=8'}
@ -4047,10 +4050,6 @@ packages:
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
engines: {node: '>=6'}
qs@6.13.0:
resolution: {integrity: sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==}
engines: {node: '>=0.6'}
qs@6.14.0:
resolution: {integrity: sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==}
engines: {node: '>=0.6'}
@ -4083,10 +4082,6 @@ packages:
rate-limiter-flexible@7.0.0:
resolution: {integrity: sha512-K1Y7WTh6m/MpgifDkBzexI0PfPYd+LaXRl+Aqq+LkKKIb68KLJxd/cp+Fw3iU1T0h3oQ9TwbR0m2/ksU70ML+g==}
raw-body@2.5.2:
resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==}
engines: {node: '>= 0.8'}
raw-body@3.0.0:
resolution: {integrity: sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==}
engines: {node: '>= 0.8'}
@ -4245,6 +4240,10 @@ packages:
engines: {node: '>=18.0.0', npm: '>=8.0.0'}
hasBin: true
router@2.2.0:
resolution: {integrity: sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==}
engines: {node: '>= 18'}
rrweb-cssom@0.8.0:
resolution: {integrity: sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==}
@ -4352,16 +4351,16 @@ packages:
engines: {node: '>=10'}
hasBin: true
send@0.19.0:
resolution: {integrity: sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==}
engines: {node: '>= 0.8.0'}
send@1.2.0:
resolution: {integrity: sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==}
engines: {node: '>= 18'}
serialize-javascript@6.0.2:
resolution: {integrity: sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==}
serve-static@1.16.2:
resolution: {integrity: sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==}
engines: {node: '>= 0.8.0'}
serve-static@2.2.0:
resolution: {integrity: sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==}
engines: {node: '>= 18'}
set-cookie-parser@2.7.1:
resolution: {integrity: sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==}
@ -4698,6 +4697,10 @@ packages:
resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==}
engines: {node: '>= 0.6'}
type-is@2.0.1:
resolution: {integrity: sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==}
engines: {node: '>= 0.6'}
typed-array-buffer@1.0.3:
resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==}
engines: {node: '>= 0.4'}
@ -4806,10 +4809,6 @@ packages:
'@types/react':
optional: true
utils-merge@1.0.1:
resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==}
engines: {node: '>= 0.4.0'}
vary@1.1.2:
resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==}
engines: {node: '>= 0.8'}
@ -6751,6 +6750,11 @@ snapshots:
mime-types: 2.1.35
negotiator: 0.6.3
accepts@2.0.0:
dependencies:
mime-types: 3.0.1
negotiator: 1.0.0
acorn-jsx@5.3.2(acorn@8.14.1):
dependencies:
acorn: 8.14.1
@ -6821,8 +6825,6 @@ snapshots:
call-bound: 1.0.4
is-array-buffer: 3.0.5
array-flatten@1.1.1: {}
array-includes@3.1.8:
dependencies:
call-bind: 1.0.8
@ -6910,20 +6912,17 @@ snapshots:
birpc@0.2.19: {}
body-parser@1.20.3:
body-parser@2.2.0:
dependencies:
bytes: 3.1.2
content-type: 1.0.5
debug: 2.6.9
depd: 2.0.0
destroy: 1.2.0
debug: 4.4.0(supports-color@8.1.1)
http-errors: 2.0.0
iconv-lite: 0.4.24
iconv-lite: 0.6.3
on-finished: 2.4.1
qs: 6.13.0
raw-body: 2.5.2
type-is: 1.6.18
unpipe: 1.0.0
qs: 6.14.0
raw-body: 3.0.0
type-is: 2.0.1
transitivePeerDependencies:
- supports-color
@ -7068,6 +7067,10 @@ snapshots:
dependencies:
safe-buffer: 5.2.1
content-disposition@1.0.0:
dependencies:
safe-buffer: 5.2.1
content-type@1.0.5: {}
convert-source-map@2.0.0: {}
@ -7079,9 +7082,9 @@ snapshots:
cookie-signature@1.0.6: {}
cookie@0.4.2: {}
cookie-signature@1.2.2: {}
cookie@0.7.1: {}
cookie@0.4.2: {}
cookie@0.7.2: {}
@ -7156,10 +7159,6 @@ snapshots:
date-format@4.0.14: {}
debug@2.6.9:
dependencies:
ms: 2.0.0
debug@3.2.7:
dependencies:
ms: 2.1.3
@ -7516,7 +7515,7 @@ snapshots:
transitivePeerDependencies:
- supports-color
eslint-module-utils@2.12.0(@typescript-eslint/parser@7.18.0(eslint@9.24.0)(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.0)(eslint@9.24.0):
eslint-module-utils@2.12.0(@typescript-eslint/parser@7.18.0(eslint@9.24.0)(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.0(eslint-plugin-import@2.31.0)(eslint@9.24.0))(eslint@9.24.0):
dependencies:
debug: 3.2.7
optionalDependencies:
@ -7556,7 +7555,7 @@ snapshots:
doctrine: 2.1.0
eslint: 9.24.0
eslint-import-resolver-node: 0.3.9
eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.18.0(eslint@9.24.0)(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.0)(eslint@9.24.0)
eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.18.0(eslint@9.24.0)(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.0(eslint-plugin-import@2.31.0)(eslint@9.24.0))(eslint@9.24.0)
hasown: 2.0.2
is-core-module: 2.16.1
is-glob: 4.0.3
@ -7714,42 +7713,38 @@ snapshots:
expect-type@1.2.1: {}
express-rate-limit@7.5.0(express@4.21.2):
express-rate-limit@7.5.0(express@5.1.0):
dependencies:
express: 4.21.2
express: 5.1.0
express@4.21.2:
express@5.1.0:
dependencies:
accepts: 1.3.8
array-flatten: 1.1.1
body-parser: 1.20.3
content-disposition: 0.5.4
accepts: 2.0.0
body-parser: 2.2.0
content-disposition: 1.0.0
content-type: 1.0.5
cookie: 0.7.1
cookie-signature: 1.0.6
debug: 2.6.9
depd: 2.0.0
cookie: 0.7.2
cookie-signature: 1.2.2
debug: 4.4.0(supports-color@8.1.1)
encodeurl: 2.0.0
escape-html: 1.0.3
etag: 1.8.1
finalhandler: 1.3.1
fresh: 0.5.2
finalhandler: 2.1.0
fresh: 2.0.0
http-errors: 2.0.0
merge-descriptors: 1.0.3
methods: 1.1.2
merge-descriptors: 2.0.0
mime-types: 3.0.1
on-finished: 2.4.1
once: 1.4.0
parseurl: 1.3.3
path-to-regexp: 0.1.12
proxy-addr: 2.0.7
qs: 6.13.0
qs: 6.14.0
range-parser: 1.2.1
safe-buffer: 5.2.1
send: 0.19.0
serve-static: 1.16.2
setprototypeof: 1.2.0
router: 2.2.0
send: 1.2.0
serve-static: 2.2.0
statuses: 2.0.1
type-is: 1.6.18
utils-merge: 1.0.1
type-is: 2.0.1
vary: 1.1.2
transitivePeerDependencies:
- supports-color
@ -7803,15 +7798,14 @@ snapshots:
dependencies:
to-regex-range: 5.0.1
finalhandler@1.3.1:
finalhandler@2.1.0:
dependencies:
debug: 2.6.9
debug: 4.4.0(supports-color@8.1.1)
encodeurl: 2.0.0
escape-html: 1.0.3
on-finished: 2.4.1
parseurl: 1.3.3
statuses: 2.0.1
unpipe: 1.0.0
transitivePeerDependencies:
- supports-color
@ -7876,6 +7870,8 @@ snapshots:
fresh@0.5.2: {}
fresh@2.0.0: {}
fs-extra@10.1.0:
dependencies:
graceful-fs: 4.2.11
@ -8179,10 +8175,6 @@ snapshots:
optionalDependencies:
typescript: 5.8.3
iconv-lite@0.4.24:
dependencies:
safer-buffer: 2.1.2
iconv-lite@0.6.3:
dependencies:
safer-buffer: 2.1.2
@ -8301,6 +8293,8 @@ snapshots:
is-promise@1.0.1: {}
is-promise@4.0.0: {}
is-regex@1.2.1:
dependencies:
call-bound: 1.0.4
@ -8631,7 +8625,9 @@ snapshots:
media-typer@0.3.0: {}
merge-descriptors@1.0.3: {}
media-typer@1.1.0: {}
merge-descriptors@2.0.0: {}
merge2@1.4.1: {}
@ -8671,8 +8667,6 @@ snapshots:
dependencies:
mime-db: 1.54.0
mime@1.6.0: {}
mime@2.6.0: {}
mimic-response@3.1.0: {}
@ -8743,8 +8737,6 @@ snapshots:
dependencies:
lodash: 4.17.21
ms@2.0.0: {}
ms@2.1.3: {}
nanoid@3.3.11: {}
@ -8755,6 +8747,8 @@ snapshots:
negotiator@0.6.3: {}
negotiator@1.0.0: {}
netmask@2.0.2: {}
no-case@3.0.4:
@ -8962,10 +8956,10 @@ snapshots:
lru-cache: 10.4.3
minipass: 7.1.2
path-to-regexp@0.1.12: {}
path-to-regexp@6.3.0: {}
path-to-regexp@8.2.0: {}
path-type@4.0.0: {}
pathe@2.0.3: {}
@ -9028,10 +9022,6 @@ snapshots:
punycode@2.3.1: {}
qs@6.13.0:
dependencies:
side-channel: 1.1.0
qs@6.14.0:
dependencies:
side-channel: 1.1.0
@ -9054,13 +9044,6 @@ snapshots:
rate-limiter-flexible@7.0.0: {}
raw-body@2.5.2:
dependencies:
bytes: 3.1.2
http-errors: 2.0.0
iconv-lite: 0.4.24
unpipe: 1.0.0
raw-body@3.0.0:
dependencies:
bytes: 3.1.2
@ -9242,6 +9225,16 @@ snapshots:
'@rollup/rollup-win32-x64-msvc': 4.40.0
fsevents: 2.3.3
router@2.2.0:
dependencies:
debug: 4.4.0(supports-color@8.1.1)
depd: 2.0.0
is-promise: 4.0.0
parseurl: 1.3.3
path-to-regexp: 8.2.0
transitivePeerDependencies:
- supports-color
rrweb-cssom@0.8.0: {}
run-parallel@1.2.0:
@ -9326,17 +9319,15 @@ snapshots:
semver@7.7.1: {}
send@0.19.0:
send@1.2.0:
dependencies:
debug: 2.6.9
depd: 2.0.0
destroy: 1.2.0
encodeurl: 1.0.2
debug: 4.4.0(supports-color@8.1.1)
encodeurl: 2.0.0
escape-html: 1.0.3
etag: 1.8.1
fresh: 0.5.2
fresh: 2.0.0
http-errors: 2.0.0
mime: 1.6.0
mime-types: 3.0.1
ms: 2.1.3
on-finished: 2.4.1
range-parser: 1.2.1
@ -9348,12 +9339,12 @@ snapshots:
dependencies:
randombytes: 2.1.0
serve-static@1.16.2:
serve-static@2.2.0:
dependencies:
encodeurl: 2.0.0
escape-html: 1.0.3
parseurl: 1.3.3
send: 0.19.0
send: 1.2.0
transitivePeerDependencies:
- supports-color
@ -9660,9 +9651,9 @@ snapshots:
dependencies:
'@scarf/scarf': 1.4.0
swagger-ui-express@5.0.1(express@4.21.2):
swagger-ui-express@5.0.1(express@5.1.0):
dependencies:
express: 4.21.2
express: 5.1.0
swagger-ui-dist: 5.20.6
symbol-tree@3.2.4: {}
@ -9762,6 +9753,12 @@ snapshots:
media-typer: 0.3.0
mime-types: 2.1.35
type-is@2.0.1:
dependencies:
content-type: 1.0.5
media-typer: 1.1.0
mime-types: 3.0.1
typed-array-buffer@1.0.3:
dependencies:
call-bound: 1.0.4
@ -9900,8 +9897,6 @@ snapshots:
optionalDependencies:
'@types/react': 19.1.2
utils-merge@1.0.1: {}
vary@1.1.2: {}
vfile-location@5.0.3:

View file

@ -59,7 +59,7 @@ exports.deleteGroup = async (groupID: string): Promise<void> => {
// Delete associated sessions in parallel. This should be done before deleting the group2sessions
// record because deleting a session updates the group2sessions record.
const {sessionIDs = {}} = await db.get(`group2sessions:${groupID}`) || {};
const {sessionIDs = {}} = (await db.get(`group2sessions:${groupID}`)) || {};
await Promise.all(Object.keys(sessionIDs).map(async (sessionId) => {
await sessionManager.deleteSession(sessionId);
}));
@ -113,7 +113,7 @@ exports.createGroupIfNotExistsFor = async (groupMapper: string|object) => {
throw new CustomError('groupMapper is not a string', 'apierror');
}
const groupID = await db.get(`mapper2group:${groupMapper}`);
if (groupID && await exports.doesGroupExist(groupID)) return {groupID};
if (groupID && (await exports.doesGroupExist(groupID))) return {groupID};
const result = await exports.createGroup();
await Promise.all([
db.set(`mapper2group:${groupMapper}`, result.groupID),

View file

@ -116,10 +116,10 @@ class Pad {
meta: {
author: authorId,
timestamp: Date.now(),
...newRev === this.getKeyRevisionNumber(newRev) ? {
...(newRev === this.getKeyRevisionNumber(newRev) ? {
pool: this.pool,
atext: this.atext,
} : {},
} : {}),
},
}),
this.saveToDatabase(),
@ -135,10 +135,10 @@ class Pad {
pad_utils.warnDeprecated(`${hook} hook author context is deprecated; use authorId instead`);
this.authorId = authorId;
},
...this.head === 0 ? {} : {
...(this.head === 0 ? {} : {
revs: newRev,
changeset: aChangeset,
},
}),
}),
]);
return newRev;

View file

@ -57,7 +57,7 @@ const globalPads:MapArrayType<any> = {
*
* Updated without db access as new pads are created/old ones removed.
*/
const padList = new class {
const padList = new (class {
private _cachedList: string[] | null;
private _list: Set<string>;
private _loaded: Promise<void> | null;
@ -95,7 +95,7 @@ const padList = new class {
this._list.delete(name);
this._cachedList = null;
}
}();
})();
// initialises the all-knowing data structure

View file

@ -122,7 +122,7 @@ exports.checkAccess = async (padID:string, sessionCookie:string, token:string, u
const grant = {
accessStatus: 'grant',
authorID: sessionAuthorID || await authorManager.getAuthorId(token, userSettings),
authorID: sessionAuthorID || (await authorManager.getAuthorId(token, userSettings)),
};
if (!padID.includes('$')) {

View file

@ -327,7 +327,7 @@ exports.handleMessage = async (socket:any, message: ClientVarMessage) => {
`IP:${settings.disableIPlogging ? 'ANONYMOUS' : socket.request.ip}`,
`originalAuthorID:${thisSession.author}`,
`newAuthorID:${authorID}`,
...(user && user.username) ? [`username:${user.username}`] : [],
...((user && user.username) ? [`username:${user.username}`] : []),
`message:${message}`,
].join(' '));
}
@ -1097,7 +1097,7 @@ const handleClientReady = async (socket:any, message: ClientReadyMessage) => {
if (authorId == null) return;
// reuse previously created cache of author's data
const authorInfo = historicalAuthorData[authorId] || await authorManager.getAuthor(authorId);
const authorInfo = historicalAuthorData[authorId] || (await authorManager.getAuthor(authorId));
if (authorInfo == null) {
messageLogger.error(
`Author ${authorId} connected via socket.io session ${roomSocket.id} is missing from ` +

View file

@ -173,7 +173,7 @@ export class SecretRotator {
// TODO: This is racy. If two instances start up at the same time and there are no existing
// matching publications, each will generate and publish their own paramters. In practice this
// is unlikely to happen, and if it does it can be fixed by restarting both Etherpad instances.
const dbKeys:string[] = await db.findKeys(`${this._dbPrefix}:*`, null) || [];
const dbKeys:string[] = (await db.findKeys(`${this._dbPrefix}:*`, null)) || [];
let currentParams:any = null;
let currentId = null;
const dbWrites:any[] = [];
@ -245,7 +245,7 @@ export class SecretRotator {
// The secrets derived from currentParams MUST be the first secrets.
const secrets = await this._deriveSecrets(currentParams, now);
await Promise.all(
allParams.map(async (p) => secrets.push(...await this._deriveSecrets(p, now))));
allParams.map(async (p) => secrets.push(...(await this._deriveSecrets(p, now)))));
// Update this.secrets all at once to avoid race conditions.
this.secrets.length = 0;
this.secrets.push(...secrets);

View file

@ -31,10 +31,10 @@ const createRevision = async (aChangeset: AChangeSet, timestamp: number, isKeyRe
meta: {
author: authorId,
timestamp: timestamp,
...isKeyRev ? {
...(isKeyRev ? {
pool: pool,
atext: atext,
} : {},
} : {}),
},
};
}

View file

@ -41,7 +41,7 @@ exports.setPadRaw = async (padId: string, r: string, authorId = '') => {
// DB key prefixes for pad records. Each key is expected to have the form `${prefix}:${padId}` or
// `${prefix}:${padId}:${otherstuff}`.
const padKeyPrefixes = [
...await hooks.aCallAll('exportEtherpadAdditionalContent'),
...(await hooks.aCallAll('exportEtherpadAdditionalContent')),
'pad',
];

View file

@ -38,7 +38,7 @@
"cross-spawn": "^7.0.6",
"ejs": "^3.1.10",
"esbuild": "^0.25.2",
"express": "4.21.2",
"express": "5.1.0",
"express-rate-limit": "^7.5.0",
"fast-deep-equal": "^3.1.3",
"find-root": "1.1.0",

View file

@ -94,11 +94,11 @@ const Ace2Editor = function () {
let actionsPendingInit = [];
const pendingInit = (func) => function (...args) {
const pendingInit = (func) => (function(...args) {
const action = () => func.apply(this, args);
if (loaded) return action();
actionsPendingInit.push(action);
};
});
const doActionsPendingInit = () => {
for (const fn of actionsPendingInit) fn();

View file

@ -2554,7 +2554,7 @@ function Ace2Inner(editorInfo, cssManagers) {
let stopped = false;
inCallStackIfNecessary('handleKeyEvent', function () {
if (type === 'keypress' || (isTypeForSpecialKey && keyCode === 13 /* return*/)) {
if (type === 'keypress' || ((isTypeForSpecialKey && keyCode === 13) /* return*/)) {
// in IE, special keys don't send keypress, the keydown does the action
if (!outsideKeyPress(evt)) {
evt.preventDefault();

View file

@ -165,7 +165,7 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
});
};
const serverMessageTaskQueue = new class {
const serverMessageTaskQueue = new (class {
constructor() {
this._promiseChain = Promise.resolve();
}
@ -178,7 +178,7 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
// fn() throws/rejects (due to the .catch() added above).
return await taskPromise;
}
}();
})();
const handleMessageFromServer = (evt) => {
if (!getSocket()) return;
@ -371,7 +371,7 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
// is connected for the first time.
let deferredActions = [];
const defer = (func, tag) => function (...args) {
const defer = (func, tag) => (function(...args) {
const action = () => {
func.call(this, ...args);
};
@ -381,7 +381,7 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
} else {
action();
}
};
});
const doDeferredActions = (tag) => {
const newArray = [];

View file

@ -19,7 +19,7 @@
import {Cookies} from "./pad_utils";
exports.padcookie = new class {
exports.padcookie = new (class {
constructor() {
this.cookieName_ = window.location.protocol === 'https:' ? 'prefs' : 'prefsHttp';
}
@ -68,4 +68,4 @@ exports.padcookie = new class {
clear() {
this.writePrefs_({});
}
}();
})();

View file

@ -124,7 +124,7 @@ const syncAnimation = (() => {
};
})();
exports.padeditbar = new class {
exports.padeditbar = new (class {
constructor() {
this._editbarPosition = 0;
this.commands = {};
@ -479,4 +479,4 @@ exports.padeditbar = new class {
}
});
}
}();
})();

View file

@ -595,9 +595,7 @@
// Support: IE 9 - 11+
// IE doesn't have `contains` on SVG.
a.contains ?
a.contains( bup ) :
a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
(a.contains ? a.contains( bup ) : a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16)
) );
};

View file

@ -12,7 +12,7 @@ describe(__filename, function () {
beforeEach(async function () {
padId = common.randomString();
assert(!await padManager.doesPadExist(padId));
assert(!(await padManager.doesPadExist(padId)));
});
describe('exportEtherpadAdditionalContent', function () {

View file

@ -53,7 +53,7 @@ describe(__filename, function () {
beforeEach(async function () {
padId = randomString(10);
assert(!await padManager.doesPadExist(padId));
assert(!(await padManager.doesPadExist(padId)));
});
it('unknown db records are ignored', async function () {
@ -62,7 +62,7 @@ describe(__filename, function () {
[badKey]: 'value',
...makeExport(makeAuthorId()),
}));
assert(await db.get(badKey) == null);
assert((await db.get(badKey)) == null);
});
it('changes are all or nothing', async function () {
@ -71,8 +71,8 @@ describe(__filename, function () {
data['pad:differentPadId:revs:0'] = data['pad:testing:revs:0'];
delete data['pad:testing:revs:0'];
assert.rejects(importEtherpad.setPadRaw(padId, JSON.stringify(data)), /unexpected pad ID/);
assert(!await authorManager.doesAuthorExist(authorId));
assert(!await padManager.doesPadExist(padId));
assert(!(await authorManager.doesAuthorExist(authorId)));
assert(!(await padManager.doesPadExist(padId)));
});
describe('author pad IDs', function () {
@ -85,7 +85,7 @@ describe(__filename, function () {
assert.deepEqual((await authorManager.listPadsOfAuthor(existingAuthorId)).padIDs, []);
newAuthorId = makeAuthorId();
assert.notEqual(newAuthorId, existingAuthorId);
assert(!await authorManager.doesAuthorExist(newAuthorId));
assert(!(await authorManager.doesAuthorExist(newAuthorId)));
});
it('author does not yet exist', async function () {
@ -199,12 +199,12 @@ describe(__filename, function () {
...makeExport(makeAuthorId()),
'custom:testingx': 'x',
})), /unexpected pad ID/);
assert(await db.get(`custom:${padId}x`) == null);
assert((await db.get(`custom:${padId}x`)) == null);
await assert.rejects(importEtherpad.setPadRaw(padId, JSON.stringify({
...makeExport(makeAuthorId()),
'custom:testingx:foo': 'x',
})), /unexpected pad ID/);
assert(await db.get(`custom:${padId}x:foo`) == null);
assert((await db.get(`custom:${padId}x:foo`)) == null);
});
});
});

View file

@ -44,7 +44,7 @@ describe(__filename, function () {
describe('set', function () {
it('set of null is a no-op', async function () {
await set(null);
assert(await db.get(`sessionstorage:${sid}`) == null);
assert((await db.get(`sessionstorage:${sid}`)) == null);
});
it('set of non-expiring session', async function () {
@ -59,14 +59,14 @@ describe(__filename, function () {
assert.equal(JSON.stringify(await db.get(`sessionstorage:${sid}`)), JSON.stringify(sess));
await new Promise((resolve) => setTimeout(resolve, 110));
// Writing should start a timeout.
assert(await db.get(`sessionstorage:${sid}`) == null);
assert((await db.get(`sessionstorage:${sid}`)) == null);
});
it('set of already expired session', async function () {
const sess:any = {foo: 'bar', cookie: {expires: new Date(1)}};
await set(sess);
// No record should have been created.
assert(await db.get(`sessionstorage:${sid}`) == null);
assert((await db.get(`sessionstorage:${sid}`)) == null);
});
it('switch from non-expiring to expiring', async function () {
@ -75,7 +75,7 @@ describe(__filename, function () {
const sess2:any = {foo: 'bar', cookie: {expires: new Date(Date.now() + 100)}};
await set(sess2);
await new Promise((resolve) => setTimeout(resolve, 110));
assert(await db.get(`sessionstorage:${sid}`) == null);
assert((await db.get(`sessionstorage:${sid}`)) == null);
});
it('switch from expiring to non-expiring', async function () {
@ -90,7 +90,7 @@ describe(__filename, function () {
describe('get', function () {
it('get of non-existent entry', async function () {
assert(await get() == null);
assert((await get()) == null);
});
it('set+get round trip', async function () {
@ -111,14 +111,14 @@ describe(__filename, function () {
assert.equal(JSON.stringify(await get()), JSON.stringify(sess));
await new Promise((resolve) => setTimeout(resolve, 110));
// Reading should start a timeout.
assert(await db.get(`sessionstorage:${sid}`) == null);
assert((await db.get(`sessionstorage:${sid}`)) == null);
});
it('get of record from previous run (already expired)', async function () {
const sess = {foo: 'bar', cookie: {expires: new Date(1)}};
await db.set(`sessionstorage:${sid}`, sess);
assert(await get() == null);
assert(await db.get(`sessionstorage:${sid}`) == null);
assert((await get()) == null);
assert((await db.get(`sessionstorage:${sid}`)) == null);
});
it('external expiration update is picked up', async function () {
@ -151,7 +151,7 @@ describe(__filename, function () {
const sess:any = {cookie: {expires: new Date(Date.now() + 100)}};
await set(sess);
await destroy();
assert(await db.get(`sessionstorage:${sid}`) == null);
assert((await db.get(`sessionstorage:${sid}`)) == null);
});
it('destroy cancels the timeout', async function () {

View file

@ -131,7 +131,7 @@ describe(__filename, function () {
.expect((res:any) => {
assert.equal(res.body.code, 0);
});
assert(await db.get(`mapper2group:${mapper}`) == null);
assert((await db.get(`mapper2group:${mapper}`)) == null);
});
// Test coverage for https://github.com/ether/etherpad-lite/issues/4227

View file

@ -27,7 +27,7 @@ describe(__filename, function () {
backups.hooks = {handleMessageSecurity: plugins.hooks.handleMessageSecurity};
plugins.hooks.handleMessageSecurity = [];
padId = common.randomString();
assert(!await padManager.doesPadExist(padId));
assert(!(await padManager.doesPadExist(padId)));
pad = await padManager.getPad(padId, 'dummy text\n');
await pad!.setText('\n'); // Make sure the pad is created.
assert.equal(pad!.text(), '\n');
@ -57,7 +57,7 @@ describe(__filename, function () {
describe('CHANGESET_REQ', function () {
it('users are unable to read changesets from other pads', async function () {
const otherPadId = `${padId}other`;
assert(!await padManager.doesPadExist(otherPadId));
assert(!(await padManager.doesPadExist(otherPadId)));
const otherPad = await padManager.getPad(otherPadId, 'other text\n');
try {
await otherPad.setText('other text\n');
@ -84,7 +84,7 @@ describe(__filename, function () {
it('CHANGESET_REQ: verify revNum is a number (regression)', async function () {
const otherPadId = `${padId}other`;
assert(!await padManager.doesPadExist(otherPadId));
assert(!(await padManager.doesPadExist(otherPadId)));
const otherPad = await padManager.getPad(otherPadId, 'other text\n');
let errorCatched = 0;
try {
@ -113,7 +113,7 @@ describe(__filename, function () {
it('CHANGESET_REQ: revNum is converted to number if possible (regression)', async function () {
const otherPadId = `${padId}other`;
assert(!await padManager.doesPadExist(otherPadId));
assert(!(await padManager.doesPadExist(otherPadId)));
const otherPad = await padManager.getPad(otherPadId, 'other text\n');
try {
await otherPad.setText('other text\n');
@ -140,7 +140,7 @@ describe(__filename, function () {
it('CHANGESET_REQ: revNum 2 is converted to head rev 1 (regression)', async function () {
const otherPadId = `${padId}other`;
assert(!await padManager.doesPadExist(otherPadId));
assert(!(await padManager.doesPadExist(otherPadId)));
const otherPad = await padManager.getPad(otherPadId, 'other text\n');
try {
await otherPad.setText('other text\n');

View file

@ -358,7 +358,7 @@ describe(__filename, function () {
const connected = new Promise((resolve) => resolveConnected = resolve);
let resolveDisconnected: (value: void | PromiseLike<void>) => void ;
const disconnected = new Promise<void>((resolve) => resolveDisconnected = resolve);
socketIoRouter.addComponent(this.test!.fullTitle(), new class extends Module {
socketIoRouter.addComponent(this.test!.fullTitle(), new (class extends Module {
private _socket: any;
handleConnect(socket:any) {
this._socket = socket;
@ -371,7 +371,7 @@ describe(__filename, function () {
assert.equal(socket, this._socket);
resolveDisconnected();
}
}());
})());
socket = await common.connect();
await connected;
socket.close();
@ -387,13 +387,13 @@ describe(__filename, function () {
};
let rx:Function;
const got = new Promise((resolve) => { rx = resolve; });
socketIoRouter.addComponent(this.test!.fullTitle(), new class extends Module {
socketIoRouter.addComponent(this.test!.fullTitle(), new (class extends Module {
handleConnect(socket:any) { serverSocket = socket; }
handleMessage(socket:any, message:string) { assert.equal(socket, serverSocket); rx(message); }
}());
socketIoRouter.addComponent(`${this.test!.fullTitle()} #2`, new class extends Module {
})());
socketIoRouter.addComponent(`${this.test!.fullTitle()} #2`, new (class extends Module {
handleMessage(socket:any, message:any) { assert.fail('wrong handler called'); }
}());
})());
socket = await common.connect();
socket.emit('message', want);
assert.deepEqual(await got, want);

View file

@ -85,7 +85,7 @@ export const isChatBoxSticky = async (page: Page):Promise<boolean> => {
}
export const hideChat = async (page: Page) => {
if(!await isChatBoxShown(page)|| await isChatBoxSticky(page)) return
if(!(await isChatBoxShown(page))|| (await isChatBoxSticky(page))) return
await page.locator('#titlecross').click()
await page.waitForFunction(`!document.querySelector('#chatbox').classList.contains('stickyChat')`)
@ -98,7 +98,7 @@ export const enableStickyChatviaIcon = async (page: Page) => {
}
export const disableStickyChatviaIcon = async (page: Page) => {
if(!await isChatBoxSticky(page)) return
if(!(await isChatBoxSticky(page))) return
await page.locator('#titlecross').click()
await page.waitForFunction(`!document.querySelector('#chatbox').classList.contains('stickyChat')`)
}

View file

@ -13,7 +13,7 @@ export const showSettings = async (page: Page) => {
}
export const hideSettings = async (page: Page) => {
if(!await isSettingsShown(page)) return
if(!(await isSettingsShown(page))) return
await page.locator("button[data-l10n-id='pad.toolbar.settings.title']").click()
await page.waitForFunction(`!document.querySelector('#settings').classList.contains('popup-show')`)
}

View file

@ -218,7 +218,7 @@ const helper = {};
const check = async () => {
try {
if (!await conditionFunc()) return;
if (!(await conditionFunc())) return;
deferred.resolve();
} catch (err) {
deferred.reject(err);