Skip to content

Commit

Permalink
fix: better support for CJS importing
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Mar 14, 2022
1 parent aa3b3e9 commit 687d3eb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
12 changes: 5 additions & 7 deletions lib/Redis.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import { EventEmitter } from "events";
import * as commands from "redis-commands";
import asCallback from "standard-as-callback";
import {
AbstractConnector,
Cluster,
Command,
ScanStream,
SentinelConnector,
} from ".";
import Cluster from "./cluster";
import Command from "./command";
import { StandaloneConnector } from "./connectors";
import AbstractConnector from "./connectors/AbstractConnector";
import SentinelConnector from "./connectors/SentinelConnector";
import * as eventHandler from "./redis/event_handler";
import {
DEFAULT_REDIS_OPTIONS,
ReconnectOnError,
RedisOptions,
} from "./redis/RedisOptions";
import ScanStream from "./ScanStream";
import { addTransactionSupport, Transaction } from "./transaction";
import {
Callback,
Expand Down
2 changes: 1 addition & 1 deletion lib/cluster/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { EventEmitter } from "events";
import * as commands from "redis-commands";
import { AbortError, RedisError } from "redis-errors";
import asCallback from "standard-as-callback";
import { Pipeline } from "..";
import Pipeline from "../pipeline";
import Command from "../command";
import ClusterAllFailedError from "../errors/ClusterAllFailedError";
import Redis from "../Redis";
Expand Down
5 changes: 2 additions & 3 deletions lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Redis from "./Redis";
exports = module.exports = require("./Redis").default;

export { default } from "./Redis";
export { default as Cluster } from "./cluster";

/**
Expand Down Expand Up @@ -64,5 +65,3 @@ export function print(err: Error | null, reply?: any) {
console.log("Reply: " + reply);
}
}

export default Redis;
3 changes: 2 additions & 1 deletion lib/pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import * as calculateSlot from "cluster-key-slot";
import { exists, hasFlag } from "redis-commands";
import asCallback from "standard-as-callback";
import { deprecate } from "util";
import Redis, { Cluster } from ".";
import Redis from "./Redis";
import Cluster from "./cluster";
import Command from "./command";
import { Callback, PipelineWriteableStream } from "./types";
import { noop } from "./utils";
Expand Down

0 comments on commit 687d3eb

Please sign in to comment.