BugDomain: lib.d.tsHelp Wanted
Métriques du dépôt
- Stars
- (48 455 stars)
- Métriques de merge PR
- (Merge moyen 6j 17h) (9 PRs mergées en 30 j)
Description
lib Update Request
Configuration Check
I'm using VS-Code with Typescript Version 4.7.0-dev.20220323 installed in local repo.
Missing / Incorrect Descriptions
HTMLMetaElement properties:
- name
- content
- httpEquiv
- media
Sample Code
<!DOCTYPE html>
<html lang="en">
<head>
<!-- meta tags for social media-->
<meta name="title" content="blabla">
…
</head>
<body>
…
</body>
</html>
/**
* `getElementsByTagName` returns a {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLCollection HTMLCollection},\
* which is an `Array-like` object similar to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/arguments arguments},\
* therefore we need to convert it to a real {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array Array},\
* containing {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLMetaElement HTMLMetaElement}'s,\
* to be able to use Array-Methods on it.
*/
const metaTitle = [...document.head.getElementsByTagName('meta')]
.find(meta => meta.name === 'title')
,origTitle = metaTitle?.content
document.title = metaTitle ? `${origTitle}${extraText}` : 'someOtherText'
In VS-Code hover-over the name/content properties in above code.
nameIt should display something similar to: Gets or sets the value of thenameproperty of the element.contentIt should display something similar to: Gets or sets the value of thecontentproperty of the element.- The other mentioned properties have similar issues.
Documentation Link
- Web: HTMLMetaElement@mdn.
- Repo: HTMLMetaElement@mdn-content.