1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

Chore: Removed lodash package to save space

This commit is contained in:
Laurent Cozic
2022-05-26 15:57:44 +01:00
parent 63b3115d3b
commit 91df23e959
19 changed files with 63 additions and 47 deletions

View File

@@ -19,6 +19,13 @@ describe('ArrayUtils', function() {
expect(a.length).toBe(3);
}));
it('should pull array elements', (async () => {
expect(ArrayUtils.pull(['a', 'b', 'c', 'a', 'b', 'c'], 'a')).toEqual(['b', 'c', 'b', 'c']);
expect(ArrayUtils.pull(['b', 'c', 'b', 'c'], 'a')).toEqual(['b', 'c', 'b', 'c']);
expect(ArrayUtils.pull(['a', 'b', 'c', 'a', 'b', 'c'], 'a', 'c')).toEqual(['b', 'b']);
expect(ArrayUtils.pull([], 'a')).toEqual([]);
}));
it('should find items using binary search', (async () => {
let items = ['aaa', 'ccc', 'bbb'];
expect(ArrayUtils.binarySearch(items, 'bbb')).toBe(-1); // Array not sorted!