Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@redis/json

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@redis/json - npm Package Compare versions

Comparing version 2.0.0-next.1 to 2.0.0-next.2

10

dist/lib/commands/ARRAPPEND.js

@@ -1,3 +0,5 @@

import { transformRedisJsonArgument } from '.';
export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require(".");
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -10,6 +12,6 @@ IS_READ_ONLY: false,

args[2] = path;
args[3] = transformRedisJsonArgument(json);
args[3] = (0, _1.transformRedisJsonArgument)(json);
let argsIndex = 4;
for (let i = 0; i < jsons.length; i++) {
args[argsIndex++] = transformRedisJsonArgument(jsons[i]);
args[argsIndex++] = (0, _1.transformRedisJsonArgument)(jsons[i]);
}

@@ -16,0 +18,0 @@ return args;

8

dist/lib/commands/ARRINDEX.js

@@ -1,7 +0,9 @@

import { transformRedisJsonArgument } from '.';
export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require(".");
exports.default = {
FIRST_KEY_INDEX: 1,
IS_READ_ONLY: true,
transformArguments(key, path, json, options) {
const args = ['JSON.ARRINDEX', key, path, transformRedisJsonArgument(json)];
const args = ['JSON.ARRINDEX', key, path, (0, _1.transformRedisJsonArgument)(json)];
if (options?.range) {

@@ -8,0 +10,0 @@ args.push(options.range.start.toString());

@@ -1,3 +0,5 @@

import { transformRedisJsonArgument } from '.';
export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require(".");
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -11,6 +13,6 @@ IS_READ_ONLY: false,

args[3] = index.toString();
args[4] = transformRedisJsonArgument(json);
args[4] = (0, _1.transformRedisJsonArgument)(json);
let argsIndex = 5;
for (let i = 0; i < jsons.length; i++) {
args[argsIndex++] = transformRedisJsonArgument(jsons[i]);
args[argsIndex++] = (0, _1.transformRedisJsonArgument)(jsons[i]);
}

@@ -17,0 +19,0 @@ return args;

@@ -1,2 +0,4 @@

export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -3,0 +5,0 @@ IS_READ_ONLY: true,

@@ -1,4 +0,6 @@

import { isArrayReply } from '@redis/client/dist/lib/commands/generic-transformers';
import { transformRedisJsonNullReply } from '.';
export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const generic_transformers_1 = require("@redis/client/dist/lib/commands/generic-transformers");
const _1 = require(".");
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -17,6 +19,6 @@ IS_READ_ONLY: false,

transformReply(reply) {
return isArrayReply(reply) ?
reply.map(item => transformRedisJsonNullReply(item)) :
transformRedisJsonNullReply(reply);
return (0, generic_transformers_1.isArrayReply)(reply) ?
reply.map(item => (0, _1.transformRedisJsonNullReply)(item)) :
(0, _1.transformRedisJsonNullReply)(reply);
}
};

@@ -1,2 +0,4 @@

export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -3,0 +5,0 @@ IS_READ_ONLY: false,

@@ -1,2 +0,4 @@

export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -3,0 +5,0 @@ IS_READ_ONLY: false,

@@ -1,2 +0,4 @@

export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
FIRST_KEY_INDEX: 2,

@@ -3,0 +5,0 @@ IS_READ_ONLY: false,

@@ -1,2 +0,4 @@

export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -3,0 +5,0 @@ IS_READ_ONLY: false,

@@ -1,2 +0,4 @@

export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -3,0 +5,0 @@ IS_READ_ONLY: false,

@@ -1,4 +0,6 @@

import { pushVariadicArguments } from '@redis/client/dist/lib/commands/generic-transformers';
import { transformRedisJsonNullReply } from '.';
export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const generic_transformers_1 = require("@redis/client/dist/lib/commands/generic-transformers");
const _1 = require(".");
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -9,7 +11,7 @@ IS_READ_ONLY: false,

if (options?.path !== undefined) {
args = pushVariadicArguments(args, options.path);
args = (0, generic_transformers_1.pushVariadicArguments)(args, options.path);
}
return args;
},
transformReply: transformRedisJsonNullReply
transformReply: _1.transformRedisJsonNullReply
};

@@ -1,90 +0,99 @@

