1
Fork 0
mirror of https://github.com/jech/galene.git synced 2024-12-22 23:35:46 +01:00

Make type of array of objects compatible with JSDoc and TSDoc.

The best TSDoc type is (Text|HTMLElement)[], but to JSDoc the array is
not distributive. JSDoc prefers Text[]|HTMLElement[], but TSDoc
rejects that syntax. In the end, both are fine with
Array.<Text|HTMLElement>.
This commit is contained in:
Antonin Décimo 2020-12-01 18:18:58 +01:00 committed by Juliusz Chroboczek
parent 22f9442cf4
commit 59507c811f

View file

@ -1446,7 +1446,7 @@ const urlRegexp = /https?:\/\/[-a-zA-Z0-9@:%/._\\+~#&()=?]+[-a-zA-Z0-9@:%/_\\+~#
/**
* @param {string} line
* @returns {(Text|HTMLElement)[]}
* @returns {Array.<Text|HTMLElement>}
*/
function formatLine(line) {
let r = new RegExp(urlRegexp);