lunr-core icon indicating copy to clipboard operation
lunr-core copied to clipboard

[BUG] ambiguous JSON serialization options leave possibility for data loss

Open danielcrenna opened this issue 5 years ago • 0 comments

To Reproduce ToJson and SaveToJsonStream allow passing optional JsonSerializerSettings. LoadFromJson and LoadFromJsonStream do not allow passing an optional JsonSerializerSettings.

Expected behavior In the above scenario it's possible to serialize an index in a way that is not reversible when loading the same index later. In addition there are no unit tests for ToJson with the accompanying options, so it's unclear whether the correct intention is not to have options, or to have options for both sets of methods.

It seems that it might be easier to remove the options to ensure the index is compliant with lunr-js, but I'm not sure, and so haven't added a pull request.

danielcrenna avatar Oct 08 '20 04:10 danielcrenna