Skip to content

Commit

Permalink
chore: better TypeScript types
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Mar 14, 2021
1 parent acafa0e commit d174d86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/cluster/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ class Cluster extends EventEmitter {

const Promise = PromiseContainer.get();
if (status === "wait") {
const ret = asCallback(Promise.resolve("OK"), callback);
const ret = asCallback(Promise.resolve<"OK">("OK"), callback);

// use setImmediate to make sure "close" event
// being emitted after quit() is returned
Expand Down
3 changes: 2 additions & 1 deletion lib/redis/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
ReconnectOnError,
DEFAULT_REDIS_OPTIONS,
} from "./RedisOptions";
import { NetStream } from "../types";

const debug = Debug("redis");

Expand Down Expand Up @@ -317,7 +318,7 @@ Redis.prototype.connect = function (callback) {
asCallback(
this.connector.connect(function (type, err) {
_this.silentEmit(type, err);
}),
}) as Promise<NetStream>,
function (err, stream) {
if (err) {
_this.flushQueue(err);
Expand Down

0 comments on commit d174d86

Please sign in to comment.