Files
YouTube.js/src/parser/classes/DidYouMean.ts
Patrick Kan c99364942c fix: DidYouMean endpoints and add text prop (#158)
* feat: add `text` to `DidYouMean`

* fix: parse correct endpoint in `DidYouMean`
2022-08-30 05:10:51 -03:00

20 lines
549 B
TypeScript

import Text from './misc/Text';
import NavigationEndpoint from './NavigationEndpoint';
import { YTNode } from '../helpers';
class DidYouMean extends YTNode {
static type = 'DidYouMean';
text: string;
corrected_query: Text;
endpoint: NavigationEndpoint;
constructor(data: any) {
super();
this.text = new Text(data.didYouMean).toString();
this.corrected_query = new Text(data.correctedQuery);
this.endpoint = new NavigationEndpoint(data.navigationEndpoint || data.correctedQueryEndpoint);
}
}
export default DidYouMean;