import ARRAPPEND from './ARRAPPEND';
import ARRINDEX from './ARRINDEX';
import ARRINSERT from './ARRINSERT';
import ARRLEN from './ARRLEN';
import ARRPOP from './ARRPOP';
import ARRTRIM from './ARRTRIM';
import CLEAR from './CLEAR';
import DEBUG_MEMORY from './DEBUG_MEMORY';
import DEL from './DEL';
import FORGET from './FORGET';
import GET from './GET';
import MERGE from './MERGE';
import MGET from './MGET';
import MSET from './MSET';
import NUMINCRBY from './NUMINCRBY';
import NUMMULTBY from './NUMMULTBY';
import OBJKEYS from './OBJKEYS';
import OBJLEN from './OBJLEN';
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.transformRedisJsonNullReply = exports.transformRedisJsonReply = exports.transformRedisJsonArgument = void 0;
const ARRAPPEND_1 = __importDefault(require("./ARRAPPEND"));
const ARRINDEX_1 = __importDefault(require("./ARRINDEX"));
const ARRINSERT_1 = __importDefault(require("./ARRINSERT"));
const ARRLEN_1 = __importDefault(require("./ARRLEN"));
const ARRPOP_1 = __importDefault(require("./ARRPOP"));
const ARRTRIM_1 = __importDefault(require("./ARRTRIM"));
const CLEAR_1 = __importDefault(require("./CLEAR"));
const DEBUG_MEMORY_1 = __importDefault(require("./DEBUG_MEMORY"));
const DEL_1 = __importDefault(require("./DEL"));
const FORGET_1 = __importDefault(require("./FORGET"));
const GET_1 = __importDefault(require("./GET"));
const MERGE_1 = __importDefault(require("./MERGE"));
const MGET_1 = __importDefault(require("./MGET"));
const MSET_1 = __importDefault(require("./MSET"));
const NUMINCRBY_1 = __importDefault(require("./NUMINCRBY"));
const NUMMULTBY_1 = __importDefault(require("./NUMMULTBY"));
const OBJKEYS_1 = __importDefault(require("./OBJKEYS"));
const OBJLEN_1 = __importDefault(require("./OBJLEN"));
// import RESP from './RESP';
import SET from './SET';
import STRAPPEND from './STRAPPEND';
import STRLEN from './STRLEN';
import TOGGLE from './TOGGLE';
import TYPE from './TYPE';
import { isNullReply } from '@redis/client/dist/lib/commands/generic-transformers';
export default {
ARRAPPEND,
arrAppend: ARRAPPEND,
ARRINDEX,
arrIndex: ARRINDEX,
ARRINSERT,
arrInsert: ARRINSERT,
ARRLEN,
arrLen: ARRLEN,
ARRPOP,
arrPop: ARRPOP,
ARRTRIM,
arrTrim: ARRTRIM,
CLEAR,
clear: CLEAR,
DEBUG_MEMORY,
debugMemory: DEBUG_MEMORY,
DEL,
del: DEL,
FORGET,
forget: FORGET,
GET,
get: GET,
MERGE,
merge: MERGE,
MGET,
mGet: MGET,
MSET,
mSet: MSET,
NUMINCRBY,
numIncrBy: NUMINCRBY,
const SET_1 = __importDefault(require("./SET"));
const STRAPPEND_1 = __importDefault(require("./STRAPPEND"));
const STRLEN_1 = __importDefault(require("./STRLEN"));
const TOGGLE_1 = __importDefault(require("./TOGGLE"));
const TYPE_1 = __importDefault(require("./TYPE"));
const generic_transformers_1 = require("@redis/client/dist/lib/commands/generic-transformers");
exports.default = {
ARRAPPEND: ARRAPPEND_1.default,
arrAppend: ARRAPPEND_1.default,
ARRINDEX: ARRINDEX_1.default,
arrIndex: ARRINDEX_1.default,
ARRINSERT: ARRINSERT_1.default,
arrInsert: ARRINSERT_1.default,
ARRLEN: ARRLEN_1.default,
arrLen: ARRLEN_1.default,
ARRPOP: ARRPOP_1.default,
arrPop: ARRPOP_1.default,
ARRTRIM: ARRTRIM_1.default,
arrTrim: ARRTRIM_1.default,
CLEAR: CLEAR_1.default,
clear: CLEAR_1.default,
DEBUG_MEMORY: DEBUG_MEMORY_1.default,
debugMemory: DEBUG_MEMORY_1.default,
DEL: DEL_1.default,
del: DEL_1.default,
FORGET: FORGET_1.default,
forget: FORGET_1.default,
GET: GET_1.default,
get: GET_1.default,
MERGE: MERGE_1.default,
merge: MERGE_1.default,
MGET: MGET_1.default,
mGet: MGET_1.default,
MSET: MSET_1.default,
mSet: MSET_1.default,
NUMINCRBY: NUMINCRBY_1.default,
numIncrBy: NUMINCRBY_1.default,
/**
* @deprecated since JSON version 2.0
*/
NUMMULTBY,
NUMMULTBY: NUMMULTBY_1.default,
/**
* @deprecated since JSON version 2.0
*/
numMultBy: NUMMULTBY,
OBJKEYS,
objKeys: OBJKEYS,
OBJLEN,
objLen: OBJLEN,
numMultBy: NUMMULTBY_1.default,
OBJKEYS: OBJKEYS_1.default,
objKeys: OBJKEYS_1.default,
OBJLEN: OBJLEN_1.default,
objLen: OBJLEN_1.default,
// RESP,
// resp: RESP,
SET,
set: SET,
STRAPPEND,
strAppend: STRAPPEND,
STRLEN,
strLen: STRLEN,
TOGGLE,
toggle: TOGGLE,
TYPE,
type: TYPE
SET: SET_1.default,
set: SET_1.default,
STRAPPEND: STRAPPEND_1.default,
strAppend: STRAPPEND_1.default,
STRLEN: STRLEN_1.default,
strLen: STRLEN_1.default,
TOGGLE: TOGGLE_1.default,
toggle: TOGGLE_1.default,
TYPE: TYPE_1.default,
type: TYPE_1.default
};
export function transformRedisJsonArgument(json) {
function transformRedisJsonArgument(json) {
return JSON.stringify(json);
}
export function transformRedisJsonReply(json) {
exports.transformRedisJsonArgument = transformRedisJsonArgument;
function transformRedisJsonReply(json) {
return JSON.parse(json.toString());
}
export function transformRedisJsonNullReply(json) {
return isNullReply(json) ? json : transformRedisJsonReply(json);
exports.transformRedisJsonReply = transformRedisJsonReply;
function transformRedisJsonNullReply(json) {
return (0, generic_transformers_1.isNullReply)(json) ? json : transformRedisJsonReply(json);
}
exports.transformRedisJsonNullReply = transformRedisJsonNullReply;

@@ -1,3 +0,5 @@

import { transformRedisJsonArgument } from '.';
export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require(".");
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -10,3 +12,3 @@ IS_READ_ONLY: false,

path,
transformRedisJsonArgument(value)
(0, _1.transformRedisJsonArgument)(value)
];

@@ -13,0 +15,0 @@ },

@@ -1,3 +0,5 @@

import { transformRedisJsonNullReply } from '.';
export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require(".");
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -13,4 +15,4 @@ IS_READ_ONLY: true,

transformReply(reply) {
return reply.map(json => transformRedisJsonNullReply(json));
return reply.map(json => (0, _1.transformRedisJsonNullReply)(json));
}
};

@@ -1,3 +0,5 @@

import { transformRedisJsonArgument } from '.';
export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require(".");
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -13,3 +15,3 @@ IS_READ_ONLY: false,

args[argsIndex++] = item.path;
args[argsIndex++] = transformRedisJsonArgument(item.value);
args[argsIndex++] = (0, _1.transformRedisJsonArgument)(item.value);
}

