Skip to content

Commit

Permalink
switch to esModuleInterop=true
Browse files Browse the repository at this point in the history
  • Loading branch information
erossignon committed Jun 2, 2023
1 parent a075758 commit 0335415
Show file tree
Hide file tree
Showing 250 changed files with 309 additions and 308 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* @module node-opcua-address-space
*/
import { assert } from "node-opcua-assert";
import * as ec from "node-opcua-basic-types";
import { decodeArray, encodeArray } from "node-opcua-basic-types";
import { BinaryStream, BinaryStreamSizeCalculator, OutputBinaryStream } from "node-opcua-binary-stream";
import { checkDebugFlag, make_debugLog, make_warningLog } from "node-opcua-debug";
import * as factories from "node-opcua-factory";
import { findBuiltInType } from "node-opcua-factory";
import { coerceNodeId, NodeId, resolveNodeId } from "node-opcua-nodeid";
import { Argument } from "node-opcua-service-call";
import { StatusCode, StatusCodes } from "node-opcua-status-code";
Expand All @@ -22,7 +22,7 @@ const warningLog = make_warningLog(__filename);
const doDebug = checkDebugFlag(__filename);

function myfindBuiltInType(dataType: DataType): any {
return factories.findBuiltInType(DataType[dataType]);
return findBuiltInType(DataType[dataType]);
}
export interface ArgumentDef {
dataType: DataType;
Expand All @@ -49,7 +49,7 @@ export function encode_ArgumentList(definition: ArgumentDef[], args: any[], stre
const isArray = def.valueRank && (def.valueRank === 1 || def.valueRank !== -1);

if (isArray) {
ec.encodeArray(value, stream, encodeFunc);
encodeArray(value, stream, encodeFunc);
} else {
encodeFunc(value, stream);
}
Expand All @@ -76,7 +76,7 @@ export function decode_ArgumentList(definition: ArgumentDef[], stream: BinaryStr
const isArray = def.valueRank === 1 || def.valueRank === -1;

if (isArray) {
value = ec.decodeArray(stream, decodeFunc);
value = decodeArray(stream, decodeFunc);
} else {
value = decodeFunc(stream);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @module node-opcua-address-space
*/
// tslint:disable:no-console
import * as chalk from "chalk";
import chalk from "chalk";

import { assert } from "node-opcua-assert";
import { BrowseDirection } from "node-opcua-data-model";
Expand Down
28 changes: 14 additions & 14 deletions packages/node-opcua-address-space/source/loader/load_nodeset2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* @module node-opcua-address-space
*/
import { promisify, types } from "util";
import * as chalk from "chalk";
import chalk from "chalk";

import * as ec from "node-opcua-basic-types";
import { coerceByte , coerceBoolean, coerceInt32} from "node-opcua-basic-types";
import {
AddReferenceTypeOptions,
BaseNode,
Expand Down Expand Up @@ -49,7 +49,7 @@ import {
XmlAttributes,
SimpleCallback
} from "node-opcua-xml2json";
import * as semver from "semver";
import semver from "semver";

import { AddressSpacePrivate } from "../../src/address_space_private";
import { NamespacePrivate } from "../../src/namespace_private";
Expand Down Expand Up @@ -401,10 +401,10 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo

this.obj = {};
this.obj.nodeClass = NodeClass.Object;
this.obj.isAbstract = ec.coerceBoolean(attrs.IsAbstract);
this.obj.isAbstract = coerceBoolean(attrs.IsAbstract);
this.obj.nodeId = convertToNodeId(attrs.NodeId) || null;
this.obj.browseName = convertQualifiedName(attrs.BrowseName);
this.obj.eventNotifier = ec.coerceByte(attrs.EventNotifier) || 0;
this.obj.eventNotifier = coerceByte(attrs.EventNotifier) || 0;
this.obj.symbolicName = attrs.SymbolicName || null;

this.isDraft = attrs.ReleaseStatus === "Draft";
Expand Down Expand Up @@ -439,10 +439,10 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo

this.obj = {};
this.obj.nodeClass = NodeClass.ObjectType;
this.obj.isAbstract = ec.coerceBoolean(attrs.IsAbstract);
this.obj.isAbstract = coerceBoolean(attrs.IsAbstract);
this.obj.nodeId = convertToNodeId(attrs.NodeId) || null;
this.obj.browseName = convertQualifiedName(attrs.BrowseName);
this.obj.eventNotifier = ec.coerceByte(attrs.EventNotifier) || 0;
this.obj.eventNotifier = coerceByte(attrs.EventNotifier) || 0;
},
finish(this: any) {
_internal_createNode(this.obj);
Expand Down Expand Up @@ -470,7 +470,7 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo

this.obj = {};
this.obj.nodeClass = NodeClass.ReferenceType;
this.obj.isAbstract = ec.coerceBoolean(attrs.IsAbstract);
this.obj.isAbstract =coerceBoolean(attrs.IsAbstract);
this.obj.nodeId = convertToNodeId(attrs.NodeId) || null;
this.obj.browseName = convertQualifiedName(attrs.BrowseName);
},
Expand Down Expand Up @@ -507,7 +507,7 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo

this.obj = {};
this.obj.nodeClass = NodeClass.DataType;
this.obj.isAbstract = ec.coerceBoolean(attrs.IsAbstract) || false;
this.obj.isAbstract = coerceBoolean(attrs.IsAbstract) || false;
this.obj.nodeId = convertToNodeId(attrs.NodeId) || null;
this.obj.browseName = convertQualifiedName(attrs.BrowseName);
this.obj.displayName = "";
Expand Down Expand Up @@ -1104,7 +1104,7 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
}
},

Boolean: parser2("Boolean", ec.coerceBoolean),
Boolean: parser2("Boolean", coerceBoolean),
Byte: parser2("Byte", parseInt),
Int16: parser2("Int16", parseInt),
Int32: parser2("Int32", parseInt),
Expand Down Expand Up @@ -1240,7 +1240,7 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
}
},

