node-opcua-factory
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -97,2 +97,5 @@ "use strict"; | ||
} | ||
if (field.switchValue !== undefined) { | ||
opt = " !" + field.switchValue + " "; | ||
} | ||
const fieldNameF = chalk_1.default.yellow(r(padding + fieldName, 30)); | ||
@@ -106,2 +109,8 @@ const fieldTypeF = chalk_1.default.cyan(("/* " + r(fieldType + opt, 17) + (field.isArray ? "[]" : " ") + " */")); | ||
} | ||
// detected when union field is not specified in value | ||
if (field.switchValue !== undefined && value === undefined) { | ||
str = fieldNameF + " " + fieldTypeF + ": " + chalk_1.default.italic.grey("undefined") + " /* union field not specified */"; | ||
data.lines.push(str); | ||
return; | ||
} | ||
// compact version of very usual objects | ||
@@ -108,0 +117,0 @@ if (fieldType === "QualifiedName" && !field.isArray && value) { |
@@ -11,6 +11,7 @@ /** | ||
schema: StructuredTypeSchema; | ||
possibleFields: string[]; | ||
encodingDefaultBinary: ExpandedNodeId; | ||
encodingDefaultXml: ExpandedNodeId; | ||
} | ||
export declare function getStructureTypeConstructor(typeName: string): ConstructorFunc; | ||
export declare function getStructureTypeConstructor(typeName: string): ConstructorFuncWithSchema; | ||
export declare function hasStructuredType(typeName: string): boolean; | ||
@@ -17,0 +18,0 @@ export declare function getStructuredTypeSchema(typeName: string): StructuredTypeSchema; |
@@ -55,3 +55,3 @@ "use strict"; | ||
} | ||
if (underConstructSchema.name == field.fieldType) { | ||
if (underConstructSchema.name === field.fieldType) { | ||
return underConstructSchema; | ||
@@ -99,2 +99,3 @@ } | ||
switchBit: fieldLight.switchBit, | ||
switchValue: fieldLight.switchValue, | ||
schema | ||
@@ -101,0 +102,0 @@ }; |
@@ -36,2 +36,3 @@ import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream"; | ||
switchBit?: number; | ||
switchValue?: number; | ||
} | ||
@@ -38,0 +39,0 @@ export interface FieldEnumeration extends StructuredTypeField { |
{ | ||
"name": "node-opcua-factory", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "pure nodejs OPCUA SDK - module -factory", | ||
@@ -15,3 +15,3 @@ "main": "./dist/index.js", | ||
"node-opcua-assert": "^2.0.0", | ||
"node-opcua-basic-types": "^2.1.0", | ||
"node-opcua-basic-types": "^2.1.1", | ||
"node-opcua-binary-stream": "^2.1.0", | ||
@@ -21,4 +21,4 @@ "node-opcua-enum": "^2.1.0", | ||
"node-opcua-nodeid": "^2.1.0", | ||
"node-opcua-status-code": "^2.1.0", | ||
"node-opcua-utils": "^2.1.0", | ||
"node-opcua-status-code": "^2.1.1", | ||
"node-opcua-utils": "^2.1.1", | ||
"underscore": "^1.9.1" | ||
@@ -44,3 +44,3 @@ }, | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "ddce2b6e3e13371510e63d839c1a4c4ff0be2c15" | ||
"gitHead": "672816a1babe8c9347f85e47cf4e947f4749507e" | ||
} |
@@ -120,2 +120,7 @@ /** | ||
} | ||
if (field.switchValue !== undefined) { | ||
opt = " !" + field.switchValue + " "; | ||
} | ||
const fieldNameF = chalk.yellow(r(padding + fieldName, 30)); | ||
@@ -130,2 +135,9 @@ const fieldTypeF = chalk.cyan(("/* " + r(fieldType + opt, 17) + (field.isArray ? "[]" : " ") + " */")); | ||
} | ||
// detected when union field is not specified in value | ||
if (field.switchValue !== undefined && value === undefined) { | ||
str = fieldNameF + " " + fieldTypeF + ": " + chalk.italic.grey("undefined") + " /* union field not specified */"; | ||
data.lines.push(str); | ||
return; | ||
} | ||
// compact version of very usual objects | ||
@@ -132,0 +144,0 @@ if (fieldType === "QualifiedName" && !field.isArray && value) { |
@@ -27,2 +27,3 @@ /** | ||
schema: StructuredTypeSchema; | ||
possibleFields: string[]; | ||
encodingDefaultBinary: ExpandedNodeId; | ||
@@ -34,3 +35,3 @@ encodingDefaultXml: ExpandedNodeId; | ||
export function getStructureTypeConstructor(typeName: string): ConstructorFunc { | ||
export function getStructureTypeConstructor(typeName: string): ConstructorFuncWithSchema { | ||
return _globalStructuredTypeConstructors[typeName]; | ||
@@ -37,0 +38,0 @@ } |
@@ -25,4 +25,2 @@ /** | ||
import { parameters } from "./factories_schema_helpers"; | ||
// export interface StructuredTypeSchemaInterface extends CommonInterface { | ||
@@ -70,3 +68,3 @@ // | ||
if (underConstructSchema.name == field.fieldType) { | ||
if (underConstructSchema.name === field.fieldType) { | ||
return underConstructSchema; | ||
@@ -123,2 +121,4 @@ } | ||
switchValue: fieldLight.switchValue, | ||
schema | ||
@@ -160,2 +160,3 @@ }; | ||
this.id = NodeId.nullNodeId; | ||
this._possibleFields = this.fields.map((field) => field.name); | ||
@@ -162,0 +163,0 @@ this._baseSchema = null; |
@@ -60,2 +60,3 @@ /** | ||
switchBit?: number; // the bit number | ||
switchValue?: number; | ||
@@ -62,0 +63,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
178571
3445
Updatednode-opcua-utils@^2.1.1