You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Better to remove getFn in keys when calling FuseIndex.toJSON #798
FuseIndex<T>.toJSON() keeps getFn in keys, as a result, the returned object can not be write to IndexedDB directly because of the following error:
DataCloneError: Function object could not be cloned.
Considering that functions in object will be removed when calling JSON.stringify(), the getFn function seems do nothing when parseIndex later. So I think it may be better to just remove it when calling FuseIndex.toJSON.
Besides, there's no v7.1.0 in The Fuse.js version where this bug is happening.* of issue form.
changed the title [-]FuseIndex.toJSON wrong type of keys ReadonlyArray<string>; also may be better to remove getFn when toJSON[/-][+]Better to remove getFn in keys when calling FuseIndex.toJSON[/+]on Apr 9, 2025
Activity
[-]FuseIndex.toJSON wrong type of keys ReadonlyArray<string>; also may be better to remove getFn when toJSON[/-][+]Better to remove getFn in keys when calling FuseIndex.toJSON[/+]bin16 commentedon Apr 9, 2025
Oh sorry, there's already another issue reports
ReadonlyArray<string>problem. Let's just focus on the advice of removinggetFnwhen calling toJSON.Title edited, but i can not edit tags.
github-actions commentedon Aug 8, 2025
This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 30 days
fix(index): strip getFn from keys in toJSON() for safe serialization
docs: update TODO after triaging bugs
krisk commentedon Apr 2, 2026
Fixed in 0f2a69b.
toJSON()now stripsgetFnfrom keys, so the result is safe forstructuredClone, IndexedDB,JSON.stringify, etc.