1
Fork 0

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
1 changed files with 1 additions and 1 deletions

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);