Unify lodash imports

We currently use all three ways of importing lodash.
The one that provides us with the smalles bundle size is.

```
import isEqual from "lodash/isEqual";
```

So we should use that everywhere
This commit is contained in:
Sebastian Martinez
2023-11-28 09:25:13 +01:00
parent b107b43ad0
commit 575f44e434
7 changed files with 12 additions and 8 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
import type { HttpdClient } from "@httpd-client";
import { expect } from "vitest";
import { isMatch } from "lodash";
import isMatch from "lodash/isMatch";
import { cobRid } from "@tests/support/fixtures";
+1 -1
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import { debounce } from "lodash";
import debounce from "lodash/debounce";
export let disabled: boolean = false;
+1 -1
View File
@@ -23,7 +23,7 @@
import type { Embed } from "@app/lib/file";
import * as utils from "@app/lib/utils";
import { partial } from "lodash";
import partial from "lodash/partial";
import { tick } from "svelte";
import CommentComponent from "@app/components/Comment.svelte";
+1 -1
View File
@@ -1,7 +1,7 @@
<script lang="ts">
import IconSmall from "@app/components/IconSmall.svelte";
import { isEqual } from "lodash";
import isEqual from "lodash/isEqual";
import { closeFocused } from "@app/components/Popover.svelte";
+3 -1
View File
@@ -3,7 +3,9 @@
import type { Embed } from "@app/lib/file";
import type { Session } from "@app/lib/httpd";
import { isEqual, uniqBy, partial } from "lodash";
import isEqual from "lodash/isEqual";
import uniqBy from "lodash/uniqBy";
import partial from "lodash/partial";
import * as modal from "@app/lib/modal";
import * as role from "@app/lib/roles";
+3 -1
View File
@@ -46,7 +46,9 @@
import * as router from "@app/lib/router";
import * as utils from "@app/lib/utils";
import { HttpdClient } from "@httpd-client";
import { capitalize, isEqual, partial } from "lodash";
import capitalize from "lodash/capitalize";
import isEqual from "lodash/isEqual";
import partial from "lodash/partial";
import { httpdStore, type Session } from "@app/lib/httpd";
import Badge from "@app/components/Badge.svelte";
+2 -2
View File
@@ -8,7 +8,7 @@ import * as Path from "node:path";
import * as Stream from "node:stream";
import * as Util from "node:util";
import getPort from "get-port";
import lodash from "lodash";
import matches from "lodash/matches.js";
import waitOn from "wait-on";
import { execa } from "execa";
import * as readline from "node:readline/promises";
@@ -189,7 +189,7 @@ export class RadiclePeer {
// eslint-disable-next-line no-constant-condition
while (true) {
if (this.#eventRecords.find(lodash.matches(searchEvent))) {
if (this.#eventRecords.find(matches(searchEvent))) {
return;
}
if (new Date().getTime() - start > timeoutInMs) {