-first commit

This commit is contained in:
2025-11-11 12:36:06 +07:00
commit b99c214434
5683 changed files with 713336 additions and 0 deletions

40
node_modules/@redis/client/dist/lib/RESP/decoder.d.ts generated vendored Normal file
View File

@@ -0,0 +1,40 @@
/// <reference types="node" />
import { ErrorReply } from '../errors';
import { TypeMapping } from './types';
export declare const RESP_TYPES: {
readonly NULL: 95;
readonly BOOLEAN: 35;
readonly NUMBER: 58;
readonly BIG_NUMBER: 40;
readonly DOUBLE: 44;
readonly SIMPLE_STRING: 43;
readonly BLOB_STRING: 36;
readonly VERBATIM_STRING: 61;
readonly SIMPLE_ERROR: 45;
readonly BLOB_ERROR: 33;
readonly ARRAY: 42;
readonly SET: 126;
readonly MAP: 37;
readonly PUSH: 62;
};
export declare const PUSH_TYPE_MAPPING: {
36: BufferConstructor;
};
interface DecoderOptions {
onReply(reply: any): unknown;
onErrorReply(err: ErrorReply): unknown;
onPush(push: Array<any>): unknown;
getTypeMapping(): TypeMapping;
}
export declare class Decoder {
#private;
onReply: (reply: any) => unknown;
onErrorReply: (err: ErrorReply) => unknown;
onPush: (push: any[]) => unknown;
getTypeMapping: () => TypeMapping;
constructor(config: DecoderOptions);
reset(): void;
write(chunk: any): void;
}
export {};
//# sourceMappingURL=decoder.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"decoder.d.ts","sourceRoot":"","sources":["../../../lib/RESP/decoder.ts"],"names":[],"mappings":";AAEA,OAAO,EAA0B,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGtC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;CAeb,CAAC;AAeX,eAAO,MAAM,iBAAiB;;CAE7B,CAAC;AAIF,UAAU,cAAc;IACtB,OAAO,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC;IAC7B,YAAY,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC;IACvC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;IAClC,cAAc,IAAI,WAAW,CAAC;CAC/B;AAED,qBAAa,OAAO;;IAClB,OAAO,0BAAC;IACR,YAAY,+BAAC;IACb,MAAM,2BAAC;IACP,cAAc,oBAAC;gBAIH,MAAM,EAAE,cAAc;IAOlC,KAAK;IAKL,KAAK,CAAC,KAAK,KAAA;CAklCZ"}

727
node_modules/@redis/client/dist/lib/RESP/decoder.js generated vendored Normal file
View File

