@pi-r/redis 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/client/index.js +5 -9
  2. package/package.json +4 -4
package/client/index.js CHANGED
@@ -260,12 +260,8 @@ async function executeBatchQuery(batch, options = '', outResult) {
260
260
  return;
261
261
  }
262
262
  const has = (n) => typeof n === 'number' && n > 0;
263
- const failKey = () => {
264
- failed(types.errorMessage(f, "Invalid key", Db.asString(k) || "Unknown"));
265
- };
266
- const failValue = () => {
267
- failed(types.errorMessage(f, "Invalid value", Db.asString(v) || "Unknown"));
268
- };
263
+ const failKey = () => failed(types.errorMessage(f, "Invalid key", Db.asString(k) || "Unknown"));
264
+ const failValue = () => failed(types.errorMessage(f, "Invalid value", Db.asString(v) || "Unknown"));
269
265
  if (types.isPlainObject(setOptions.command)) {
270
266
  client = client.withCommandOptions(setOptions.command);
271
267
  }
@@ -361,7 +357,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
361
357
  else if (typeof k === 'string' || Buffer.isBuffer(k)) {
362
358
  ({ EX, PX, EXAT, PXAT, KEEPTTL } = target);
363
359
  const field = target.field;
364
- if (field === undefined && field === null) {
360
+ if (field == null) {
365
361
  if (a(v)) {
366
362
  const flags = setOptions.set || {};
367
363
  if (NX) {
@@ -434,7 +430,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
434
430
  }
435
431
  if (pending) {
436
432
  pending.then(async (code) => {
437
- if (code === undefined || code === null || code !== -Infinity && types.isString(code) && code !== 'OK' || typeof code === 'number' && code <= codeMin || Array.isArray(code) && code.every(resp => resp === null || typeof resp === 'number' && resp <= codeMin)) {
433
+ if (code == null || code !== -Infinity && types.isString(code) && code !== 'OK' || typeof code === 'number' && code <= codeMin || Array.isArray(code) && code.every(resp => resp === null || typeof resp === 'number' && resp <= codeMin)) {
438
434
  failValue();
439
435
  return;
440
436
  }
@@ -602,7 +598,7 @@ async function executeBatchQuery(batch, options = '', outResult) {
602
598
  }
603
599
  rows = (targetObject ? targetObject(item, data) : data);
604
600
  }
605
- if (rows === undefined) {
601
+ if (rows == null) {
606
602
  throw types.errorMessage(source, "Missing database query");
607
603
  }
608
604
  this.add(item, 4);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-r/redis",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "Redis client driver for E-mc.",
5
5
  "main": "client/index.js",
6
6
  "types": "client/index.d.ts",
@@ -20,8 +20,8 @@
20
20
  "license": "MIT",
21
21
  "homepage": "https://github.com/anpham6/pi-r#readme",
22
22
  "dependencies": {
23
- "@e-mc/db": "^0.13.0",
24
- "@e-mc/types": "^0.13.0",
25
- "redis": "^5.8.3"
23
+ "@e-mc/db": "^0.13.5",
24
+ "@e-mc/types": "^0.13.5",
25
+ "redis": "^5.10.0"
26
26
  }
27
27
  }