node-opcua-address-space 2.166.0 → 2.168.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.
@@ -2,9 +2,9 @@
2
2
  * @module node-opcua-address-space
3
3
  */
4
4
 
5
+ import { isDeepStrictEqual as isEqual } from "node:util";
5
6
  import { EventEmitter } from "node:events";
6
7
  import chalk from "chalk";
7
- import { isEqual } from "lodash";
8
8
 
9
9
  import type {
10
10
  AddReferenceOpts,
@@ -749,15 +749,15 @@ export class BaseNodeImpl extends EventEmitter implements BaseNode {
749
749
  // The type of reference to follow from the current node.
750
750
  // The current path cannot be followed any further if the referenceTypeId is not available on the Node instance.
751
751
  // If not specified then all References are included and the parameter includeSubtypes is ignored.
752
- assert(Object.prototype.hasOwnProperty.call(relativePathElement, "referenceTypeId"));
752
+ assert(Object.hasOwn(relativePathElement, "referenceTypeId"));
753
753
 
754
754
  // Indicates whether the inverse Reference should be followed.
755
755
  // The inverse reference is followed if this value is TRUE.
756
- assert(Object.prototype.hasOwnProperty.call(relativePathElement, "isInverse"));
756
+ assert(Object.hasOwn(relativePathElement, "isInverse"));
757
757
 
758
758
  // Indicates whether subtypes of the ReferenceType should be followed.
759
759
  // Subtypes are included if this value is TRUE.
760
- assert(Object.prototype.hasOwnProperty.call(relativePathElement, "includeSubtypes"));
760
+ assert(Object.hasOwn(relativePathElement, "includeSubtypes"));
761
761
 
762
762
  const references = this.allReferences();
763
763
 
@@ -772,7 +772,7 @@ export class BaseNodeImpl extends EventEmitter implements BaseNode {
772
772
  ) {
773
773
  return false;
774
774
  }
775
- assert(Object.prototype.hasOwnProperty.call(reference, "isForward"));
775
+ assert(Object.hasOwn(reference, "isForward"));
776
776
  const referenceType = resolveReferenceType(this.addressSpace, reference);
777
777
  const referenceTypeId = referenceType.nodeId;
778
778
 
@@ -807,7 +807,7 @@ export class BaseNodeImpl extends EventEmitter implements BaseNode {
807
807
  // compare QualifiedName
808
808
 
809
809
  const key = obj.nodeId.toString();
810
- if (!Object.prototype.hasOwnProperty.call(nodeIdsMap, key)) {
810
+ if (!Object.hasOwn(nodeIdsMap, key)) {
811
811
  nodeIds.push(obj.nodeId);
812
812
  nodeIdsMap[key] = obj;
813
813
  }
@@ -915,9 +915,9 @@ export class BaseNodeImpl extends EventEmitter implements BaseNode {
915
915
  public removeReference(referenceOpts: AddReferenceOpts): void {
916
916
  const _private = BaseNode_getPrivate(this);
917
917
 
918
- assert(Object.prototype.hasOwnProperty.call(referenceOpts, "referenceType"));
918
+ assert(Object.hasOwn(referenceOpts, "referenceType"));
919
919
  // xx isForward is optional : assert(Object.prototype.hasOwnProperty.call(reference,"isForward"));
920
- assert(Object.prototype.hasOwnProperty.call(referenceOpts, "nodeId"));
920
+ assert(Object.hasOwn(referenceOpts, "nodeId"));
921
921
 
922
922
  const addressSpace = this.addressSpace as AddressSpacePrivate;
923
923
 
@@ -1007,7 +1007,7 @@ export class BaseNodeImpl extends EventEmitter implements BaseNode {
1007
1007
  const childNode = resolveReferenceNode(addressSpace, reference);
1008
1008
 
1009
1009
  const name = lowerFirstLetter(childNode.browseName.name || "");
1010
- if (Object.prototype.hasOwnProperty.call(reservedNames, name)) {
1010
+ if (Object.hasOwn(reservedNames, name)) {
1011
1011
  // c8 ignore next
1012
1012
  if (doDebug) {
1013
1013
  // tslint:disable-next-line:no-console
@@ -1016,7 +1016,7 @@ export class BaseNodeImpl extends EventEmitter implements BaseNode {
1016
1016
  return;
1017
1017
  }
1018
1018
  /* c8 ignore next */
1019
- if (!Object.prototype.hasOwnProperty.call(this, name)) {
1019
+ if (!Object.hasOwn(this, name)) {
1020
1020
  return;
1021
1021
  }
1022
1022
 
@@ -1285,9 +1285,9 @@ export class BaseNodeImpl extends EventEmitter implements BaseNode {
1285
1285
  private __addReference(referenceOpts: AddReferenceOpts): UAReference {
1286
1286
  const addressSpace = this.addressSpace as AddressSpacePrivate;
1287
1287
  const _private = BaseNode_getPrivate(this);
1288
- assert(Object.prototype.hasOwnProperty.call(referenceOpts, "referenceType"));
1288
+ assert(Object.hasOwn(referenceOpts, "referenceType"));
1289
1289
  // xx isForward is optional : assert(Object.prototype.hasOwnProperty.call(reference,"isForward"));
1290
- assert(Object.prototype.hasOwnProperty.call(referenceOpts, "nodeId"));
1290
+ assert(Object.hasOwn(referenceOpts, "nodeId"));
1291
1291
 
1292
1292
  const reference: UAReference = addressSpace.normalizeReferenceTypes([referenceOpts])[0];
1293
1293
  assert(reference instanceof ReferenceImpl);
@@ -1821,7 +1821,7 @@ function install_components_as_object_properties(parentObj: BaseNode) {
1821
1821
  // assumption: we ignore namespace here .
1822
1822
  const name = lowerFirstLetter(child.browseName.name || "");
1823
1823
 
1824
- if (Object.prototype.hasOwnProperty.call(reservedNames, name)) {
1824
+ if (Object.hasOwn(reservedNames, name)) {
1825
1825
  // ignore reserved names
1826
1826
  if (doDebug) {
1827
1827
  debugLog(chalk.bgWhite.red(`Ignoring reserved keyword ${name}`));
@@ -1832,7 +1832,7 @@ function install_components_as_object_properties(parentObj: BaseNode) {
1832
1832
  // ignore reserved names
1833
1833
  doDebug && debugLog(`Installing property ${name}`, " on ", parentObj.browseName.toString());
1834
1834
 
1835
- const hasProperty = Object.prototype.hasOwnProperty.call(parentObj, name);
1835
+ const hasProperty = Object.hasOwn(parentObj, name);
1836
1836
  if (
1837
1837
  hasProperty &&
1838
1838
  (parentObj as unknown as Record<string, unknown>)[name] !== null &&