the link string on response objects conflicts with the String.link() function
Closed this issue · 4 comments
shidemuri commented
Im using node v14.18.0 and when i try call the link string from a response object it returns the String.link() function instead
A solution to this could be replacing all "links" with "url"
DrKain commented
Can you provide an example of the conflict?
shidemuri commented
const results = await youtube.search(url, {type: "video"})
const videos = []
for(const a in results.videos) videos.push(a.url) //a.url returns [Function: link]
DrKain commented
There is no conflict. The issue is in your for...
loop.
It should be:
for(const a of results.videos)
instead of:
for(const a in results.videos)
shidemuri commented
oh makes sense now, that in and of thing is easy to mess up