/opt/canhelp/node_modules/ioredis/built/utils
NameSizeModeActions
applyMixin.d.ts1830644editdlrm
applyMixin.js3900644editdlrm
argumentParsers.d.ts8100644editdlrm
argumentParsers.js24670644editdlrm
Commander.d.ts12520644editdlrm
Commander.js44260644editdlrm
debug.d.ts6140644editdlrm
debug.js26360644editdlrm
index.d.ts33030644editdlrm
index.js93290644editdlrm
lodash.d.ts1700644editdlrm
lodash.js3420644editdlrm
RedisCommander.d.ts4183400644editdlrm
RedisCommander.js2270644editdlrm
Edit: /opt/canhelp/node_modules/ioredis/built/utils/index.d.ts (3303B)
/// import { defaults, noop } from "./lodash"; import { Callback } from "../types"; import Debug from "./debug"; /** * Convert a buffer to string, supports buffer array * * @example * ```js * const input = [Buffer.from('foo'), [Buffer.from('bar')]] * const res = convertBufferToString(input, 'utf8') * expect(res).to.eql(['foo', ['bar']]) * ``` */ export declare function convertBufferToString(value: any, encoding?: BufferEncoding): any; /** * Convert a list of results to node-style * * @example * ```js * const input = ['a', 'b', new Error('c'), 'd'] * const output = exports.wrapMultiResult(input) * expect(output).to.eql([[null, 'a'], [null, 'b'], [new Error('c')], [null, 'd']) * ``` */ export declare function wrapMultiResult(arr: unknown[] | null): unknown[][] | null; /** * Detect if the argument is a int * @example * ```js * > isInt('123') * true * > isInt('123.3') * false * > isInt('1x') * false * > isInt(123) * true * > isInt(true) * false * ``` */ export declare function isInt(value: any): value is string; /** * Pack an array to an Object * * @example * ```js * > packObject(['a', 'b', 'c', 'd']) * { a: 'b', c: 'd' } * ``` */ export declare function packObject(array: any[]): Record; /** * Return a callback with timeout */ export declare function timeout(callback: Callback, timeout: number): Callback; /** * Convert an object to an array * @example * ```js * > convertObjectToArray({ a: '1' }) * ['a', '1'] * ``` */ export declare function convertObjectToArray(obj: Record): (string | T)[]; /** * Convert a map to an array * @example * ```js * > convertMapToArray(new Map([[1, '2']])) * [1, '2'] * ``` */ export declare function convertMapToArray(map: Map): (K | V)[]; /** * Convert a non-string arg to a string */ export declare function toArg(arg: any): string; /** * Optimize error stack * * @param error actually error * @param friendlyStack the stack that more meaningful * @param filterPath only show stacks with the specified path */ export declare function optimizeErrorStack(error: Error, friendlyStack: string, filterPath: string): Error; /** * Parse the redis protocol url */ export declare function parseURL(url: string): Record; interface TLSOptions { port: number; host: string; [key: string]: any; } /** * Resolve TLS profile shortcut in connection options */ export declare function resolveTLSProfile(options: TLSOptions): TLSOptions; /** * Get a random element from `array` */ export declare function sample(array: T[], from?: number): T; /** * Shuffle the array using the Fisher-Yates Shuffle. * This method will mutate the original array. */ export declare function shuffle(array: T[]): T[]; /** * Error message for connection being disconnected */ export declare const CONNECTION_CLOSED_ERROR_MSG = "Connection is closed."; export declare function zipMap(keys: K[], values: V[]): Map; /** * Retrieves cached package metadata from package.json. * * @internal * @returns {Promise<{version: string} | null>} Package metadata or null if unavailable */ export declare function getPackageMeta(): Promise<{ version: string; }>; export { Debug, defaults, noop };