Skip to content

Commit

Permalink
deps: migrate lodash-es to @std/{collections,random}
Browse files Browse the repository at this point in the history
  • Loading branch information
uki00a committed Nov 4, 2024
1 parent 36acc3b commit 503e59f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
14 changes: 9 additions & 5 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions deps/lodash-es.js

This file was deleted.

1 change: 1 addition & 0 deletions deps/std/collections.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { distinctBy } from "jsr:@std/collections@^1//distinct-by";
2 changes: 2 additions & 0 deletions deps/std/random.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { sample } from "jsr:@std/[email protected]/sample";
export { shuffle } from "jsr:@std/[email protected]/shuffle";
5 changes: 3 additions & 2 deletions experimental/cluster/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ import type { Redis } from "../../redis.ts";
import type { RedisReply, RedisValue } from "../../protocol/shared/types.ts";
import { ErrorReplyError } from "../../errors.ts";
import { delay } from "../../deps/std/async.ts";
import { distinctBy } from "../../deps/std/collections.ts";
import { sample, shuffle } from "../../deps/std/random.ts";
import { calculateSlot } from "../../deps/cluster-key-slot.js";
import { sample, shuffle, uniqBy } from "../../deps/lodash-es.js";

export interface ClusterConnectOptions {
nodes: Array<NodeOptions>;
Expand Down Expand Up @@ -230,7 +231,7 @@ class ClusterExecutor implements CommandExecutor {
this.#startupNodes.push(node);
}

this.#startupNodes = uniqBy(
this.#startupNodes = distinctBy(
this.#startupNodes,
(node: ClusterNode) => node.name,
);
Expand Down
2 changes: 1 addition & 1 deletion tests/cluster/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import {
assertEquals,
assertRejects,
} from "../../deps/std/assert.ts";
import { sample } from "../../deps/std/random.ts";
import {
afterAll,
afterEach,
beforeAll,
describe,
it,
} from "../../deps/std/testing.ts";
import { sample } from "../../deps/lodash-es.js";
import { calculateSlot } from "../../deps/cluster-key-slot.js";
import { ErrorReplyError } from "../../errors.ts";
import { connect, create } from "../../redis.ts";
Expand Down

0 comments on commit 503e59f

Please sign in to comment.