@naturalcycles/redis-lib 4.2.0 → 4.3.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.
@@ -257,8 +257,8 @@ function createReadableFromAsync(fn) {
257
257
  });
258
258
  void fn()
259
259
  .then(readable => {
260
- readable.on('error', err => transform.emit('error', err)).pipe(transform);
260
+ readable.on('error', err => transform.destroy(err)).pipe(transform);
261
261
  })
262
- .catch(err => transform.emit('error', err));
262
+ .catch(err => transform.destroy(err));
263
263
  return transform;
264
264
  }
@@ -17,10 +17,7 @@ import type { RedisKeyValueDBCfg } from './redisKeyValueDB.js';
17
17
  export declare class RedisHashKeyValueDB implements CommonKeyValueDB, AsyncDisposable {
18
18
  cfg: RedisKeyValueDBCfg;
19
19
  constructor(cfg: RedisKeyValueDBCfg);
20
- support: {
21
- count?: boolean;
22
- increment?: boolean;
23
- };
20
+ support: any;
24
21
  ping(): Promise<void>;
25
22
  [Symbol.asyncDispose](): Promise<void>;
26
23
  getByIds(table: string, ids: string[]): Promise<KeyValueDBTuple[]>;
@@ -8,10 +8,7 @@ export interface RedisKeyValueDBCfg {
8
8
  export declare class RedisKeyValueDB implements CommonKeyValueDB, AsyncDisposable {
9
9
  cfg: RedisKeyValueDBCfg;
10
10
  constructor(cfg: RedisKeyValueDBCfg);
11
- support: {
12
- count?: boolean;
13
- increment?: boolean;
14
- };
11
+ support: any;
15
12
  ping(): Promise<void>;
16
13
  [Symbol.asyncDispose](): Promise<void>;
17
14
  getByIds(table: string, ids: string[]): Promise<KeyValueDBTuple[]>;
@@ -1,5 +1,6 @@
1
1
  import { commonKeyValueDBFullSupport } from '@naturalcycles/db-lib/kv';
2
- import { _isTruthy, _zip } from '@naturalcycles/js-lib';
2
+ import { _isTruthy } from '@naturalcycles/js-lib';
3
+ import { _zip } from '@naturalcycles/js-lib/array/array.util.js';
3
4
  export class RedisKeyValueDB {
4
5
  cfg;
5
6
  constructor(cfg) {
package/package.json CHANGED
@@ -9,8 +9,8 @@
9
9
  "tslib": "^2"
10
10
  },
11
11
  "devDependencies": {
12
- "@naturalcycles/dev-lib": "*",
13
- "@types/node": "^24"
12
+ "@types/node": "^24",
13
+ "@naturalcycles/dev-lib": "18.4.2"
14
14
  },
15
15
  "exports": {
16
16
  ".": "./dist/index.js"
@@ -37,7 +37,7 @@
37
37
  "engines": {
38
38
  "node": ">=22.12.0"
39
39
  },
40
- "version": "4.2.0",
40
+ "version": "4.3.1",
41
41
  "description": "Redis implementation of CommonKeyValueDB interface",
42
42
  "author": "Natural Cycles Team",
43
43
  "license": "MIT",
@@ -359,9 +359,9 @@ function createReadableFromAsync<T>(fn: AsyncFunction<ReadableTyped<T>>): Readab
359
359
 
360
360
  void fn()
361
361
  .then(readable => {
362
- readable.on('error', err => transform.emit('error', err)).pipe(transform)
362
+ readable.on('error', err => transform.destroy(err)).pipe(transform)
363
363
  })
364
- .catch(err => transform.emit('error', err))
364
+ .catch(err => transform.destroy(err))
365
365
 
366
366
  return transform
367
367
  }
@@ -6,7 +6,8 @@ import type {
6
6
  KeyValueDBTuple,
7
7
  } from '@naturalcycles/db-lib/kv'
8
8
  import { commonKeyValueDBFullSupport } from '@naturalcycles/db-lib/kv'
9
- import { _isTruthy, _zip } from '@naturalcycles/js-lib'
9
+ import { _isTruthy } from '@naturalcycles/js-lib'
10
+ import { _zip } from '@naturalcycles/js-lib/array/array.util.js'
10
11
  import type { ReadableTyped } from '@naturalcycles/nodejs-lib/stream'
11
12
  import type { RedisClient } from './redisClient.js'
12
13