@kronos-integration/endpoint 9.4.43 → 9.4.44

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kronos-integration/endpoint",
3
- "version": "9.4.43",
3
+ "version": "9.4.44",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -24,7 +24,7 @@
24
24
  "license": "BSD-2-Clause",
25
25
  "scripts": {
26
26
  "test": "npm run test:ava",
27
- "test:ava": "ava --timeout 2m tests/*-ava.mjs tests/*-ava-node.mjs && ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
27
+ "test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
28
28
  "cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
29
29
  "docs": "documentation readme --section=API ./src/**/*.mjs",
30
30
  "lint": "npm run lint:docs",
@@ -37,7 +37,7 @@
37
37
  "ava": "^5.3.1",
38
38
  "c8": "^8.0.1",
39
39
  "documentation": "^14.0.2",
40
- "semantic-release": "^22.0.6"
40
+ "semantic-release": "^22.0.7"
41
41
  },
42
42
  "engines": {
43
43
  "node": ">=20.9.0"
package/src/endpoint.mjs CHANGED
@@ -9,13 +9,13 @@ import { Interceptor } from "@kronos-integration/interceptor";
9
9
  * @param {Interceptor|Object[]} [options.interceptors] interceptors
10
10
  */
11
11
  export class Endpoint {
12
- constructor(name, owner, options = {}) {
12
+ constructor(name, owner, options) {
13
13
  const properties = {
14
14
  name: { value: name },
15
15
  owner: { value: owner }
16
16
  };
17
17
 
18
- if (options.didConnect !== undefined) {
18
+ if (options?.didConnect !== undefined) {
19
19
  properties.didConnect = {
20
20
  value: options.didConnect
21
21
  };
@@ -24,7 +24,7 @@ export class Endpoint {
24
24
  Object.defineProperties(this, properties);
25
25
 
26
26
  this.interceptors = instanciateInterceptors(
27
- options.interceptors,
27
+ options?.interceptors,
28
28
  this.owner
29
29
  );
30
30
  }
@@ -9,10 +9,10 @@ export class MultiConnectionEndpoint extends ReceivableEndpoint {
9
9
 
10
10
  #connections = new Map();
11
11
 
12
- constructor(name, owner, options = {}) {
12
+ constructor(name, owner, options) {
13
13
  super(name, owner, options);
14
14
 
15
- if (isEndpoint(options.connected)) {
15
+ if (isEndpoint(options?.connected)) {
16
16
  this.addConnection(options.connected);
17
17
  }
18
18
  }
@@ -13,11 +13,11 @@ export class ReceivableEndpoint extends Endpoint {
13
13
 
14
14
  constructor(name, owner, options) {
15
15
  super(name, owner, options);
16
- if (options.receive) {
16
+ if (options?.receive) {
17
17
  this.receive = options.receive;
18
18
  }
19
19
 
20
- if (options.receivingInterceptors) {
20
+ if (options?.receivingInterceptors) {
21
21
  Object.defineProperties(this, {
22
22
  receivingInterceptors: {
23
23
  value: instanciateInterceptors(
@@ -16,9 +16,9 @@ export class SendEndpoint extends ReceivableEndpoint {
16
16
  #connection;
17
17
  #state;
18
18
 
19
- constructor(name, owner, options = {}) {
19
+ constructor(name, owner, options) {
20
20
  super(name, owner, options);
21
- if (isEndpoint(options.connected)) {
21
+ if (isEndpoint(options?.connected)) {
22
22
  this.addConnection(options.connected);
23
23
  }
24
24
  }