youtubei.js / Parser / parseItem
Function: parseItem()
parseItem(data, validTypes)
parseItem<
T
,K
>(data
,validTypes
):InstanceType
<K
[number
]> |null
Parses a single item.
Type Parameters
• T extends YTNode
• K extends YTNodeConstructor
<T
>[]
Parameters
• data: undefined
| RawNode
The data to parse.
• validTypes: K
YTNode types that are allowed to be parsed.
Returns
InstanceType
<K
[number
]> | null
Defined in
parseItem(data, validTypes)
parseItem<
T
>(data
,validTypes
):T
|null
Type Parameters
• T extends YTNode
Parameters
• data: undefined
| RawNode
• validTypes: YTNodeConstructor
<T
>
Returns
T
| null
Defined in
parseItem(data)
parseItem(
data
?):YTNode
Parameters
• data?: RawNode