UNPKG

1.98 kBJavaScriptView Raw
1"use strict";
2var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3 if (k2 === undefined) k2 = k;
4 var desc = Object.getOwnPropertyDescriptor(m, k);
5 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6 desc = { enumerable: true, get: function() { return m[k]; } };
7 }
8 Object.defineProperty(o, k2, desc);
9}) : (function(o, m, k, k2) {
10 if (k2 === undefined) k2 = k;
11 o[k2] = m[k];
12}));
13var __exportStar = (this && this.__exportStar) || function(m, exports) {
14 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15};
16Object.defineProperty(exports, "__esModule", { value: true });
17exports.createCluster = exports.createClient = void 0;
18const client_1 = require("@redis/client");
19const bloom_1 = require("@redis/bloom");
20const graph_1 = require("@redis/graph");
21const json_1 = require("@redis/json");
22const search_1 = require("@redis/search");
23const time_series_1 = require("@redis/time-series");
24__exportStar(require("@redis/client"), exports);
25__exportStar(require("@redis/bloom"), exports);
26__exportStar(require("@redis/graph"), exports);
27__exportStar(require("@redis/json"), exports);
28__exportStar(require("@redis/search"), exports);
29__exportStar(require("@redis/time-series"), exports);
30const modules = {
31 ...bloom_1.default,
32 graph: graph_1.default,
33 json: json_1.default,
34 ft: search_1.default,
35 ts: time_series_1.default
36};
37function createClient(options) {
38 return (0, client_1.createClient)({
39 ...options,
40 modules: {
41 ...modules,
42 ...options?.modules
43 }
44 });
45}
46exports.createClient = createClient;
47function createCluster(options) {
48 return (0, client_1.createCluster)({
49 ...options,
50 modules: {
51 ...modules,
52 ...options?.modules
53 }
54 });
55}
56exports.createCluster = createCluster;