@@ -0,0 +1,727 @@
"use strict";
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Decoder = exports.PUSH_TYPE_MAPPING = exports.RESP_TYPES = void 0;
// @ts-nocheck
const verbatim_string_1 = require("./verbatim-string");
const errors_1 = require("../errors");
// https://github.com/redis/redis-specifications/blob/master/protocol/RESP3.md
exports.RESP_TYPES = {
NULL: 95, // _
BOOLEAN: 35, // #
NUMBER: 58, // :
BIG_NUMBER: 40, // (
DOUBLE: 44, // ,
SIMPLE_STRING: 43, // +
BLOB_STRING: 36, // $
VERBATIM_STRING: 61, // =
SIMPLE_ERROR: 45, // -
BLOB_ERROR: 33, // !
ARRAY: 42, // *
SET: 126, // ~
MAP: 37, // %
PUSH: 62 // >
};
const ASCII = {
'\r': 13,
't': 116,
'+': 43,
'-': 45,
'0': 48,
'.': 46,
'i': 105,
'n': 110,
'E': 69,
'e': 101
};
exports.PUSH_TYPE_MAPPING = {
[exports.RESP_TYPES.BLOB_STRING]: Buffer
};
class Decoder {
onReply;
onErrorReply;
onPush;
getTypeMapping;
#cursor = 0;
#next;
constructor(config) {
this.onReply = config.onReply;
this.onErrorReply = config.onErrorReply;
this.onPush = config.onPush;
this.getTypeMapping = config.getTypeMapping;
}
reset() {
this.#cursor = 0;
this.#next = undefined;
}
write(chunk) {
if (this.#cursor >= chunk.length) {
this.#cursor -= chunk.length;
return;
}
if (this.#next) {
if (this.#next(chunk) || this.#cursor >= chunk.length) {
this.#cursor -= chunk.length;
return;
}
}
do {
const type = chunk[this.#cursor];
if (++this.#cursor === chunk.length) {
this.#next = this.#continueDecodeTypeValue.bind(this, type);
break;
}
if (this.#decodeTypeValue(type, chunk)) {
break;
}
} while (this.#cursor < chunk.length);
this.#cursor -= chunk.length;
}
#continueDecodeTypeValue(type, chunk) {
this.#next = undefined;
return this.#decodeTypeValue(type, chunk);
}
#decodeTypeValue(type, chunk) {
switch (type) {
case exports.RESP_TYPES.NULL:
this.onReply(this.#decodeNull());
return false;
case exports.RESP_TYPES.BOOLEAN:
return this.#handleDecodedValue(this.onReply, this.#decodeBoolean(chunk));
case exports.RESP_TYPES.NUMBER:
return this.#handleDecodedValue(this.onReply, this.#decodeNumber(this.getTypeMapping()[exports.RESP_TYPES.NUMBER], chunk));
case exports.RESP_TYPES.BIG_NUMBER:
return this.#handleDecodedValue(this.onReply, this.#decodeBigNumber(this.getTypeMapping()[exports.RESP_TYPES.BIG_NUMBER], chunk));
case exports.RESP_TYPES.DOUBLE:
return this.#handleDecodedValue(this.onReply, this.#decodeDouble(this.getTypeMapping()[exports.RESP_TYPES.DOUBLE], chunk));
case exports.RESP_TYPES.SIMPLE_STRING:
return this.#handleDecodedValue(this.onReply, this.#decodeSimpleString(this.getTypeMapping()[exports.RESP_TYPES.SIMPLE_STRING], chunk));
case exports.RESP_TYPES.BLOB_STRING:
return this.#handleDecodedValue(this.onReply, this.#decodeBlobString(this.getTypeMapping()[exports.RESP_TYPES.BLOB_STRING], chunk));
case exports.RESP_TYPES.VERBATIM_STRING:
return this.#handleDecodedValue(this.onReply, this.#decodeVerbatimString(this.getTypeMapping()[exports.RESP_TYPES.VERBATIM_STRING], chunk));
case exports.RESP_TYPES.SIMPLE_ERROR:
return this.#handleDecodedValue(this.onErrorReply, this.#decodeSimpleError(chunk));
case exports.RESP_TYPES.BLOB_ERROR:
return this.#handleDecodedValue(this.onErrorReply, this.#decodeBlobError(chunk));
case exports.RESP_TYPES.ARRAY:
return this.#handleDecodedValue(this.onReply, this.#decodeArray(this.getTypeMapping(), chunk));
case exports.RESP_TYPES.SET:
return this.#handleDecodedValue(this.onReply, this.#decodeSet(this.getTypeMapping(), chunk));
case exports.RESP_TYPES.MAP:
return this.#handleDecodedValue(this.onReply, this.#decodeMap(this.getTypeMapping(), chunk));
case exports.RESP_TYPES.PUSH:
return this.#handleDecodedValue(this.onPush, this.#decodeArray(exports.PUSH_TYPE_MAPPING, chunk));
default:
throw new Error(`Unknown RESP type ${type} "${String.fromCharCode(type)}"`);
}
}
#handleDecodedValue(cb, value) {
if (typeof value === 'function') {
this.#next = this.#continueDecodeValue.bind(this, cb, value);
return true;
}
cb(value);
return false;
}
#continueDecodeValue(cb, next, chunk) {
this.#next = undefined;
return this.#handleDecodedValue(cb, next(chunk));
}
#decodeNull() {
this.#cursor += 2; // skip \r\n
return null;
}
#decodeBoolean(chunk) {
const boolean = chunk[this.#cursor] === ASCII.t;
this.#cursor += 3; // skip {t | f}\r\n
return boolean;
}
#decodeNumber(type, chunk) {
if (type === String) {
return this.#decodeSimpleString(String, chunk);
}
switch (chunk[this.#cursor]) {
case ASCII['+']:
return this.#maybeDecodeNumberValue(false, chunk);
case ASCII['-']:
return this.#maybeDecodeNumberValue(true, chunk);
default:
return this.#decodeNumberValue(false, this.#decodeUnsingedNumber.bind(this, 0), chunk);
}
}
#maybeDecodeNumberValue(isNegative, chunk) {
const cb = this.#decodeUnsingedNumber.bind(this, 0);
return ++this.#cursor === chunk.length ?
this.#decodeNumberValue.bind(this, isNegative, cb) :
this.#decodeNumberValue(isNegative, cb, chunk);
}
#decodeNumberValue(isNegative, numberCb, chunk) {
const number = numberCb(chunk);
return typeof number === 'function' ?
this.#decodeNumberValue.bind(this, isNegative, number) :
isNegative ? -number : number;
}
#decodeUnsingedNumber(number, chunk) {
let cursor = this.#cursor;
do {
const byte = chunk[cursor];
if (byte === ASCII['\r']) {
this.#cursor = cursor + 2; // skip \r\n
return number;
}
number = number * 10 + byte - ASCII['0'];
} while (++cursor < chunk.length);
this.#cursor = cursor;
return this.#decodeUnsingedNumber.bind(this, number);
}
#decodeBigNumber(type, chunk) {
if (type === String) {
return this.#decodeSimpleString(String, chunk);
}
switch (chunk[this.#cursor]) {
case ASCII['+']:
return this.#maybeDecodeBigNumberValue(false, chunk);
case ASCII['-']:
return this.#maybeDecodeBigNumberValue(true, chunk);
default:
return this.#decodeBigNumberValue(false, this.#decodeUnsingedBigNumber.bind(this, 0n), chunk);
}
}
#maybeDecodeBigNumberValue(isNegative, chunk) {
const cb = this.#decodeUnsingedBigNumber.bind(this, 0n);
return ++this.#cursor === chunk.length ?
this.#decodeBigNumberValue.bind(this, isNegative, cb) :
this.#decodeBigNumberValue(isNegative, cb, chunk);
}
#decodeBigNumberValue(isNegative, bigNumberCb, chunk) {
const bigNumber = bigNumberCb(chunk);
return typeof bigNumber === 'function' ?
this.#decodeBigNumberValue.bind(this, isNegative, bigNumber) :
isNegative ? -bigNumber : bigNumber;
}
#decodeUnsingedBigNumber(bigNumber, chunk) {
let cursor = this.#cursor;
do {
const byte = chunk[cursor];
if (byte === ASCII['\r']) {
this.#cursor = cursor + 2; // skip \r\n
return bigNumber;
}
bigNumber = bigNumber * 10n + BigInt(byte - ASCII['0']);
} while (++cursor < chunk.length);
this.#cursor = cursor;
return this.#decodeUnsingedBigNumber.bind(this, bigNumber);
}
#decodeDouble(type, chunk) {
if (type === String) {
return this.#decodeSimpleString(String, chunk);
}
switch (chunk[this.#cursor]) {
case ASCII.n:
this.#cursor += 5; // skip nan\r\n
return NaN;
case ASCII['+']:
return this.#maybeDecodeDoubleInteger(false, chunk);
case ASCII['-']:
return this.#maybeDecodeDoubleInteger(true, chunk);
default:
return this.#decodeDoubleInteger(false, 0, chunk);
}
}
#maybeDecodeDoubleInteger(isNegative, chunk) {
return ++this.#cursor === chunk.length ?
this.#decodeDoubleInteger.bind(this, isNegative, 0) :
this.#decodeDoubleInteger(isNegative, 0, chunk);
}
#decodeDoubleInteger(isNegative, integer, chunk) {
if (chunk[this.#cursor] === ASCII.i) {
this.#cursor += 5; // skip inf\r\n
return isNegative ? -Infinity : Infinity;
}
return this.#continueDecodeDoubleInteger(isNegative, integer, chunk);
}
#continueDecodeDoubleInteger(isNegative, integer, chunk) {
let cursor = this.#cursor;
do {
const byte = chunk[cursor];
switch (byte) {
case ASCII['.']:
this.#cursor = cursor + 1; // skip .
return this.#cursor < chunk.length ?
this.#decodeDoubleDecimal(isNegative, 0, integer, chunk) :
this.#decodeDoubleDecimal.bind(this, isNegative, 0, integer);
case ASCII.E:
case ASCII.e:
this.#cursor = cursor + 1; // skip E/e
const i = isNegative ? -integer : integer;
return this.#cursor < chunk.length ?
this.#decodeDoubleExponent(i, chunk) :
this.#decodeDoubleExponent.bind(this, i);
case ASCII['\r']:
this.#cursor = cursor + 2; // skip \r\n
return isNegative ? -integer : integer;
default:
integer = integer * 10 + byte - ASCII['0'];
}
} while (++cursor < chunk.length);
this.#cursor = cursor;
return this.#continueDecodeDoubleInteger.bind(this, isNegative, integer);
}
// Precalculated multipliers for decimal points to improve performance
// "... about 15 to 17 decimal places ..."
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number#:~:text=about%2015%20to%2017%20decimal%20places
static #DOUBLE_DECIMAL_MULTIPLIERS = [
1e-1, 1e-2, 1e-3, 1e-4, 1e-5, 1e-6,
1e-7, 1e-8, 1e-9, 1e-10, 1e-11, 1e-12,
1e-13, 1e-14, 1e-15, 1e-16, 1e-17
];
#decodeDoubleDecimal(isNegative, decimalIndex, double, chunk) {
let cursor = this.#cursor;
do {
const byte = chunk[cursor];
switch (byte) {
case ASCII.E:
case ASCII.e:
this.#cursor = cursor + 1; // skip E/e
const d = isNegative ? -double : double;
return this.#cursor === chunk.length ?
this.#decodeDoubleExponent.bind(this, d) :
this.#decodeDoubleExponent(d, chunk);
case ASCII['\r']:
this.#cursor = cursor + 2; // skip \r\n
return isNegative ? -double : double;
}
if (decimalIndex < _a.#DOUBLE_DECIMAL_MULTIPLIERS.length) {
double += (byte - ASCII['0']) * _a.#DOUBLE_DECIMAL_MULTIPLIERS[decimalIndex++];
}
} while (++cursor < chunk.length);
this.#cursor = cursor;
return this.#decodeDoubleDecimal.bind(this, isNegative, decimalIndex, double);
}
#decodeDoubleExponent(double, chunk) {
switch (chunk[this.#cursor]) {
case ASCII['+']:
return ++this.#cursor === chunk.length ?
this.#continueDecodeDoubleExponent.bind(this, false, double, 0) :
this.#continueDecodeDoubleExponent(false, double, 0, chunk);
case ASCII['-']:
return ++this.#cursor === chunk.length ?
this.#continueDecodeDoubleExponent.bind(this, true, double, 0) :
this.#continueDecodeDoubleExponent(true, double, 0, chunk);
}
return this.#continueDecodeDoubleExponent(false, double, 0, chunk);
}
#continueDecodeDoubleExponent(isNegative, double, exponent, chunk) {
let cursor = this.#cursor;
do {
const byte = chunk[cursor];
if (byte === ASCII['\r']) {
this.#cursor = cursor + 2; // skip \r\n
return double * 10 ** (isNegative ? -exponent : exponent);
}
exponent = exponent * 10 + byte - ASCII['0'];
} while (++cursor < chunk.length);
this.#cursor = cursor;
return this.#continueDecodeDoubleExponent.bind(this, isNegative, double, exponent);
}
#findCRLF(chunk, cursor) {
while (chunk[cursor] !== ASCII['\r']) {
if (++cursor === chunk.length) {
this.#cursor = chunk.length;
return -1;
}
}
this.#cursor = cursor + 2; // skip \r\n
return cursor;
}
#decodeSimpleString(type, chunk) {
const start = this.#cursor, crlfIndex = this.#findCRLF(chunk, start);
if (crlfIndex === -1) {
return this.#continueDecodeSimpleString.bind(this, [chunk.subarray(start)], type);
}
const slice = chunk.subarray(start, crlfIndex);
return type === Buffer ?
slice :
slice.toString();
}
#continueDecodeSimpleString(chunks, type, chunk) {
const start = this.#cursor, crlfIndex = this.#findCRLF(chunk, start);
if (crlfIndex === -1) {
chunks.push(chunk.subarray(start));
return this.#continueDecodeSimpleString.bind(this, chunks, type);
}
chunks.push(chunk.subarray(start, crlfIndex));
const buffer = Buffer.concat(chunks);
return type === Buffer ? buffer : buffer.toString();
}
#decodeBlobString(type, chunk) {
// RESP 2 bulk string null
// https://github.com/redis/redis-specifications/blob/master/protocol/RESP2.md#resp-bulk-strings
if (chunk[this.#cursor] === ASCII['-']) {
this.#cursor += 4; // skip -1\r\n
return null;
}
const length = this.#decodeUnsingedNumber(0, chunk);
if (typeof length === 'function') {
return this.#continueDecodeBlobStringLength.bind(this, length, type);
}
else if (this.#cursor >= chunk.length) {
return this.#decodeBlobStringWithLength.bind(this, length, type);
}
return this.#decodeBlobStringWithLength(length, type, chunk);
}
#continueDecodeBlobStringLength(lengthCb, type, chunk) {
const length = lengthCb(chunk);
if (typeof length === 'function') {
return this.#continueDecodeBlobStringLength.bind(this, length, type);
}
else if (this.#cursor >= chunk.length) {
return this.#decodeBlobStringWithLength.bind(this, length, type);
}
return this.#decodeBlobStringWithLength(length, type, chunk);
}
#decodeStringWithLength(length, skip, type, chunk) {
const end = this.#cursor + length;
if (end >= chunk.length) {
const slice = chunk.subarray(this.#cursor);
this.#cursor = chunk.length;
return this.#continueDecodeStringWithLength.bind(this, length - slice.length, [slice], skip, type);
}
const slice = chunk.subarray(this.#cursor, end);
this.#cursor = end + skip;
return type === Buffer ?
slice :
slice.toString();
}
#continueDecodeStringWithLength(length, chunks, skip, type, chunk) {
const end = this.#cursor + length;
if (end >= chunk.length) {
const slice = chunk.subarray(this.#cursor);
chunks.push(slice);
this.#cursor = chunk.length;
return this.#continueDecodeStringWithLength.bind(this, length - slice.length, chunks, skip, type);
}
chunks.push(chunk.subarray(this.#cursor, end));
this.#cursor = end + skip;
const buffer = Buffer.concat(chunks);
return type === Buffer ? buffer : buffer.toString();
}
#decodeBlobStringWithLength(length, type, chunk) {
return this.#decodeStringWithLength(length, 2, type, chunk);
}
#decodeVerbatimString(type, chunk) {
return this.#continueDecodeVerbatimStringLength(this.#decodeUnsingedNumber.bind(this, 0), type, chunk);
}
#continueDecodeVerbatimStringLength(lengthCb, type, chunk) {
const length = lengthCb(chunk);
return typeof length === 'function' ?
this.#continueDecodeVerbatimStringLength.bind(this, length, type) :
this.#decodeVerbatimStringWithLength(length, type, chunk);
}
#decodeVerbatimStringWithLength(length, type, chunk) {
const stringLength = length - 4; // skip <format>:
if (type === verbatim_string_1.VerbatimString) {
return this.#decodeVerbatimStringFormat(stringLength, chunk);
}
this.#cursor += 4; // skip <format>:
return this.#cursor >= chunk.length ?
this.#decodeBlobStringWithLength.bind(this, stringLength, type) :
this.#decodeBlobStringWithLength(stringLength, type, chunk);
}
#decodeVerbatimStringFormat(stringLength, chunk) {
const formatCb = this.#decodeStringWithLength.bind(this, 3, 1, String);
return this.#cursor >= chunk.length ?
this.#continueDecodeVerbatimStringFormat.bind(this, stringLength, formatCb) :
this.#continueDecodeVerbatimStringFormat(stringLength, formatCb, chunk);
}
#continueDecodeVerbatimStringFormat(stringLength, formatCb, chunk) {
const format = formatCb(chunk);
return typeof format === 'function' ?
this.#continueDecodeVerbatimStringFormat.bind(this, stringLength, format) :
this.#decodeVerbatimStringWithFormat(stringLength, format, chunk);
}
#decodeVerbatimStringWithFormat(stringLength, format, chunk) {
return this.#continueDecodeVerbatimStringWithFormat(format, this.#decodeBlobStringWithLength.bind(this, stringLength, String), chunk);
}
#continueDecodeVerbatimStringWithFormat(format, stringCb, chunk) {
const string = stringCb(chunk);
return typeof string === 'function' ?
this.#continueDecodeVerbatimStringWithFormat.bind(this, format, string) :
new verbatim_string_1.VerbatimString(format, string);
}
#decodeSimpleError(chunk) {
const string = this.#decodeSimpleString(String, chunk);
return typeof string === 'function' ?
this.#continueDecodeSimpleError.bind(this, string) :
new errors_1.SimpleError(string);
}
#continueDecodeSimpleError(stringCb, chunk) {
const string = stringCb(chunk);
return typeof string === 'function' ?
this.#continueDecodeSimpleError.bind(this, string) :
new errors_1.SimpleError(string);
}
#decodeBlobError(chunk) {
const string = this.#decodeBlobString(String, chunk);
return typeof string === 'function' ?
this.#continueDecodeBlobError.bind(this, string) :
new errors_1.BlobError(string);
}
#continueDecodeBlobError(stringCb, chunk) {
const string = stringCb(chunk);
return typeof string === 'function' ?
this.#continueDecodeBlobError.bind(this, string) :
new errors_1.BlobError(string);
}
#decodeNestedType(typeMapping, chunk) {
const type = chunk[this.#cursor];
return ++this.#cursor === chunk.length ?
this.#decodeNestedTypeValue.bind(this, type, typeMapping) :
this.#decodeNestedTypeValue(type, typeMapping, chunk);
}
#decodeNestedTypeValue(type, typeMapping, chunk) {
switch (type) {
case exports.RESP_TYPES.NULL:
return this.#decodeNull();
case exports.RESP_TYPES.BOOLEAN:
return this.#decodeBoolean(chunk);
case exports.RESP_TYPES.NUMBER:
return this.#decodeNumber(typeMapping[exports.RESP_TYPES.NUMBER], chunk);
case exports.RESP_TYPES.BIG_NUMBER:
return this.#decodeBigNumber(typeMapping[exports.RESP_TYPES.BIG_NUMBER], chunk);
case exports.RESP_TYPES.DOUBLE:
return this.#decodeDouble(typeMapping[exports.RESP_TYPES.DOUBLE], chunk);
case exports.RESP_TYPES.SIMPLE_STRING:
return this.#decodeSimpleString(typeMapping[exports.RESP_TYPES.SIMPLE_STRING], chunk);
case exports.RESP_TYPES.BLOB_STRING:
return this.#decodeBlobString(typeMapping[exports.RESP_TYPES.BLOB_STRING], chunk);
case exports.RESP_TYPES.VERBATIM_STRING:
return this.#decodeVerbatimString(typeMapping[exports.RESP_TYPES.VERBATIM_STRING], chunk);
case exports.RESP_TYPES.SIMPLE_ERROR:
return this.#decodeSimpleError(chunk);
case exports.RESP_TYPES.BLOB_ERROR:
return this.#decodeBlobError(chunk);
case exports.RESP_TYPES.ARRAY:
return this.#decodeArray(typeMapping, chunk);
case exports.RESP_TYPES.SET:
return this.#decodeSet(typeMapping, chunk);
case exports.RESP_TYPES.MAP:
return this.#decodeMap(typeMapping, chunk);
default:
throw new Error(`Unknown RESP type ${type} "${String.fromCharCode(type)}"`);
}
}
#decodeArray(typeMapping, chunk) {
// RESP 2 null
// https://github.com/redis/redis-specifications/blob/master/protocol/RESP2.md#resp-arrays
if (chunk[this.#cursor] === ASCII['-']) {
this.#cursor += 4; // skip -1\r\n
return null;
}
return this.#decodeArrayWithLength(this.#decodeUnsingedNumber(0, chunk), typeMapping, chunk);
}
#decodeArrayWithLength(length, typeMapping, chunk) {
return typeof length === 'function' ?
this.#continueDecodeArrayLength.bind(this, length, typeMapping) :
this.#decodeArrayItems(new Array(length), 0, typeMapping, chunk);
}
#continueDecodeArrayLength(lengthCb, typeMapping, chunk) {
return this.#decodeArrayWithLength(lengthCb(chunk), typeMapping, chunk);
}
#decodeArrayItems(array, filled, typeMapping, chunk) {
for (let i = filled; i < array.length; i++) {
if (this.#cursor >= chunk.length) {
return this.#decodeArrayItems.bind(this, array, i, typeMapping);
}
const item = this.#decodeNestedType(typeMapping, chunk);
if (typeof item === 'function') {
return this.#continueDecodeArrayItems.bind(this, array, i, item, typeMapping);
}
array[i] = item;
}
return array;
}
#continueDecodeArrayItems(array, filled, itemCb, typeMapping, chunk) {
const item = itemCb(chunk);
if (typeof item === 'function') {
return this.#continueDecodeArrayItems.bind(this, array, filled, item, typeMapping);
}
array[filled++] = item;
return this.#decodeArrayItems(array, filled, typeMapping, chunk);
}
#decodeSet(typeMapping, chunk) {
const length = this.#decodeUnsingedNumber(0, chunk);
if (typeof length === 'function') {
return this.#continueDecodeSetLength.bind(this, length, typeMapping);
}
return this.#decodeSetItems(length, typeMapping, chunk);
}
#continueDecodeSetLength(lengthCb, typeMapping, chunk) {
const length = lengthCb(chunk);
return typeof length === 'function' ?
this.#continueDecodeSetLength.bind(this, length, typeMapping) :
this.#decodeSetItems(length, typeMapping, chunk);
}
#decodeSetItems(length, typeMapping, chunk) {
return typeMapping[exports.RESP_TYPES.SET] === Set ?
this.#decodeSetAsSet(new Set(), length, typeMapping, chunk) :
this.#decodeArrayItems(new Array(length), 0, typeMapping, chunk);
}
#decodeSetAsSet(set, remaining, typeMapping, chunk) {
// using `remaining` instead of `length` & `set.size` to make it work even if the set contains duplicates
while (remaining > 0) {
if (this.#cursor >= chunk.length) {
return this.#decodeSetAsSet.bind(this, set, remaining, typeMapping);
}
const item = this.#decodeNestedType(typeMapping, chunk);
if (typeof item === 'function') {
return this.#continueDecodeSetAsSet.bind(this, set, remaining, item, typeMapping);
}
set.add(item);
--remaining;
}
return set;
}
#continueDecodeSetAsSet(set, remaining, itemCb, typeMapping, chunk) {
const item = itemCb(chunk);
if (typeof item === 'function') {
return this.#continueDecodeSetAsSet.bind(this, set, remaining, item, typeMapping);
}
set.add(item);
return this.#decodeSetAsSet(set, remaining - 1, typeMapping, chunk);
}
#decodeMap(typeMapping, chunk) {
const length = this.#decodeUnsingedNumber(0, chunk);
if (typeof length === 'function') {
return this.#continueDecodeMapLength.bind(this, length, typeMapping);
}
return this.#decodeMapItems(length, typeMapping, chunk);
}
#continueDecodeMapLength(lengthCb, typeMapping, chunk) {
const length = lengthCb(chunk);
return typeof length === 'function' ?
this.#continueDecodeMapLength.bind(this, length, typeMapping) :
this.#decodeMapItems(length, typeMapping, chunk);
}
#decodeMapItems(length, typeMapping, chunk) {
switch (typeMapping[exports.RESP_TYPES.MAP]) {
case Map:
return this.#decodeMapAsMap(new Map(), length, typeMapping, chunk);
case Array:
return this.#decodeArrayItems(new Array(length * 2), 0, typeMapping, chunk);
default:
return this.#decodeMapAsObject(Object.create(null), length, typeMapping, chunk);
}
}
#decodeMapAsMap(map, remaining, typeMapping, chunk) {
// using `remaining` instead of `length` & `map.size` to make it work even if the map contains duplicate keys
while (remaining > 0) {
if (this.#cursor >= chunk.length) {
return this.#decodeMapAsMap.bind(this, map, remaining, typeMapping);
}
const key = this.#decodeMapKey(typeMapping, chunk);
if (typeof key === 'function') {
return this.#continueDecodeMapKey.bind(this, map, remaining, key, typeMapping);
}
if (this.#cursor >= chunk.length) {
return this.#continueDecodeMapValue.bind(this, map, remaining, key, this.#decodeNestedType.bind(this, typeMapping), typeMapping);
}
const value = this.#decodeNestedType(typeMapping, chunk);
if (typeof value === 'function') {
return this.#continueDecodeMapValue.bind(this, map, remaining, key, value, typeMapping);
}
map.set(key, value);
--remaining;
}
return map;
}
#decodeMapKey(typeMapping, chunk) {
const type = chunk[this.#cursor];
return ++this.#cursor === chunk.length ?
this.#decodeMapKeyValue.bind(this, type, typeMapping) :
this.#decodeMapKeyValue(type, typeMapping, chunk);
}
#decodeMapKeyValue(type, typeMapping, chunk) {
switch (type) {
// decode simple string map key as string (and not as buffer)
case exports.RESP_TYPES.SIMPLE_STRING:
return this.#decodeSimpleString(String, chunk);
// decode blob string map key as string (and not as buffer)
case exports.RESP_TYPES.BLOB_STRING:
return this.#decodeBlobString(String, chunk);
default:
return this.#decodeNestedTypeValue(type, typeMapping, chunk);
}
}
#continueDecodeMapKey(map, remaining, keyCb, typeMapping, chunk) {
const key = keyCb(chunk);
if (typeof key === 'function') {
return this.#continueDecodeMapKey.bind(this, map, remaining, key, typeMapping);
}
if (this.#cursor >= chunk.length) {
return this.#continueDecodeMapValue.bind(this, map, remaining, key, this.#decodeNestedType.bind(this, typeMapping), typeMapping);
}
const value = this.#decodeNestedType(typeMapping, chunk);
if (typeof value === 'function') {
return this.#continueDecodeMapValue.bind(this, map, remaining, key, value, typeMapping);
}
map.set(key, value);
return this.#decodeMapAsMap(map, remaining - 1, typeMapping, chunk);
}
#continueDecodeMapValue(map, remaining, key, valueCb, typeMapping, chunk) {
const value = valueCb(chunk);
if (typeof value === 'function') {
return this.#continueDecodeMapValue.bind(this, map, remaining, key, value, typeMapping);
}
map.set(key, value);
return this.#decodeMapAsMap(map, remaining - 1, typeMapping, chunk);
}
#decodeMapAsObject(object, remaining, typeMapping, chunk) {
while (remaining > 0) {
if (this.#cursor >= chunk.length) {
return this.#decodeMapAsObject.bind(this, object, remaining, typeMapping);
}
const key = this.#decodeMapKey(typeMapping, chunk);
if (typeof key === 'function') {
return this.#continueDecodeMapAsObjectKey.bind(this, object, remaining, key, typeMapping);
}
if (this.#cursor >= chunk.length) {
return this.#continueDecodeMapAsObjectValue.bind(this, object, remaining, key, this.#decodeNestedType.bind(this, typeMapping), typeMapping);
}
const value = this.#decodeNestedType(typeMapping, chunk);
if (typeof value === 'function') {
return this.#continueDecodeMapAsObjectValue.bind(this, object, remaining, key, value, typeMapping);
}
object[key] = value;
--remaining;
}
return object;
}
#continueDecodeMapAsObjectKey(object, remaining, keyCb, typeMapping, chunk) {
const key = keyCb(chunk);
if (typeof key === 'function') {
return this.#continueDecodeMapAsObjectKey.bind(this, object, remaining, key, typeMapping);
}
if (this.#cursor >= chunk.length) {
return this.#continueDecodeMapAsObjectValue.bind(this, object, remaining, key, this.#decodeNestedType.bind(this, typeMapping), typeMapping);
}
const value = this.#decodeNestedType(typeMapping, chunk);
if (typeof value === 'function') {
return this.#continueDecodeMapAsObjectValue.bind(this, object, remaining, key, value, typeMapping);
}
object[key] = value;
return this.#decodeMapAsObject(object, remaining - 1, typeMapping, chunk);
}
#continueDecodeMapAsObjectValue(object, remaining, key, valueCb, typeMapping, chunk) {
const value = valueCb(chunk);
if (typeof value === 'function') {
return this.#continueDecodeMapAsObjectValue.bind(this, object, remaining, key, value, typeMapping);
}
object[key] = value;
return this.#decodeMapAsObject(object, remaining - 1, typeMapping, chunk);
}
}
exports.Decoder = Decoder;
_a = Decoder;
//# sourceMappingURL=decoder.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
import { RedisArgument } from './types';
export default function encodeCommand(args: ReadonlyArray<RedisArgument>): ReadonlyArray<RedisArgument>;
//# sourceMappingURL=encoder.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"encoder.d.ts","sourceRoot":"","sources":["../../../lib/RESP/encoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAIxC,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,aAAa,CAAC,GAAG,aAAa,CAAC,aAAa,CAAC,CAuBtG"}

