diff --git a/src/api.ts b/src/api.ts index cbc7fe9..8ad0e77 100644 --- a/src/api.ts +++ b/src/api.ts @@ -93,9 +93,9 @@ function readHTML(html: string): uniteApiData { }; //filter down to just ones named "og:..." - metaElems = metaElems.filter((el: cheerio.Element) => el.attribs.property?.startsWith('og:')); + metaElems = metaElems.filter(el => el.attribs.property?.startsWith('og:')); - metaElems.forEach((el: cheerio.Element) => { + metaElems.forEach(el => { let attr = el.attribs; if (attr.property === 'og:title') { @@ -107,7 +107,7 @@ function readHTML(html: string): uniteApiData { } else if (attr.property === 'og:description') { //all lines - let lines = attr.content.split('\n').map((l: string) => l.trim()), + let lines = attr.content.split('\n').map(l => l.trim()), extraLines: string[] = []; //ensure first line is correct @@ -162,9 +162,9 @@ function readHTML(html: string): uniteApiData { lines.shift(); //rest of lines - lines.forEach((line: string) => { + lines.forEach(line => { - let split = line.split(':').map((l: string) => l.trim()), + let split = line.split(':').map(l => l.trim()), key = split[0].toLowerCase().replace(/[^\w]/g, ''), value = split[1];