Skip to content

Commit 2caaa66

Browse files
Replace lodash with lodash-es (#2476)
## Checklist - [/] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [/] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [/] I have not broken the cheatsheet --------- Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
1 parent aad9354 commit 2caaa66

File tree

92 files changed

+120
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+120
-107
lines changed

packages/common/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
"author": "",
1717
"license": "MIT",
1818
"dependencies": {
19-
"lodash": "^4.17.21",
19+
"lodash-es": "^4.17.21",
2020
"vscode-uri": "^3.0.8"
2121
},
2222
"devDependencies": {
2323
"@types/chai": "^4.3.14",
2424
"@types/js-yaml": "^4.0.9",
25-
"@types/lodash": "4.17.0",
25+
"@types/lodash-es": "4.17.0",
2626
"@types/mocha": "^10.0.6",
2727
"@types/sinon": "^17.0.3",
2828
"chai": "^5.1.0",

packages/common/src/ide/fake/FakeConfiguration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { get } from "lodash";
1+
import { get } from "lodash-es";
22
import { Notifier } from "../../util/Notifier";
33
import {
44
Configuration,

packages/common/src/ide/fake/FakeIDE.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { pull } from "lodash";
1+
import { pull } from "lodash-es";
22
import type { EditableTextEditor, TextEditor } from "../..";
33
import { GeneralizedRange } from "../../types/GeneralizedRange";
44
import { TextDocument } from "../../types/TextDocument";

packages/common/src/ide/spy/SpyIDE.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { pickBy, values } from "lodash";
1+
import { pickBy, values } from "lodash-es";
22
import { GeneralizedRange } from "../../types/GeneralizedRange";
33
import { TextEditor } from "../../types/TextEditor";
44
import PassthroughIDEBase from "../PassthroughIDEBase";

packages/common/src/testUtil/getScopeTestPathsRecursively.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { readFileSync } from "node:fs";
2-
import { groupBy, type Dictionary } from "lodash";
2+
import { groupBy } from "lodash-es";
33
import {
44
getScopeTestConfigPaths,
55
getScopeTestPaths,
@@ -58,7 +58,7 @@ export function getScopeTestPathsRecursively(): ScopeTestPath[] {
5858
}
5959

6060
function addTestPathsForLanguageRecursively(
61-
languages: Dictionary<ScopeTestPath[]>,
61+
languages: Record<string, ScopeTestPath[]>,
6262
configs: Record<string, ScopeTestConfig | undefined>,
6363
result: ScopeTestPath[],
6464
usedLanguageIds: Set<string>,

packages/common/src/testUtil/runRecordedTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
storedTargetKeys,
3131
} from "@cursorless/common";
3232
import { assert } from "chai";
33-
import { isUndefined } from "lodash";
33+
import { isUndefined } from "lodash-es";
3434
import { promises as fsp } from "node:fs";
3535
import { getSnapshotForComparison } from "./getSnapshotForComparison";
3636

packages/common/src/util/Notifier.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { pull } from "lodash";
1+
import { pull } from "lodash-es";
22
import type { Disposable } from "../ide/types/ide.types";
33

44
type Arr = readonly unknown[];

packages/common/src/util/omitByDeep.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isPlainObject } from "lodash";
1+
import { isPlainObject } from "lodash-es";
22

33
/**
44
* Like lodash.omitBy, but also omits values from nested objects

packages/common/src/util/range.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { range as lodashRange } from "lodash";
1+
import { range as lodashRange } from "lodash-es";
22
import { Range } from "../types/Range";
33
import { TextEditor } from "../types/TextEditor";
44

packages/common/src/util/uniqWithHash.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as assert from "assert";
22
import * as fc from "fast-check";
3-
import { uniqWith } from "lodash";
3+
import { uniqWith } from "lodash-es";
44
import { uniqWithHash } from "./uniqWithHash";
55

66
// known good but slow (quadratic!)

0 commit comments

Comments
 (0)