youtubei.js / Parser / parse
Function: parse()
parse(data, requireArray, validTypes)
parse<
T
,K
>(data
,requireArray
,validTypes
?):ObservedArray
<InstanceType
<K
[number
]>> |null
Parses an item or an array of items.
Type Parameters
• T extends YTNode
• K extends YTNodeConstructor
<T
>[]
Parameters
• data: RawData
The data to parse.
• requireArray: true
Whether the data should be parsed as an array.
• validTypes?: K
YTNode types that are allowed to be parsed.
Returns
ObservedArray
<InstanceType
<K
[number
]>> | null
Defined in
parse(data, requireArray, validTypes)
parse<
T
,K
>(data
,requireArray
,validTypes
?):ObservedArray
<InstanceType
<K
>> |null
Type Parameters
• T extends YTNode
• K extends YTNodeConstructor
<T
>
Parameters
• data: RawData
• requireArray: true
• validTypes?: K
Returns
ObservedArray
<InstanceType
<K
>> | null
Defined in
parse(data, requireArray, validTypes)
parse<
T
>(data
?,requireArray
?,validTypes
?):SuperParsedResult
<T
>
Type Parameters
Parameters
• data?: RawData
• requireArray?: false
• validTypes?: YTNodeConstructor
<T
> | YTNodeConstructor
<T
>[]