You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
buffers, buffers everywhere...
This commit is contained in:
@@ -1,20 +1,25 @@
|
||||
import { RedisCommandArguments } from '.';
|
||||
import { RedisCommandArgument, RedisCommandArguments } from '.';
|
||||
import { pushVerdictArguments } from './generic-transformers';
|
||||
|
||||
export const FIRST_KEY_INDEX = 1;
|
||||
|
||||
export const IS_READ_ONLY = true;
|
||||
|
||||
export function transformArguments(key: string, member: string | Array<string>): RedisCommandArguments {
|
||||
export function transformArguments(
|
||||
key: RedisCommandArgument,
|
||||
member: RedisCommandArgument | Array<RedisCommandArgument>
|
||||
): RedisCommandArguments {
|
||||
return pushVerdictArguments(['GEOPOS', key], member);
|
||||
}
|
||||
|
||||
type GeoCoordinatesRawReply = Array<[RedisCommandArgument, RedisCommandArgument] | null>;
|
||||
|
||||
interface GeoCoordinates {
|
||||
longitude: string;
|
||||
latitude: string;
|
||||
longitude: RedisCommandArgument;
|
||||
latitude: RedisCommandArgument;
|
||||
}
|
||||
|
||||
export function transformReply(reply: Array<[string, string] | null>): Array<GeoCoordinates | null> {
|
||||
export function transformReply(reply: GeoCoordinatesRawReply): Array<GeoCoordinates | null> {
|
||||
return reply.map(coordinates => coordinates === null ? null : {
|
||||
longitude: coordinates[0],
|
||||
latitude: coordinates[1]
|
||||
|
Reference in New Issue
Block a user