24
node_modules/@redis/client/dist/lib/RESP/encoder.js generated vendored Normal file
View File

@@ -0,0 +1,24 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const CRLF = '\r\n';
function encodeCommand(args) {
const toWrite = [];
let strings = '*' + args.length + CRLF;
for (let i = 0; i < args.length; i++) {
const arg = args[i];
if (typeof arg === 'string') {
strings += '$' + Buffer.byteLength(arg) + CRLF + arg + CRLF;
}
else if (arg instanceof Buffer) {
toWrite.push(strings + '$' + arg.length.toString() + CRLF, arg);
strings = CRLF;
}
else {
throw new TypeError(`"arguments[${i}]" must be of type "string | Buffer", got ${typeof arg} instead.`);
}
}
toWrite.push(strings);
return toWrite;
}
exports.default = encodeCommand;
//# sourceMappingURL=encoder.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"encoder.js","sourceRoot":"","sources":["../../../lib/RESP/encoder.ts"],"names":[],"mappings":";;AAEA,MAAM,IAAI,GAAG,MAAM,CAAC;AAEpB,SAAwB,aAAa,CAAC,IAAkC;IACtE,MAAM,OAAO,GAAyB,EAAE,CAAC;IAEzC,IAAI,OAAO,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IAEvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO,IAAI,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC;QAC9D,CAAC;aAAM,IAAI,GAAG,YAAY,MAAM,EAAE,CAAC;YACjC,OAAO,CAAC,IAAI,CACV,OAAO,GAAG,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,IAAI,EAC5C,GAAG,CACJ,CAAC;YACF,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,SAAS,CAAC,cAAc,CAAC,6CAA6C,OAAO,GAAG,WAAW,CAAC,CAAC;QACzG,CAAC;IACH,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEtB,OAAO,OAAO,CAAC;AACjB,CAAC;AAvBD,gCAuBC"}

