Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: JS: Improve error handling of batch addition
Crash if there is an error in batch addition. Example: ``` const usearch = require('usearch'); const index = new usearch.Index({ metric: 'l2sq', connectivity: 16, dimensions: 3 }); index.add(42n, new Float32Array([0.2, 0.6, 0.4])); index.add( [41n, 42n, 43n], [[0.1, 0.6, 0.4], [0.2, 0.6, 0.4], [0.3, 0.6, 0.4]] ) ``` `42n` is duplicated, which causes an error, but then it crash. It seems that it is not better to throw an exception during the process, so we changed it to throw it after it is completed.
- Loading branch information