Open regorxxx opened 1 year ago
console.log('null', fb.GetQueryItems(fb.GetLibraryItems(), null))
console.log('""', fb.GetQueryItems(fb.GetLibraryItems(), ""))
console.log('void(0)', fb.GetQueryItems(fb.GetLibraryItems(), void(0)))
console.log('{}', fb.GetQueryItems(fb.GetLibraryItems(), {}))
console.log('Boolean', fb.GetQueryItems(fb.GetLibraryItems(), true))
null FbMetadbHandleList {Count=1, ...} "" FbMetadbHandleList {Count=0, ...} void(0) FbMetadbHandleList {Count=0, ...} {} FbMetadbHandleList {Count=0, ...} Boolean FbMetadbHandleList {Count=133, ...}
Well the conversion does affect other types... boolean values being converted to string 'true'/'false', etc.
Considering the recommended practice is to wrap the GetQueryItems method with try/catch to check for invalid queries... if those use-cases don't throw, it's a call for problems.
Blank panel:
console.log(fb.GetQueryItems(fb.GetLibraryItems(), null))
Will return any track with "null" on title, album, etc. instead of throwing an error or returning nothing (like passing undefined)). Null should not be parsed as a string in any case.