node-opcua-xml2json
Advanced tools
Comparing version 2.4.2 to 2.5.0-alpha.0
import { ReaderStateParserLike } from "./xml2json"; | ||
export declare const _definitionParser: ReaderStateParserLike; | ||
export declare const definitionReaderStateParser: ReaderStateParserLike; |
@@ -8,2 +8,8 @@ "use strict"; | ||
// </Definition> | ||
const node_opcua_assert_1 = require("node-opcua-assert"); | ||
// <Definition Name="SomeName"> | ||
// <Field Name="Running" Value="0" dataType: [ValueRank="1"]> | ||
// [<Description>text</Description>] | ||
// <Field> | ||
// </Definition> | ||
// | ||
@@ -17,5 +23,6 @@ // Or | ||
init(name, attrs) { | ||
this.parent.definition = []; | ||
this.parent.definition_name = attrs.Name; | ||
this.array = this.parent.definition; | ||
node_opcua_assert_1.default(!this.parent.definitionFields || this.parent.definitionFields.length === 0); | ||
this.parent.definitionFields = []; | ||
this.parent.definitionName = attrs.SymbolicName || attrs.Name; | ||
this.array = this.parent.definitionFields; | ||
}, | ||
@@ -70,4 +77,4 @@ parser: { | ||
this._pojo = { | ||
name: this.definition_name, | ||
fields: this.definition | ||
name: this.definitionName, | ||
fields: this.definitionFields | ||
}; | ||
@@ -74,0 +81,0 @@ } |
@@ -0,0 +0,0 @@ import { ReaderState } from "./xml2json"; |
@@ -206,2 +206,3 @@ "use strict"; | ||
startElement(name, attrs) { | ||
// empty | ||
}, | ||
@@ -208,0 +209,0 @@ endElement(element) { |
@@ -0,0 +0,0 @@ import { Xml2Json, XmlAttributes, IReaderState } from "./xml2json"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ export * from "./xml2json"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { ReaderState, ReaderStateParser, Xml2Json, XmlAttributes } from "./xml2json"; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "node-opcua-xml2json", | ||
"version": "2.4.2", | ||
"version": "2.5.0-alpha.0", | ||
"description": "pure nodejs OPCUA SDK - module -xml2json", | ||
@@ -8,3 +8,3 @@ "main": "dist/source/index.js", | ||
"scripts": { | ||
"build": "tsc", | ||
"build": "tsc -b", | ||
"test": "mocha test" | ||
@@ -15,5 +15,5 @@ }, | ||
"ltx": "^2.9.2", | ||
"node-opcua-assert": "^2.3.0", | ||
"node-opcua-debug": "^2.4.2", | ||
"node-opcua-utils": "^2.4.2", | ||
"node-opcua-assert": "^2.5.0-alpha.0", | ||
"node-opcua-debug": "^2.5.0-alpha.0", | ||
"node-opcua-utils": "^2.5.0-alpha.0", | ||
"underscore": "^1.9.2" | ||
@@ -24,3 +24,3 @@ }, | ||
"devDependencies": { | ||
"node-opcua-nodesets": "^2.4.2", | ||
"node-opcua-nodesets": "^2.5.0-alpha.0", | ||
"should": "13.2.3" | ||
@@ -41,3 +41,3 @@ }, | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "6e4967fd20a09317ddd00098bcfe93e92c1df510" | ||
"gitHead": "341ac6292b30304bb028ab10971dc8552ff1a35a" | ||
} |
@@ -6,2 +6,3 @@ // <Definition Name="SomeName"> | ||
// </Definition> | ||
import assert from "node-opcua-assert"; | ||
import { | ||
@@ -25,5 +26,6 @@ ReaderStateParserLike, | ||
init(this: any, name: string, attrs: XmlAttributes) { | ||
this.parent.definition = []; | ||
this.parent.definition_name = attrs.Name; | ||
this.array = this.parent.definition; | ||
assert(!this.parent.definitionFields || this.parent.definitionFields.length === 0); | ||
this.parent.definitionFields = []; | ||
this.parent.definitionName = attrs.SymbolicName || attrs.Name; | ||
this.array = this.parent.definitionFields; | ||
}, | ||
@@ -78,6 +80,7 @@ parser: { | ||
this._pojo = { | ||
name: this.definition_name, | ||
fields: this.definition | ||
name: this.definitionName, | ||
fields: this.definitionFields | ||
}; | ||
} | ||
}; |
@@ -7,3 +7,3 @@ import { | ||
} from "./xml2json"; | ||
import {lowerFirstLetter} from "node-opcua-utils"; | ||
import { lowerFirstLetter } from "node-opcua-utils"; | ||
@@ -57,3 +57,3 @@ | ||
finish(this: any) { | ||
this.parent.localizedText =this.parent.localizedText || {}; | ||
this.parent.localizedText = this.parent.localizedText || {}; | ||
this.parent.localizedText.locale = this.text.trim(); | ||
@@ -64,3 +64,3 @@ } | ||
finish(this: any) { | ||
this.parent.localizedText =this.parent.localizedText || {}; | ||
this.parent.localizedText = this.parent.localizedText || {}; | ||
this.parent.localizedText.text = this.text.trim(); | ||
@@ -207,5 +207,5 @@ } | ||
if (a instanceof Array) { | ||
return a.map(x=>_clone(x)); | ||
return a.map(x => _clone(x)); | ||
} | ||
return { ... a}; | ||
return { ...a }; | ||
} | ||
@@ -276,2 +276,3 @@ | ||
startElement(this: any, name: string, attrs: XmlAttributes) { | ||
// empty | ||
}, | ||
@@ -278,0 +279,0 @@ endElement(this: any, element: string) { |
@@ -0,0 +0,0 @@ import { |
@@ -0,0 +0,0 @@ export * from "./xml2json"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ |
@@ -5,5 +5,26 @@ { | ||
"rootDir": ".", | ||
"outDir": "dist" | ||
"outDir": "dist", | ||
"composite": true | ||
}, | ||
"files": [ "source/index.ts" ] | ||
} | ||
"include": [ | ||
"source/**/*.ts" | ||
], | ||
"references": [ | ||
{ | ||
"path": "../node-opcua-assert" | ||
}, | ||
{ | ||
"path": "../node-opcua-debug" | ||
}, | ||
{ | ||
"path": "../node-opcua-utils" | ||
}, | ||
{ | ||
"path": "../node-opcua-nodesets" | ||
} | ||
], | ||
"exclude": [ | ||
"node_modules", | ||
"dist" | ||
] | ||
} |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
207818
2031
1