127
node_modules/@redis/client/dist/lib/RESP/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,127 @@
/// <reference types="node" />
import { CommandParser } from '../client/parser';
import { Tail } from '../commands/generic-transformers';
import { BlobError, SimpleError } from '../errors';
import { RedisScriptConfig, SHA1 } from '../lua-script';
import { RESP_TYPES } from './decoder';
import { VerbatimString } from './verbatim-string';
export type RESP_TYPES = typeof RESP_TYPES;
export type RespTypes = RESP_TYPES[keyof RESP_TYPES];
export interface RespType<RESP_TYPE extends RespTypes, DEFAULT, TYPES = never, TYPE_MAPPING = DEFAULT | TYPES> {
RESP_TYPE: RESP_TYPE;
DEFAULT: DEFAULT;
TYPES: TYPES;
TYPE_MAPPING: MappedType<TYPE_MAPPING>;
}
export interface NullReply extends RespType<RESP_TYPES['NULL'], null> {
}
export interface BooleanReply<T extends boolean = boolean> extends RespType<RESP_TYPES['BOOLEAN'], T> {
}
export interface NumberReply<T extends number = number> extends RespType<RESP_TYPES['NUMBER'], T, `${T}`, number | string> {
}
export interface BigNumberReply<T extends bigint = bigint> extends RespType<RESP_TYPES['BIG_NUMBER'], T, number | `${T}`, bigint | number | string> {
}
export interface DoubleReply<T extends number = number> extends RespType<RESP_TYPES['DOUBLE'], T, `${T}`, number | string> {
}
export interface SimpleStringReply<T extends string = string> extends RespType<RESP_TYPES['SIMPLE_STRING'], T, Buffer, string | Buffer> {
}
export interface BlobStringReply<T extends string = string> extends RespType<RESP_TYPES['BLOB_STRING'], T, Buffer, string | Buffer> {
toString(): string;
}
export interface VerbatimStringReply<T extends string = string> extends RespType<RESP_TYPES['VERBATIM_STRING'], T, Buffer | VerbatimString, string | Buffer | VerbatimString> {
}
export interface SimpleErrorReply extends RespType<RESP_TYPES['SIMPLE_ERROR'], SimpleError, Buffer> {
}
export interface BlobErrorReply extends RespType<RESP_TYPES['BLOB_ERROR'], BlobError, Buffer> {
}
export interface ArrayReply<T> extends RespType<RESP_TYPES['ARRAY'], Array<T>, never, Array<any>> {
}
export interface TuplesReply<T extends [...Array<unknown>]> extends RespType<RESP_TYPES['ARRAY'], T, never, Array<any>> {
}
export interface SetReply<T> extends RespType<RESP_TYPES['SET'], Array<T>, Set<T>, Array<any> | Set<any>> {
}
export interface MapReply<K, V> extends RespType<RESP_TYPES['MAP'], {
[key: string]: V;
}, Map<K, V> | Array<K | V>, Map<any, any> | Array<any>> {
}
type MapKeyValue = [key: BlobStringReply | SimpleStringReply, value: unknown];
type MapTuples = Array<MapKeyValue>;
type ExtractMapKey<T> = (T extends BlobStringReply<infer S> ? S : T extends SimpleStringReply<infer S> ? S : never);
export interface TuplesToMapReply<T extends MapTuples> extends RespType<RESP_TYPES['MAP'], {
[P in T[number] as ExtractMapKey<P[0]>]: P[1];
}, Map<ExtractMapKey<T[number][0]>, T[number][1]> | FlattenTuples<T>> {
}
type FlattenTuples<T> = (T extends [] ? [] : T extends [MapKeyValue] ? T[0] : T extends [MapKeyValue, ...infer R] ? [
...T[0],
...FlattenTuples<R>
] : never);
export type ReplyUnion = (NullReply | BooleanReply | NumberReply | BigNumberReply | DoubleReply | SimpleStringReply | BlobStringReply | VerbatimStringReply | SimpleErrorReply | BlobErrorReply | ArrayReply<ReplyUnion> | SetReply<ReplyUnion> | MapReply<ReplyUnion, ReplyUnion>);
export type MappedType<T> = ((...args: any) => T) | (new (...args: any) => T);
type InferTypeMapping<T> = T extends RespType<RespTypes, unknown, unknown, infer FLAG_TYPES> ? FLAG_TYPES : never;
export type TypeMapping = {
[P in RespTypes]?: MappedType<InferTypeMapping<Extract<ReplyUnion, RespType<P, any, any, any>>>>;
};
type MapKey<T, TYPE_MAPPING extends TypeMapping> = ReplyWithTypeMapping<T, TYPE_MAPPING & {
[RESP_TYPES.SIMPLE_STRING]: StringConstructor;
[RESP_TYPES.BLOB_STRING]: StringConstructor;
}>;
export type UnwrapReply<REPLY extends RespType<any, any, any, any>> = REPLY['DEFAULT' | 'TYPES'];
export type ReplyWithTypeMapping<REPLY, TYPE_MAPPING extends TypeMapping> = (REPLY extends RespType<infer RESP_TYPE, infer DEFAULT, infer TYPES, unknown> ? TYPE_MAPPING[RESP_TYPE] extends MappedType<infer T> ? ReplyWithTypeMapping<Extract<DEFAULT | TYPES, T>, TYPE_MAPPING> : ReplyWithTypeMapping<DEFAULT, TYPE_MAPPING> : (REPLY extends Array<infer T> ? Array<ReplyWithTypeMapping<T, TYPE_MAPPING>> : REPLY extends Set<infer T> ? Set<ReplyWithTypeMapping<T, TYPE_MAPPING>> : REPLY extends Map<infer K, infer V> ? Map<MapKey<K, TYPE_MAPPING>, ReplyWithTypeMapping<V, TYPE_MAPPING>> : REPLY extends Date | Buffer | Error ? REPLY : REPLY extends Record<PropertyKey, any> ? {
[P in keyof REPLY]: ReplyWithTypeMapping<REPLY[P], TYPE_MAPPING>;
} : REPLY));
export type TransformReply = (this: void, reply: any, preserve?: any, typeMapping?: TypeMapping) => any;
export type RedisArgument = string | Buffer;
export type CommandArguments = Array<RedisArgument> & {
preserve?: unknown;
};
export type Command = {
CACHEABLE?: boolean;
IS_READ_ONLY?: boolean;
/**
* @internal
* TODO: remove once `POLICIES` is implemented
*/
IS_FORWARD_COMMAND?: boolean;
NOT_KEYED_COMMAND?: true;
parseCommand(this: void, parser: CommandParser, ...args: Array<any>): void;
TRANSFORM_LEGACY_REPLY?: boolean;
transformReply: TransformReply | Record<RespVersions, TransformReply>;
unstableResp3?: boolean;
};
export type RedisCommands = Record<string, Command>;
export type RedisModules = Record<string, RedisCommands>;
export interface RedisFunction extends Command {
NUMBER_OF_KEYS?: number;
}
export type RedisFunctions = Record<string, Record<string, RedisFunction>>;
export type RedisScript = RedisScriptConfig & SHA1;
export type RedisScripts = Record<string, RedisScript>;
export interface CommanderConfig<M extends RedisModules, F extends RedisFunctions, S extends RedisScripts, RESP extends RespVersions> {
modules?: M;
functions?: F;
scripts?: S;
/**
* Specifies the Redis Serialization Protocol version to use.
* RESP2 is the default (value 2), while RESP3 (value 3) provides
* additional data types and features introduced in Redis 6.0.
*/
RESP?: RESP;
/**
* When set to true, enables commands that have unstable RESP3 implementations.
* When using RESP3 protocol, commands marked as having unstable RESP3 support
* will throw an error unless this flag is explicitly set to true.
* This primarily affects modules like Redis Search where response formats
* in RESP3 mode may change in future versions.
*/
unstableResp3?: boolean;
}
type Resp2Array<T> = (T extends [] ? [] : T extends [infer ITEM] ? [Resp2Reply<ITEM>] : T extends [infer ITEM, ...infer REST] ? [
Resp2Reply<ITEM>,
...Resp2Array<REST>
] : T extends Array<infer ITEM> ? Array<Resp2Reply<ITEM>> : never);
export type Resp2Reply<RESP3REPLY> = (RESP3REPLY extends RespType<infer RESP_TYPE, infer DEFAULT, infer TYPES, unknown> ? RESP_TYPE extends RESP_TYPES['DOUBLE'] ? BlobStringReply : RESP_TYPE extends RESP_TYPES['ARRAY'] | RESP_TYPES['SET'] ? RespType<RESP_TYPE, Resp2Array<DEFAULT>> : RESP_TYPE extends RESP_TYPES['MAP'] ? RespType<RESP_TYPES['ARRAY'], Resp2Array<Extract<TYPES, Array<any>>>> : RESP3REPLY : RESP3REPLY);
export type RespVersions = 2 | 3;
export type CommandReply<COMMAND extends Command, RESP extends RespVersions> = (COMMAND['transformReply'] extends (...args: any) => infer T ? T : COMMAND['transformReply'] extends Record<RESP, (...args: any) => infer T> ? T : ReplyUnion);
export type CommandSignature<COMMAND extends Command, RESP extends RespVersions, TYPE_MAPPING extends TypeMapping> = (...args: Tail<Parameters<COMMAND['parseCommand']>>) => Promise<ReplyWithTypeMapping<CommandReply<COMMAND, RESP>, TYPE_MAPPING>>;
export {};
//# sourceMappingURL=types.d.ts.map