@@ -16,0 +18,0 @@ return args;

@@ -1,2 +0,4 @@

export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -3,0 +5,0 @@ IS_READ_ONLY: false,

@@ -1,3 +0,8 @@

import NUMINCRBY from './NUMINCRBY';
export default {
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const NUMINCRBY_1 = __importDefault(require("./NUMINCRBY"));
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -8,3 +13,3 @@ IS_READ_ONLY: false,

},
transformReply: NUMINCRBY.transformReply
transformReply: NUMINCRBY_1.default.transformReply
};

@@ -1,2 +0,4 @@

export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -3,0 +5,0 @@ IS_READ_ONLY: false,

@@ -1,2 +0,4 @@

export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -3,0 +5,0 @@ IS_READ_ONLY: true,

@@ -1,3 +0,6 @@

export const FIRST_KEY_INDEX = 1;
export function transformArguments(key, path) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.transformArguments = exports.FIRST_KEY_INDEX = void 0;
exports.FIRST_KEY_INDEX = 1;
function transformArguments(key, path) {
const args = ['JSON.RESP', key];

@@ -9,1 +12,2 @@ if (path) {

}
exports.transformArguments = transformArguments;

@@ -1,7 +0,9 @@

import { transformRedisJsonArgument } from '.';
export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require(".");
exports.default = {
FIRST_KEY_INDEX: 1,
IS_READ_ONLY: false,
transformArguments(key, path, json, options) {
const args = ['JSON.SET', key, path, transformRedisJsonArgument(json)];
const args = ['JSON.SET', key, path, (0, _1.transformRedisJsonArgument)(json)];
if (options?.condition) {

@@ -8,0 +10,0 @@ args.push(options?.condition);

@@ -1,3 +0,5 @@

import { transformRedisJsonArgument } from '.';
export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require(".");
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -10,3 +12,3 @@ IS_READ_ONLY: false,

}
args.push(transformRedisJsonArgument(append));
args.push((0, _1.transformRedisJsonArgument)(append));
return args;

@@ -13,0 +15,0 @@ },

@@ -1,2 +0,4 @@

export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -3,0 +5,0 @@ IS_READ_ONLY: true,

@@ -1,2 +0,4 @@

export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -3,0 +5,0 @@ IS_READ_ONLY: false,

@@ -1,2 +0,4 @@

export default {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
FIRST_KEY_INDEX: 1,

@@ -3,0 +5,0 @@ IS_READ_ONLY: true,

@@ -1,1 +0,8 @@

export { default } from './commands';
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = void 0;
var commands_1 = require("./commands");
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(commands_1).default; } });
{
"name": "@redis/json",
"version": "2.0.0-next.1",
"version": "2.0.0-next.2",
"license": "MIT",

@@ -8,3 +8,4 @@ "main": "./dist/lib/index.js",

"files": [
"dist/"
"dist/",
"!dist/tsconfig.tsbuildinfo"
],

@@ -15,3 +16,3 @@ "scripts": {

"peerDependencies": {
"@redis/client": "^2.0.0-next.3"
"@redis/client": "^2.0.0-next.4"
},

@@ -18,0 +19,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc