memx 0.0.6 → 0.1.0

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 (78) hide show
  1. package/dist/buffers.cjs +50 -0
  2. package/dist/buffers.cjs.map +6 -0
  3. package/dist/buffers.d.ts +14 -0
  4. package/dist/buffers.mjs +25 -0
  5. package/dist/buffers.mjs.map +6 -0
  6. package/dist/client.cjs +251 -0
  7. package/dist/client.cjs.map +6 -0
  8. package/dist/client.d.ts +76 -0
  9. package/dist/client.mjs +216 -0
  10. package/dist/client.mjs.map +6 -0
  11. package/dist/cluster.cjs +147 -0
  12. package/dist/cluster.cjs.map +6 -0
  13. package/dist/cluster.d.ts +60 -0
  14. package/dist/cluster.mjs +112 -0
  15. package/dist/cluster.mjs.map +6 -0
  16. package/dist/connection.cjs +186 -0
  17. package/dist/connection.cjs.map +6 -0
  18. package/dist/connection.d.ts +18 -0
  19. package/dist/connection.mjs +151 -0
  20. package/dist/connection.mjs.map +6 -0
  21. package/dist/constants.cjs +140 -0
  22. package/dist/constants.cjs.map +6 -0
  23. package/dist/constants.d.ts +87 -0
  24. package/dist/constants.mjs +107 -0
  25. package/dist/constants.mjs.map +6 -0
  26. package/dist/decode.cjs +101 -0
  27. package/dist/decode.cjs.map +6 -0
  28. package/dist/decode.d.ts +16 -0
  29. package/dist/decode.mjs +66 -0
  30. package/dist/decode.mjs.map +6 -0
  31. package/dist/encode.cjs +70 -0
  32. package/dist/encode.cjs.map +6 -0
  33. package/dist/encode.d.ts +20 -0
  34. package/dist/encode.mjs +45 -0
  35. package/dist/encode.mjs.map +6 -0
  36. package/dist/fake.cjs +183 -0
  37. package/dist/fake.cjs.map +6 -0
  38. package/dist/fake.d.ts +53 -0
  39. package/dist/fake.mjs +157 -0
  40. package/dist/fake.mjs.map +6 -0
  41. package/dist/index.cjs +57 -0
  42. package/dist/index.cjs.map +6 -0
  43. package/dist/index.d.ts +12 -0
  44. package/dist/index.mjs +15 -1454
  45. package/dist/index.mjs.map +2 -2
  46. package/dist/internals.cjs +58 -0
  47. package/dist/internals.cjs.map +6 -0
  48. package/dist/internals.d.ts +7 -0
  49. package/dist/internals.mjs +21 -0
  50. package/dist/internals.mjs.map +6 -0
  51. package/dist/server.cjs +468 -0
  52. package/dist/server.cjs.map +6 -0
  53. package/dist/server.d.ts +59 -0
  54. package/dist/server.mjs +443 -0
  55. package/dist/server.mjs.map +6 -0
  56. package/dist/types.cjs +19 -0
  57. package/dist/types.cjs.map +6 -0
  58. package/dist/types.d.ts +239 -0
  59. package/dist/types.mjs +1 -0
  60. package/dist/types.mjs.map +6 -0
  61. package/dist/utils.cjs +182 -0
  62. package/dist/utils.cjs.map +6 -0
  63. package/dist/utils.d.ts +22 -0
  64. package/dist/utils.mjs +145 -0
  65. package/dist/utils.mjs.map +6 -0
  66. package/package.json +29 -27
  67. package/src/client.ts +37 -35
  68. package/src/cluster.ts +6 -3
  69. package/src/connection.ts +8 -4
  70. package/src/decode.ts +5 -2
  71. package/src/encode.ts +5 -2
  72. package/src/fake.ts +41 -33
  73. package/src/internals.ts +7 -7
  74. package/src/server.ts +47 -45
  75. package/src/utils.ts +13 -10
  76. package/dist/index.js +0 -1489
  77. package/dist/index.js.map +0 -6
  78. package/index.d.ts +0 -706
package/package.json CHANGED
@@ -1,48 +1,50 @@
1
1
  {
2
2
  "name": "memx",
3
- "version": "0.0.6",
3
+ "version": "0.1.0",
4
4
  "description": "Simple and fast memcached client",
5
- "main": "./dist/index.js",
5
+ "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
+ "types": "./dist/index.d.ts",
8
+ "type": "commonjs",
7
9
  "exports": {
8
10
  ".": {
9
- "import": "./dist/index.mjs",
10
- "require": "./dist/index.js"
11
+ "require": {
12
+ "types": "./dist/index.d.ts",
13
+ "default": "./dist/index.cjs"
14
+ },
15
+ "import": {
16
+ "types": "./dist/index.d.ts",
17
+ "default": "./dist/index.mjs"
18
+ }
11
19
  }
12
20
  },
13
- "types": "./index.d.ts",
14
21
  "scripts": {
15
- "build": "./build.sh",
16
- "dev": "nodemon -e ts -x ./build.sh -w src -w test",
17
- "lint": "eslint src test",
18
- "prepare": "patch -N -p0 -i .nyc.patch || true"
22
+ "build": "plug",
23
+ "coverage": "plug coverage",
24
+ "dev": "plug coverage -w src -w test",
25
+ "lint": "plug lint",
26
+ "test": "plug test",
27
+ "transpile": "plug transpile"
19
28
  },
20
29
  "author": "Juit Developers <developers@juit.com>",
21
30
  "license": "Apache-2.0",
22
31
  "devDependencies": {
23
- "@microsoft/api-extractor": "^7.19.5",
24
- "@types/chai": "^4.3.0",
32
+ "@plugjs/build": "^0.2.2",
33
+ "@types/chai": "^4.3.4",
25
34
  "@types/chai-as-promised": "^7.1.5",
26
- "@types/memjs": "^1.2.4",
27
- "@types/mocha": "^9.1.0",
28
- "@types/node": "~16.11.26",
29
- "@types/source-map-support": "^0.5.4",
30
- "@typescript-eslint/eslint-plugin": "^5.15.0",
31
- "@typescript-eslint/parser": "^5.15.0",
32
- "chai": "^4.3.6",
35
+ "@types/memjs": "^1.3.0",
36
+ "chai": "^4.3.7",
33
37
  "chai-as-promised": "^7.1.1",
34
38
  "chai-exclude": "^2.1.0",
35
- "esbuild": "^0.14.27",
36
- "eslint": "^8.11.0",
37
- "eslint-config-google": "^0.14.0",
38
39
  "memjs": "^1.3.0",
39
- "mocha": "^9.2.2",
40
- "nodemon": "^2.0.15",
41
- "nyc": "^15.1.0",
42
- "source-map-support": "^0.5.21",
43
- "typescript": "^4.6.2"
40
+ "typescript": "^4.9.5"
44
41
  },
45
42
  "directories": {
46
43
  "test": "test"
47
- }
44
+ },
45
+ "files": [
46
+ "*.md",
47
+ "dist/",
48
+ "src/"
49
+ ]
48
50
  }
package/src/client.ts CHANGED
@@ -1,10 +1,12 @@
1
- import assert from 'assert'
2
- import { types } from 'util'
1
+ import assert from 'node:assert'
2
+ import { types } from 'node:util'
3
3
 
4
- import { ClusterAdapter, ClusterOptions } from './cluster'
4
+ import { ClusterAdapter } from './cluster'
5
5
  import { EMPTY_BUFFER, FLAGS } from './constants'
6
6
  import { typedArrayFlags } from './internals'
7
- import { Adapter, AdapterResult, Counter, Stats } from './types'
7
+
8
+ import type { ClusterOptions } from './cluster'
9
+ import type { Adapter, AdapterResult, Counter, Stats } from './types'
8
10
 
9
11
  /** JSON replacere function serializing `bigint`, {@link Date}, {@link Set} and {@link Map}. */
10
12
  function replacer(this: any, key: string, value: any): any {
@@ -16,7 +18,7 @@ function replacer(this: any, key: string, value: any): any {
16
18
  }
17
19
 
18
20
  /** JSON reviver function deserializing `bigint`, {@link Date}, {@link Set} and {@link Map}. */
19
- function reviver(this: any, key: string, value: any): any {
21
+ function reviver(this: any, _key: string, value: any): any {
20
22
  if (Array.isArray(value)) {
21
23
  switch (value[0]) {
22
24
  case '\0__$BIGINT$__\0': return BigInt(value[1])
@@ -120,8 +122,8 @@ function fromBuffer<T extends Serializable>(result: AdapterResult): ClientResult
120
122
 
121
123
  /** Create a {@link NodeJS.TypedArray} copying the contents of its source {@link Buffer} */
122
124
  function makeTypedArray<T extends NodeJS.TypedArray>(
123
- constructor: TypedArrayConstructor<T>,
124
- source: Buffer,
125
+ constructor: TypedArrayConstructor<T>,
126
+ source: Buffer,
125
127
  ): T {
126
128
  const clone = Buffer.from(source)
127
129
  const { buffer, byteOffset, byteLength } = clone
@@ -130,15 +132,15 @@ function makeTypedArray<T extends NodeJS.TypedArray>(
130
132
 
131
133
  /* ========================================================================== */
132
134
 
133
- /** Types that can be serialized by our {@link Client}. */
135
+ /** Types that can be serialized by our {@link MemxClient}. */
134
136
  export type Serializable = bigint | string | number | boolean | null | object
135
137
 
136
- /** Types that can be appended/prepended by our {@link Client}. */
138
+ /** Types that can be appended/prepended by our {@link MemxClient}. */
137
139
  export type Appendable = string | NodeJS.TypedArray
138
140
 
139
141
  /** The `ClientResult` interface associate a value with its _CAS_. */
140
142
  export interface ClientResult<T extends Serializable> {
141
- /** The value returned by the {@link Client} */
143
+ /** The value returned by the {@link MemxClient} */
142
144
  value: T
143
145
  /** The _CAS_ of the value being returned */
144
146
  cas: bigint
@@ -147,15 +149,15 @@ export interface ClientResult<T extends Serializable> {
147
149
  /**
148
150
  * A `Client` represents a high-level client for a _Memcached_ server.
149
151
  */
150
- export class Client {
152
+ export class MemxClient {
151
153
  #adapter!: Adapter
152
154
  #prefix: string
153
155
 
154
- /** Construct a new {@link Client} from environment variables */
156
+ /** Construct a new {@link MemxClient} from environment variables */
155
157
  constructor()
156
- /** Construct a new {@link Client} wrapping an existing {@link Adapter} */
158
+ /** Construct a new {@link MemxClient} wrapping an existing {@link Adapter} */
157
159
  constructor(adapter: Adapter)
158
- /** Construct a new {@link Client} given the specified {@link ClusterOptions} */
160
+ /** Construct a new {@link MemxClient} given the specified {@link ClusterOptions} */
159
161
  constructor(options: ClusterOptions)
160
162
 
161
163
  constructor(adapterOrOptions?: Adapter | ClusterOptions) {
@@ -172,20 +174,20 @@ export class Client {
172
174
  assert(this.#adapter, 'Invalid client constructor arguments')
173
175
  }
174
176
 
175
- /** Return the {@link Adapter} backing this {@link Client} instance */
177
+ /** Return the {@link Adapter} backing this {@link MemxClient} instance */
176
178
  get adapter(): Adapter {
177
179
  return this.#adapter
178
180
  }
179
181
 
180
- /** Return the prefix prepended to all keys managed by this {@link Client} */
182
+ /** Return the prefix prepended to all keys managed by this {@link MemxClient} */
181
183
  get prefix(): string {
182
184
  return this.#prefix
183
185
  }
184
186
 
185
- /** Return a new {@link Client} prefixing keys with the specified `string` */
186
- withPrefix(prefix: string): Client {
187
+ /** Return a new {@link MemxClient} prefixing keys with the specified `string` */
188
+ withPrefix(prefix: string): MemxClient {
187
189
  assert(prefix, 'Invalid prefix')
188
- const client = new Client(this.#adapter)
190
+ const client = new MemxClient(this.#adapter)
189
191
  client.#prefix = prefix
190
192
  return client
191
193
  }
@@ -227,25 +229,25 @@ export class Client {
227
229
  }
228
230
 
229
231
  append(
230
- key: string,
231
- value: Appendable,
232
- options?: { cas?: bigint },
232
+ key: string,
233
+ value: Appendable,
234
+ options?: { cas?: bigint },
233
235
  ): Promise<boolean> {
234
236
  return this.#adapter.append(this.#prefix + key, ...toBuffer(value, options))
235
237
  }
236
238
 
237
239
  prepend(
238
- key: string,
239
- value: Appendable,
240
- options?: { cas?: bigint },
240
+ key: string,
241
+ value: Appendable,
242
+ options?: { cas?: bigint },
241
243
  ): Promise<boolean> {
242
244
  return this.#adapter.prepend(this.#prefix + key, ...toBuffer(value, options))
243
245
  }
244
246
 
245
247
  async increment(
246
- key: string,
247
- delta?: bigint | number,
248
- options?: { initial?: bigint | number, cas?: bigint, ttl?: number },
248
+ key: string,
249
+ delta?: bigint | number,
250
+ options?: { initial?: bigint | number, cas?: bigint, ttl?: number },
249
251
  ): Promise<Counter | undefined> {
250
252
  const counter = await this.#adapter.increment(this.#prefix + key, delta, options)
251
253
 
@@ -257,9 +259,9 @@ export class Client {
257
259
  }
258
260
 
259
261
  async decrement(
260
- key: string,
261
- delta?: bigint | number,
262
- options?: { initial?: bigint | number, cas?: bigint, ttl?: number },
262
+ key: string,
263
+ delta?: bigint | number,
264
+ options?: { initial?: bigint | number, cas?: bigint, ttl?: number },
263
265
  ): Promise<Counter | undefined> {
264
266
  const counter = await this.#adapter.decrement(this.#prefix + key, delta, options)
265
267
 
@@ -271,15 +273,15 @@ export class Client {
271
273
  }
272
274
 
273
275
  touch(
274
- key: string,
275
- ttl?: number,
276
+ key: string,
277
+ ttl?: number,
276
278
  ): Promise<boolean> {
277
279
  return this.#adapter.touch(this.#prefix + key, ttl)
278
280
  }
279
281
 
280
282
  delete(
281
- key: string,
282
- options?: { cas?: bigint },
283
+ key: string,
284
+ options?: { cas?: bigint },
283
285
  ): Promise<boolean> {
284
286
  return this.#adapter.delete(this.#prefix + key, options)
285
287
  }
package/src/cluster.ts CHANGED
@@ -1,6 +1,9 @@
1
- import { Adapter, Counter, AdapterResult, Stats } from './types'
2
- import { ServerAdapter, ServerOptions } from './server'
3
- import assert from 'assert'
1
+ import assert from 'node:assert'
2
+
3
+ import { ServerAdapter } from './server'
4
+
5
+ import type { Adapter, Counter, AdapterResult, Stats } from './types'
6
+ import type { ServerOptions } from './server'
4
7
 
5
8
  function parseHosts(hosts?: string): ServerOptions[] {
6
9
  const result: { host: string, port?: number }[] = []
package/src/connection.ts CHANGED
@@ -1,11 +1,15 @@
1
- import assert from 'assert'
2
- import net, { Socket } from 'net'
1
+ import assert from 'node:assert'
2
+ import net from 'node:net'
3
3
 
4
- import { Encoder, RawOutgoingPacket } from './encode'
5
- import { Decoder, RawIncomingPacket } from './decode'
4
+ import { Encoder } from './encode'
5
+ import { Decoder } from './decode'
6
6
  import { BUFFERS, OPCODE } from './constants'
7
7
  import { socketFinalizationRegistry } from './internals'
8
8
 
9
+ import type { RawIncomingPacket } from './decode'
10
+ import type { RawOutgoingPacket } from './encode'
11
+ import type { Socket } from 'node:net'
12
+
9
13
  export type RawIncomingPackets = [ RawIncomingPacket, ...RawIncomingPacket[] ]
10
14
 
11
15
  class Deferred {
package/src/decode.ts CHANGED
@@ -1,6 +1,9 @@
1
+ import assert from 'node:assert'
2
+
1
3
  import { DATA_TYPE, EMPTY_BUFFER, MAGIC, OFFSETS } from './constants'
2
- import assert from 'assert'
3
- import { allocateBuffer, RecyclableBuffer } from './buffers'
4
+ import { allocateBuffer } from './buffers'
5
+
6
+ import type { RecyclableBuffer } from './buffers'
4
7
 
5
8
  // Reading the full header would be like
6
9
  // const magic = header.readUInt8 (0)
package/src/encode.ts CHANGED
@@ -1,5 +1,8 @@
1
- import { allocateBuffer, RecyclableBuffer } from './buffers'
2
- import { DATA_TYPE, EMPTY_BUFFER, MAGIC, VBUCKET, OPCODE, OFFSETS } from './constants'
1
+ import { allocateBuffer } from './buffers'
2
+ import { DATA_TYPE, EMPTY_BUFFER, MAGIC, VBUCKET, OFFSETS } from './constants'
3
+
4
+ import type { RecyclableBuffer } from './buffers'
5
+ import type { OPCODE } from './constants'
3
6
 
4
7
  // Writing the full header would be like
5
8
  // header.writeUInt8 (magic, 0)
package/src/fake.ts CHANGED
@@ -1,4 +1,6 @@
1
- import { Adapter, AdapterResult, Counter, Stats } from './types'
1
+ import { MemxClient } from './client'
2
+
3
+ import type { Adapter, AdapterResult, Counter, Stats } from './types'
2
4
 
3
5
  interface Entry {
4
6
  value: Buffer,
@@ -42,7 +44,7 @@ export class FakeAdapter implements Adapter {
42
44
  }
43
45
 
44
46
  async get(
45
- key: string,
47
+ key: string,
46
48
  ): Promise<AdapterResult | undefined> {
47
49
  const entry = this.#get(key)
48
50
  if (! entry) return
@@ -56,8 +58,8 @@ export class FakeAdapter implements Adapter {
56
58
  }
57
59
 
58
60
  async gat(
59
- key: string,
60
- ttl: number,
61
+ key: string,
62
+ ttl: number,
61
63
  ): Promise<AdapterResult | undefined> {
62
64
  const entry = this.#get(key)
63
65
  if (! entry) return
@@ -73,8 +75,8 @@ export class FakeAdapter implements Adapter {
73
75
  }
74
76
 
75
77
  async touch(
76
- key: string,
77
- ttl: number,
78
+ key: string,
79
+ ttl: number,
78
80
  ): Promise<boolean> {
79
81
  const entry = this.#get(key)
80
82
  if (entry) entry.exp = toExp(ttl)
@@ -82,9 +84,9 @@ export class FakeAdapter implements Adapter {
82
84
  }
83
85
 
84
86
  async set(
85
- key: string,
86
- value: Buffer,
87
- options: { flags?: number; cas?: bigint; ttl?: number } = {},
87
+ key: string,
88
+ value: Buffer,
89
+ options: { flags?: number; cas?: bigint; ttl?: number } = {},
88
90
  ): Promise<bigint | undefined> {
89
91
  const entry = this.#get(key)
90
92
  if (entry && (options.cas !== undefined) && (entry.cas !== options.cas)) {
@@ -95,27 +97,27 @@ export class FakeAdapter implements Adapter {
95
97
  }
96
98
 
97
99
  async add(
98
- key: string,
99
- value: Buffer,
100
- options: { flags?: number; ttl?: number } = {},
100
+ key: string,
101
+ value: Buffer,
102
+ options: { flags?: number; ttl?: number } = {},
101
103
  ): Promise<bigint | undefined> {
102
104
  if (this.#get(key)) return
103
105
  return this.#set(key, value, options.flags, options.ttl)
104
106
  }
105
107
 
106
108
  async replace(
107
- key: string,
108
- value: Buffer,
109
- options: { flags?: number; cas?: bigint; ttl?: number } = {},
109
+ key: string,
110
+ value: Buffer,
111
+ options: { flags?: number; cas?: bigint; ttl?: number } = {},
110
112
  ): Promise<bigint | undefined> {
111
113
  if (! this.#get(key)) return
112
114
  return this.#set(key, value, options.flags, options.ttl)
113
115
  }
114
116
 
115
117
  async append(
116
- key: string,
117
- value: Buffer,
118
- options: { cas?: bigint } = {},
118
+ key: string,
119
+ value: Buffer,
120
+ options: { cas?: bigint } = {},
119
121
  ): Promise<boolean> {
120
122
  const entry = this.#get(key)
121
123
  if (! entry) return false
@@ -127,9 +129,9 @@ export class FakeAdapter implements Adapter {
127
129
  }
128
130
 
129
131
  async prepend(
130
- key: string,
131
- value: Buffer,
132
- options: { cas?: bigint } = {},
132
+ key: string,
133
+ value: Buffer,
134
+ options: { cas?: bigint } = {},
133
135
  ): Promise<boolean> {
134
136
  const entry = this.#get(key)
135
137
  if (! entry) return false
@@ -141,9 +143,9 @@ export class FakeAdapter implements Adapter {
141
143
  }
142
144
 
143
145
  async #counter(
144
- key: string,
145
- delta: number | bigint,
146
- options: { initial?: number | bigint; cas?: bigint; ttl?: number; create?: boolean },
146
+ key: string,
147
+ delta: number | bigint,
148
+ options: { initial?: number | bigint; cas?: bigint; ttl?: number; create?: boolean },
147
149
  ): Promise<Counter | undefined> {
148
150
  const entry = this.#get(key)
149
151
 
@@ -169,24 +171,24 @@ export class FakeAdapter implements Adapter {
169
171
  }
170
172
 
171
173
  increment(
172
- key: string,
173
- delta: number | bigint = 1n,
174
- options: { initial?: number | bigint; cas?: bigint; ttl?: number; create?: boolean } = {},
174
+ key: string,
175
+ delta: number | bigint = 1n,
176
+ options: { initial?: number | bigint; cas?: bigint; ttl?: number; create?: boolean } = {},
175
177
  ): Promise<Counter | undefined> {
176
178
  return this.#counter(key, delta, options)
177
179
  }
178
180
 
179
181
  decrement(
180
- key: string,
181
- delta: number | bigint = 1n,
182
- options: { initial?: number | bigint; cas?: bigint; ttl?: number; create?: boolean } = {},
182
+ key: string,
183
+ delta: number | bigint = 1n,
184
+ options: { initial?: number | bigint; cas?: bigint; ttl?: number; create?: boolean } = {},
183
185
  ): Promise<Counter | undefined> {
184
186
  return this.#counter(key, -delta, options)
185
187
  }
186
188
 
187
189
  async delete(
188
- key: string,
189
- options: { cas?: bigint } = {},
190
+ key: string,
191
+ options: { cas?: bigint } = {},
190
192
  ): Promise<boolean> {
191
193
  const entry = this.#get(key)
192
194
  if (entry && (options.cas !== undefined) && (entry.cas !== options.cas)) {
@@ -197,7 +199,7 @@ export class FakeAdapter implements Adapter {
197
199
  }
198
200
 
199
201
  async flush(
200
- ttl?: number,
202
+ ttl?: number,
201
203
  ): Promise<void> {
202
204
  if (! ttl) return this.#cache.clear()
203
205
 
@@ -220,3 +222,9 @@ export class FakeAdapter implements Adapter {
220
222
  return { fake: { version: '0.0.0-fake' } as Stats }
221
223
  }
222
224
  }
225
+
226
+ export class MemxFakeClient extends MemxClient {
227
+ constructor() {
228
+ super(new FakeAdapter())
229
+ }
230
+ }
package/src/internals.ts CHANGED
@@ -1,12 +1,11 @@
1
- // Keep these here: they must be ignored by Istanbul, but ESBUILD swallows
2
- // commments (for a reason: https://github.com/evanw/esbuild/issues/578)
3
-
4
- import assert from 'assert'
5
- import type { Socket } from 'net'
6
- import { types } from 'util'
1
+ import assert from 'node:assert'
2
+ import { types } from 'node:util'
7
3
 
8
4
  import { FLAGS } from './constants'
9
5
 
6
+ import type { Socket } from 'node:net'
7
+
8
+ /* coverage ignore next */
10
9
  export const socketFinalizationRegistry = new FinalizationRegistry((socket: Socket): void => {
11
10
  if (! socket.destroyed) socket.destroy()
12
11
  })
@@ -28,7 +27,8 @@ export function typedArrayFlags(value: NodeJS.TypedArray): FLAGS {
28
27
  return flags
29
28
  }
30
29
 
30
+ /* coverage ignore next */
31
31
  export function logPromiseError(promise: Promise<any>, message: string): Promise<void> {
32
- // eslint-disable-next-line no-console
32
+ /* eslint-disable-next-line no-console */
33
33
  return promise.catch((error) => console.log(message, error)).then(() => void 0)
34
34
  }