You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-07 13:22:56 +03:00
buffers, buffers everywhere...
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { RedisCommandArguments } from '@node-redis/client/dist/lib/commands';
|
||||
import { pushVerdictArgument, transformReplyStringTuples } from '@node-redis/client/dist/lib/commands/generic-transformers';
|
||||
import { AggregateReply, PropertyName, pushArgumentsWithLength, pushSortByArguments, SortByProperty } from '.';
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '@node-redis/client/dist/lib/commands';
|
||||
import { pushVerdictArgument, transformTuplesReply } from '@node-redis/client/dist/lib/commands/generic-transformers';
|
||||
import { PropertyName, pushArgumentsWithLength, pushSortByArguments, SortByProperty } from '.';
|
||||
|
||||
export enum AggregateSteps {
|
||||
GROUPBY = 'GROUPBY',
|
||||
@@ -273,14 +273,19 @@ function pushGroupByReducer(args: RedisCommandArguments, reducer: GroupByReducer
|
||||
|
||||
export type AggregateRawReply = [
|
||||
total: number,
|
||||
...results: Array<Array<string>>
|
||||
...results: Array<Array<RedisCommandArgument>>
|
||||
];
|
||||
|
||||
export interface AggregateReply {
|
||||
total: number;
|
||||
results: Array<Record<string, RedisCommandArgument>>;
|
||||
}
|
||||
|
||||
export function transformReply(rawReply: AggregateRawReply): AggregateReply {
|
||||
const results: Array<Record<string, string>> = [];
|
||||
const results: Array<Record<string, RedisCommandArgument>> = [];
|
||||
for (let i = 1; i < rawReply.length; i++) {
|
||||
results.push(
|
||||
transformReplyStringTuples(rawReply[i] as Array<string>)
|
||||
transformTuplesReply(rawReply[i] as Array<RedisCommandArgument>)
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { RedisCommandArguments } from '@node-redis/client/dist/lib/commands';
|
||||
import { transformReplyStringTuples } from '@node-redis/client/dist/lib/commands/generic-transformers';
|
||||
import { transformTuplesReply } from '@node-redis/client/dist/lib/commands/generic-transformers';
|
||||
import { pushSearchOptions, RedisSearchLanguages, PropertyName, SortByProperty, SearchReply } from '.';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
@@ -76,7 +76,7 @@ export function transformReply(reply: SearchRawReply): SearchReply {
|
||||
id: reply[i],
|
||||
value: tuples.length === 2 && tuples[0] === '$' ?
|
||||
JSON.parse(tuples[1]) :
|
||||
transformReplyStringTuples(tuples)
|
||||
transformTuplesReply(tuples)
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -2,4 +2,4 @@ export function transformArguments(key: string, string: string): Array<string> {
|
||||
return ['FT.SUGDEL', key, string];
|
||||
}
|
||||
|
||||
export { transformReplyBoolean as transformReply } from '@node-redis/client/dist/lib/commands/generic-transformers';
|
||||
export { transformBooleanReply as transformReply } from '@node-redis/client/dist/lib/commands/generic-transformers';
|
||||
|
@@ -396,10 +396,6 @@ export interface SearchReply {
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface AggregateReply {
|
||||
total: number;
|
||||
results: Array<Record<string, string>>;
|
||||
}
|
||||
|
||||
export interface ProfileOptions {
|
||||
LIMITED?: true;
|
||||
@@ -420,8 +416,8 @@ export type ProfileRawReply<T> = [
|
||||
];
|
||||
|
||||
export interface ProfileReply {
|
||||
results: SearchReply | AggregateReply,
|
||||
profile: ProfileData
|
||||
results: SearchReply | AGGREGATE.AggregateReply;
|
||||
profile: ProfileData;
|
||||
}
|
||||
|
||||
interface ChildIterator {
|
||||
|
@@ -4,6 +4,9 @@
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"files": [
|
||||
"dist/"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "nyc -r text-summary -r lcov mocha -r source-map-support/register -r ts-node/register './lib/**/*.spec.ts'",
|
||||
"build": "tsc",
|
||||
@@ -15,12 +18,12 @@
|
||||
"devDependencies": {
|
||||
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
||||
"@node-redis/test-utils": "*",
|
||||
"@types/node": "^16.11.12",
|
||||
"@types/node": "^17.0.1",
|
||||
"nyc": "^15.1.0",
|
||||
"release-it": "^14.11.8",
|
||||
"source-map-support": "^0.5.21",
|
||||
"ts-node": "^10.4.0",
|
||||
"typedoc": "^0.22.10",
|
||||
"typescript": "^4.5.3"
|
||||
"typescript": "^4.5.4"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user