ListOfBoolean: ListOf<boolean>("Boolean", ec.coerceBoolean),
ListOfBoolean: ListOf<boolean>("Boolean", coerceBoolean),

ListOfByte: ListOf<number>("Byte", parseInt),

Expand Down Expand Up @@ -1362,7 +1362,7 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
this.obj.parentNodeId = convertToNodeId(attrs.ParentNodeId);
this.obj.dataType = convertToNodeId(attrs.DataType);

this.obj.valueRank = attrs.ValueRank === undefined ? -1 : ec.coerceInt32(attrs.ValueRank);
this.obj.valueRank = attrs.ValueRank === undefined ? -1 : coerceInt32(attrs.ValueRank);
this.obj.arrayDimensions = this.obj.valueRank <= 0 ? null : stringToUInt32Array(attrs.ArrayDimensions);

this.obj.minimumSamplingInterval = attrs.MinimumSamplingInterval ? parseInt(attrs.MinimumSamplingInterval, 10) : 0;
Expand Down Expand Up @@ -1453,14 +1453,14 @@ function makeNodeSetParserEngine(addressSpace: IAddressSpace, options: NodeSetLo
_perform();

this.obj = {};
this.obj.isAbstract = ec.coerceBoolean(attrs.IsAbstract);
this.obj.isAbstract = coerceBoolean(attrs.IsAbstract);

this.obj.nodeClass = NodeClass.VariableType;
this.obj.browseName = convertQualifiedName(attrs.BrowseName);
this.obj.parentNodeId = attrs.ParentNodeId || null;
this.obj.dataType = convertToNodeId(attrs.DataType) || null;

this.obj.valueRank = ec.coerceInt32(attrs.ValueRank) || -1;
this.obj.valueRank = coerceInt32(attrs.ValueRank) || -1;
this.obj.arrayDimensions = this.obj.valueRank <= 0 ? null : stringToUInt32Array(attrs.ArrayDimensions);

this.obj.minimumSamplingInterval = attrs.MinimumSamplingInterval ? parseInt(attrs.MinimumSamplingInterval, 10) : 0;
Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-address-space/src/address_space.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/

import { randomBytes } from "crypto";
import * as chalk from "chalk";
import chalk from "chalk";

import { assert } from "node-opcua-assert";
import { ExtraDataTypeManager } from "node-opcua-client-dynamic-extension-object";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @module node-opcua-address-space
*/
import * as chalk from "chalk";
import chalk from "chalk";

import { UAReference, BaseNode, UAObject, UAVariable, UAObjectType, UAVariableType } from "node-opcua-address-space-base";
import { assert } from "node-opcua-assert";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* @module node-opcua-address-space.AlarmsAndConditions
*/
import * as chalk from "chalk";
import chalk from "chalk";

import { assert } from "node-opcua-assert";
import { ByteString } from "node-opcua-basic-types";
Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-address-space/src/base_node_impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @module node-opcua-address-space
*/
import { EventEmitter } from "events";
import * as chalk from "chalk";
import chalk from "chalk";
import { isEqual } from "lodash";

import {
Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-address-space/src/base_node_private.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @module node-opcua-address-space.Private
*/
// tslint:disable:no-bitwise
import * as chalk from "chalk";
import chalk from "chalk";
import { assert } from "node-opcua-assert";
import {
AccessLevelFlag,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/
// tslint:disable:no-console

import * as chalk from "chalk";
import chalk from "chalk";

import { assert } from "node-opcua-assert";
import { AccessLevelFlag, NodeClass, QualifiedNameLike } from "node-opcua-data-model";
Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-address-space/src/namespace_impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @module node-opcua-address-space
*/
// tslint:disable:no-console
import * as chalk from "chalk";
import chalk from "chalk";

import { assert } from "node-opcua-assert";
import { coerceInt64 } from "node-opcua-basic-types";
Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-address-space/src/reference_impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @module node-opcua-address-space
*/
// tslint:disable:no-console
import * as chalk from "chalk";
import chalk from "chalk";
import { AddReferenceOpts, UAReference, BaseNode, UAReferenceType } from "node-opcua-address-space-base";
import { assert } from "node-opcua-assert";
import { coerceNodeId, NodeId, NodeIdLike, sameNodeId } from "node-opcua-nodeid";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @module node-opcua-address-space
*/
import * as chalk from "chalk";
import chalk from "chalk";
import { UAState, UAStateVariable, UATransition, UATransition_Base, UATransitionVariable } from "node-opcua-nodeset-ua";
import { assert } from "node-opcua-assert";
import { ObjectTypeIds } from "node-opcua-constants";
Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-address-space/src/ua_data_type_impl.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @module node-opcua-address-space
*/
import * as chalk from "chalk";
import chalk from "chalk";

import { assert } from "node-opcua-assert";
import { NodeClass, QualifiedNameLike } from "node-opcua-data-model";
Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-address-space/src/ua_method_impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @module node-opcua-address-space
*/
import { callbackify, types } from "util";
import * as chalk from "chalk";
import chalk from "chalk";
import { assert } from "node-opcua-assert";

import { AttributeIds, QualifiedNameLike } from "node-opcua-data-model";
Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-address-space/src/ua_object_impl.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @module node-opcua-address-space
*/
import * as chalk from "chalk";
import chalk from "chalk";

import { assert } from "node-opcua-assert";
import { isValidByte } from "node-opcua-basic-types";
Expand Down
2 changes: 1 addition & 1 deletion packages/node-opcua-address-space/src/ua_variable_impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// tslint:disable:no-console
// tslint:disable:max-line-length
import { types } from "util";
import * as chalk from "chalk";
import chalk from "chalk";

import {
BindExtensionObjectOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
// tslint:disable:max-classes-per-file
// tslint:disable:no-console
import * as chalk from "chalk";
import chalk from "chalk";

import { assert } from "node-opcua-assert";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as fs from "fs";
import { nodesets } from "node-opcua-nodesets";
import * as should from "should";
import should from "should";

import { generateAddressSpace } from "../../distNodeJS";
import { AddressSpace } from "../..";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable max-statements */
import * as path from "path";
import * as sinon from "sinon";
import sinon from "sinon";
import "should";
import { nodesets } from "node-opcua-nodesets";
import { NodeId } from "node-opcua-nodeid";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as should from "should";
import * as sinon from "sinon";
import should from "should";
import sinon from "sinon";

import { NodeClass } from "node-opcua-data-model";
import { NodeId } from "node-opcua-nodeid";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// tslint:disable:no-console
import * as async from "async";
import * as should from "should";
import * as sinon from "sinon";
import should from "should";
import sinon from "sinon";

import { checkDebugFlag, make_debugLog } from "node-opcua-debug";
import { LocalizedText } from "node-opcua-data-model";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// tslint:disable:max-line-length
import * as should from "should";
import should from "should";

import * as sinon from "sinon";
import sinon from "sinon";

import { NodeId } from "node-opcua-nodeid";
import { StatusCodes } from "node-opcua-status-code";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as should from "should";
import should from "should";

import { StatusCodes } from "node-opcua-status-code";
import { DataType, Variant } from "node-opcua-variant";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// tslint:disable:no-console
// tslint:disable:max-statements
import * as chalk from "chalk";
import * as should from "should";
import * as sinon from "sinon";
import chalk from "chalk";
import should from "should";
import sinon from "sinon";

import { NodeId } from "node-opcua-nodeid";
import { StatusCodes } from "node-opcua-status-code";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable max-statements */
// tslint:disable:max-statements
import * as should from "should";
import should from "should";
import { DataType, Variant } from "node-opcua-variant";
import { AddressSpace, UANonExclusiveDeviationAlarmEx, UAObject, UAVariable, UAVariableT } from "../..";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable max-statements */
// tslint:disable:max-statement
import * as should from "should";
import * as sinon from "sinon";
import should from "should";
import sinon from "sinon";

import { DataType, Variant } from "node-opcua-variant";
import { AddressSpace, Namespace, UAObject, UAVariable } from "../..";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as should from "should";
import should from "should";

import { AxisInformation, AxisScaleEnumeration, standardUnits } from "node-opcua-data-access";
import { coerceLocalizedText } from "node-opcua-data-model";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as should from "should";
import * as sinon from "sinon";
import should from "should";
import sinon from "sinon";

import { Range, standardUnits } from "node-opcua-data-access";
import { AttributeIds } from "node-opcua-data-model";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use strict";
import * as should from "should";
import should from "should";

import { Range } from "node-opcua-data-access";
import { standardUnits } from "node-opcua-data-access";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use strict";
import * as should from "should";
import should from "should";

import { standardUnits } from "node-opcua-data-access";
import { DataValue } from "node-opcua-data-value";
Expand Down

0 comments on commit 0335415

Please sign in to comment.