File diff suppressed because one or more lines are too long

31
node_modules/@redis/client/dist/lib/RESP/types.js generated vendored Normal file
View File

@@ -0,0 +1,31 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const decoder_1 = require("./decoder");
// export type CommandWithPoliciesSignature<
// COMMAND extends Command,
// RESP extends RespVersions,
// TYPE_MAPPING extends TypeMapping,
// POLICIES extends CommandPolicies
// > = (...args: Parameters<COMMAND['transformArguments']>) => Promise<
// ReplyWithPolicy<
// ReplyWithTypeMapping<CommandReply<COMMAND, RESP>, TYPE_MAPPING>,
// MergePolicies<COMMAND, POLICIES>
// >
// >;
// export type MergePolicies<
// COMMAND extends Command,
// POLICIES extends CommandPolicies
// > = Omit<COMMAND['POLICIES'], keyof POLICIES> & POLICIES;
// type ReplyWithPolicy<
// REPLY,
// POLICIES extends CommandPolicies,
// > = (
// POLICIES['request'] extends REQUEST_POLICIES['SPECIAL'] ? never :
// POLICIES['request'] extends null | undefined ? REPLY :
// unknown extends POLICIES['request'] ? REPLY :
// POLICIES['response'] extends RESPONSE_POLICIES['SPECIAL'] ? never :
// POLICIES['response'] extends RESPONSE_POLICIES['ALL_SUCCEEDED' | 'ONE_SUCCEEDED' | 'LOGICAL_AND'] ? REPLY :
// // otherwise, return array of replies
// Array<REPLY>
// );
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../lib/RESP/types.ts"],"names":[],"mappings":";;AAIA,uCAAuC;AAsXvC,4CAA4C;AAC5C,6BAA6B;AAC7B,+BAA+B;AAC/B,sCAAsC;AACtC,qCAAqC;AACrC,uEAAuE;AACvE,qBAAqB;AACrB,uEAAuE;AACvE,uCAAuC;AACvC,MAAM;AACN,KAAK;AAEL,6BAA6B;AAC7B,6BAA6B;AAC7B,qCAAqC;AACrC,4DAA4D;AAE5D,wBAAwB;AACxB,WAAW;AACX,sCAAsC;AACtC,QAAQ;AACR,sEAAsE;AACtE,2DAA2D;AAC3D,kDAAkD;AAClD,wEAAwE;AACxE,gHAAgH;AAChH,0CAA0C;AAC1C,iBAAiB;AACjB,KAAK"}

View File

@@ -0,0 +1,5 @@
export declare class VerbatimString extends String {
format: string;
constructor(format: string, value: string);
}
//# sourceMappingURL=verbatim-string.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"verbatim-string.d.ts","sourceRoot":"","sources":["../../../lib/RESP/verbatim-string.ts"],"names":[],"mappings":"AAAA,qBAAa,cAAe,SAAQ,MAAM;IAE/B,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM;CAIhB"}

View File

@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VerbatimString = void 0;
class VerbatimString extends String {
format;
constructor(format, value) {
super(value);
this.format = format;
}
}
exports.VerbatimString = VerbatimString;
//# sourceMappingURL=verbatim-string.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"verbatim-string.js","sourceRoot":"","sources":["../../../lib/RESP/verbatim-string.ts"],"names":[],"mappings":";;;AAAA,MAAa,cAAe,SAAQ,MAAM;IAE/B;IADT,YACS,MAAc,EACrB,KAAa;QAEb,KAAK,CAAC,KAAK,CAAC,CAAC;QAHN,WAAM,GAAN,MAAM,CAAQ;IAIvB,CAAC;CACF;AAPD,wCAOC"}