@polkadot/rpc-core 9.2.2 → 9.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.
@@ -11,6 +11,6 @@ const packageInfo = {
11
11
  name: '@polkadot/rpc-core',
12
12
  path: typeof __dirname === 'string' ? __dirname : 'auto',
13
13
  type: 'cjs',
14
- version: '9.2.2'
14
+ version: '9.3.1'
15
15
  };
16
16
  exports.packageInfo = packageInfo;
package/cjs/util/drr.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.drr = void 0;
6
+ exports.drr = drr;
7
7
 
8
8
  var _rxjs = require("rxjs");
9
9
 
@@ -13,20 +13,20 @@ var _refCountDelay = require("./refCountDelay");
13
13
 
14
14
  // Copyright 2017-2022 @polkadot/rpc-core authors & contributors
15
15
  // SPDX-License-Identifier: Apache-2.0
16
- const l = (0, _util.logger)('drr');
17
-
18
- const CMP = (a, b) => (0, _util.stringify)({
19
- t: a
20
- }) === (0, _util.stringify)({
21
- t: b
22
- });
23
-
24
- const ERR = error => {
25
- l.error(error.message);
16
+ function CMP(a, b) {
17
+ return (0, _util.stringify)({
18
+ t: a
19
+ }) === (0, _util.stringify)({
20
+ t: b
21
+ });
22
+ }
23
+
24
+ function ERR(error) {
26
25
  throw error;
27
- };
26
+ }
28
27
 
29
- const NOOP = () => undefined;
28
+ function NOOP() {// empty
29
+ }
30
30
  /**
31
31
  * Shorthand for distinctUntilChanged(), publishReplay(1) and refCount().
32
32
  *
@@ -35,13 +35,11 @@ const NOOP = () => undefined;
35
35
  */
36
36
 
37
37
 
38
- const drr = function () {
38
+ function drr() {
39
39
  let {
40
40
  delay,
41
41
  skipChange = false,
42
42
  skipTimeout = false
43
43
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
44
44
  return source$ => source$.pipe((0, _rxjs.catchError)(ERR), skipChange ? (0, _rxjs.tap)(NOOP) : (0, _rxjs.distinctUntilChanged)(CMP), (0, _rxjs.publishReplay)(1), skipTimeout ? (0, _rxjs.refCount)() : (0, _refCountDelay.refCountDelay)(delay));
45
- };
46
-
47
- exports.drr = drr;
45
+ }
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "./cjs/detectPackage.js"
21
21
  ],
22
22
  "type": "module",
23
- "version": "9.2.2",
23
+ "version": "9.3.1",
24
24
  "main": "./cjs/index.js",
25
25
  "module": "./index.js",
26
26
  "types": "./index.d.ts",
@@ -96,10 +96,10 @@
96
96
  },
97
97
  "dependencies": {
98
98
  "@babel/runtime": "^7.18.9",
99
- "@polkadot/rpc-augment": "9.2.2",
100
- "@polkadot/rpc-provider": "9.2.2",
101
- "@polkadot/types": "9.2.2",
102
- "@polkadot/util": "^10.1.4",
99
+ "@polkadot/rpc-augment": "9.3.1",
100
+ "@polkadot/rpc-provider": "9.3.1",
101
+ "@polkadot/types": "9.3.1",
102
+ "@polkadot/util": "^10.1.7",
103
103
  "rxjs": "^7.5.6"
104
104
  }
105
105
  }
package/packageInfo.js CHANGED
@@ -5,5 +5,5 @@ export const packageInfo = {
5
5
  name: '@polkadot/rpc-core',
6
6
  path: (import.meta && import.meta.url) ? new URL(import.meta.url).pathname.substring(0, new URL(import.meta.url).pathname.lastIndexOf('/') + 1) : 'auto',
7
7
  type: 'esm',
8
- version: '9.2.2'
8
+ version: '9.3.1'
9
9
  };
package/util/drr.d.ts CHANGED
@@ -11,5 +11,5 @@ interface Options {
11
11
  * @ignore
12
12
  * @internal
13
13
  */
14
- export declare const drr: ({ delay, skipChange, skipTimeout }?: Options) => DrrResult;
14
+ export declare function drr({ delay, skipChange, skipTimeout }?: Options): DrrResult;
15
15
  export {};
package/util/drr.js CHANGED
@@ -1,22 +1,23 @@
1
1
  // Copyright 2017-2022 @polkadot/rpc-core authors & contributors
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import { catchError, distinctUntilChanged, publishReplay, refCount, tap } from 'rxjs';
4
- import { logger, stringify } from '@polkadot/util';
4
+ import { stringify } from '@polkadot/util';
5
5
  import { refCountDelay } from "./refCountDelay.js";
6
- const l = logger('drr');
7
6
 
8
- const CMP = (a, b) => stringify({
9
- t: a
10
- }) === stringify({
11
- t: b
12
- });
7
+ function CMP(a, b) {
8
+ return stringify({
9
+ t: a
10
+ }) === stringify({
11
+ t: b
12
+ });
13
+ }
13
14
 
14
- const ERR = error => {
15
- l.error(error.message);
15
+ function ERR(error) {
16
16
  throw error;
17
- };
17
+ }
18
18
 
19
- const NOOP = () => undefined;
19
+ function NOOP() {// empty
20
+ }
20
21
  /**
21
22
  * Shorthand for distinctUntilChanged(), publishReplay(1) and refCount().
22
23
  *
@@ -25,8 +26,10 @@ const NOOP = () => undefined;
25
26
  */
26
27
 
27
28
 
28
- export const drr = ({
29
+ export function drr({
29
30
  delay,
30
31
  skipChange = false,
31
32
  skipTimeout = false
32
- } = {}) => source$ => source$.pipe(catchError(ERR), skipChange ? tap(NOOP) : distinctUntilChanged(CMP), publishReplay(1), skipTimeout ? refCount() : refCountDelay(delay));
33
+ } = {}) {
34
+ return source$ => source$.pipe(catchError(ERR), skipChange ? tap(NOOP) : distinctUntilChanged(CMP), publishReplay(1), skipTimeout ? refCount() : refCountDelay(delay));
35
+ }