node-opcua-generator 2.66.0 → 2.68.1

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.
@@ -125,7 +125,7 @@ function writeStructuredTypeWithSchema(structuredType) {
125
125
  }
126
126
  function generate(filename, generatedTypescriptFilename) {
127
127
  return __awaiter(this, void 0, void 0, function* () {
128
- const content = yield readFile(filename, "ascii");
128
+ const content = yield readFile(filename, "utf-8");
129
129
  const idProvider = {
130
130
  getDataTypeAndEncodingId(name) {
131
131
  const dataType = node_opcua_constants_1.DataTypeIds[name] || 0;
package/dist/generator.js CHANGED
@@ -32,7 +32,7 @@ const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(__filename);
32
32
  * @static
33
33
  */
34
34
  function compileTScriptCode(typescriptFilename) {
35
- const content = fs.readFileSync(typescriptFilename, "ascii");
35
+ const content = fs.readFileSync(typescriptFilename, "utf-8");
36
36
  const compilerOptions = {
37
37
  module: ts.ModuleKind.CommonJS,
38
38
  target: ts.ScriptTarget.ES2016,
@@ -46,8 +46,8 @@ function compileTScriptCode(typescriptFilename) {
46
46
  const res1 = ts.transpileModule(content, { compilerOptions, moduleName: "myModule2" });
47
47
  const javascriptFilename = typescriptFilename.replace(/\.ts$/, ".js");
48
48
  const sourceMapFilename = typescriptFilename.replace(/\.ts$/, ".js.map");
49
- fs.writeFileSync(javascriptFilename, res1.outputText, "ascii");
50
- fs.writeFileSync(sourceMapFilename, res1.sourceMapText, "ascii");
49
+ fs.writeFileSync(javascriptFilename, res1.outputText, "utf-8");
50
+ fs.writeFileSync(sourceMapFilename, res1.sourceMapText, "utf-8");
51
51
  return res1.outputText;
52
52
  }
53
53
  exports.verbose = false;
@@ -1,11 +1,7 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
9
5
  }) : (function(o, m, k, k2) {
10
6
  if (k2 === undefined) k2 = k;
11
7
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,2DAAyC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA4B;AAC5B,2DAAyC"}
@@ -15,11 +15,11 @@ class LineFile1 extends node_opcua_utils_1.LineFile {
15
15
  this.write(" */");
16
16
  }
17
17
  save(filename) {
18
- (0, fs_1.writeFileSync)(filename, this.toString(), "ascii");
18
+ (0, fs_1.writeFileSync)(filename, this.toString(), "utf-8");
19
19
  }
20
20
  saveFormat(filename, formatter) {
21
21
  const code = formatter(this.toString());
22
- (0, fs_1.writeFileSync)(filename, code, "ascii");
22
+ (0, fs_1.writeFileSync)(filename, code, "utf-8");
23
23
  }
24
24
  }
25
25
  exports.LineFile1 = LineFile1;
@@ -15,11 +15,11 @@ const path = require("path");
15
15
  function normalize_require_file(baseFolder, fullPathToFile) {
16
16
  let localFile = path.relative(baseFolder, fullPathToFile).replace(/\\/g, "/");
17
17
  // append ./ if necessary
18
- if (localFile.substr(0, 1) !== ".") {
18
+ if (localFile.substring(0, 1) !== ".") {
19
19
  localFile = "./" + localFile;
20
20
  }
21
21
  // remove extension
22
- localFile = localFile.substr(0, localFile.length - path.extname(localFile).length);
22
+ localFile = localFile.substring(0, localFile.length - path.extname(localFile).length);
23
23
  return localFile;
24
24
  }
25
25
  exports.normalize_require_file = normalize_require_file;
@@ -1 +1 @@
1
- {"version":3,"file":"normalize_require_file.js","sourceRoot":"","sources":["../../source/utils/normalize_require_file.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,wHAAwH;AACxH;;;;;;;;GAQG;AACH,SAAgB,sBAAsB,CAAC,UAAkB,EAAE,cAAsB;IAC7E,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9E,yBAAyB;IACzB,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,EAAE;QAChC,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;KAChC;IACD,mBAAmB;IACnB,SAAS,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IACnF,OAAO,SAAS,CAAC;AACrB,CAAC;AATD,wDASC"}
1
+ {"version":3,"file":"normalize_require_file.js","sourceRoot":"","sources":["../../source/utils/normalize_require_file.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,wHAAwH;AACxH;;;;;;;;GAQG;AACH,SAAgB,sBAAsB,CAAC,UAAkB,EAAE,cAAsB;IAC7E,IAAI,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC9E,yBAAyB;IACzB,IAAI,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,GAAG,EAAE;QACnC,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;KAChC;IACD,mBAAmB;IACnB,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IACtF,OAAO,SAAS,CAAC;AACrB,CAAC;AATD,wDASC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-generator",
3
- "version": "2.66.0",
3
+ "version": "2.68.1",
4
4
  "description": "pure nodejs OPCUA SDK - module -generator",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -14,28 +14,28 @@
14
14
  "dependencies": {
15
15
  "chalk": "4.1.2",
16
16
  "node-opcua-assert": "2.66.0",
17
- "node-opcua-basic-types": "2.66.0",
18
- "node-opcua-buffer-utils": "2.66.0",
19
- "node-opcua-constants": "2.66.0",
20
- "node-opcua-data-model": "2.66.0",
21
- "node-opcua-data-value": "2.66.0",
22
- "node-opcua-date-time": "2.66.0",
23
- "node-opcua-debug": "2.66.0",
24
- "node-opcua-enum": "2.66.0",
25
- "node-opcua-factory": "2.66.0",
17
+ "node-opcua-basic-types": "2.68.0",
18
+ "node-opcua-buffer-utils": "2.67.0",
19
+ "node-opcua-constants": "2.67.0",
20
+ "node-opcua-data-model": "2.68.0",
21
+ "node-opcua-data-value": "2.68.0",
22
+ "node-opcua-date-time": "2.68.0",
23
+ "node-opcua-debug": "2.68.0",
24
+ "node-opcua-enum": "2.67.0",
25
+ "node-opcua-factory": "2.68.0",
26
26
  "node-opcua-guid": "2.66.0",
27
- "node-opcua-nodeid": "2.66.0",
28
- "node-opcua-numeric-range": "2.66.0",
29
- "node-opcua-schemas": "2.66.0",
30
- "node-opcua-status-code": "2.66.0",
31
- "node-opcua-utils": "2.66.0",
32
- "node-opcua-variant": "2.66.0",
33
- "node-opcua-xml2json": "2.66.0"
27
+ "node-opcua-nodeid": "2.68.0",
28
+ "node-opcua-numeric-range": "2.68.0",
29
+ "node-opcua-schemas": "2.68.1",
30
+ "node-opcua-status-code": "2.67.0",
31
+ "node-opcua-utils": "2.67.0",
32
+ "node-opcua-variant": "2.68.0",
33
+ "node-opcua-xml2json": "2.68.0"
34
34
  },
35
35
  "devDependencies": {
36
- "node-opcua-binary-stream": "2.66.0",
37
- "node-opcua-extension-object": "2.66.0",
38
- "node-opcua-packet-analyzer": "2.66.0",
36
+ "node-opcua-binary-stream": "2.67.0",
37
+ "node-opcua-extension-object": "2.68.0",
38
+ "node-opcua-packet-analyzer": "2.68.0",
39
39
  "prettier": "^2.6.1",
40
40
  "should": "^13.2.3",
41
41
  "source-map-support": "^0.5.21",
@@ -56,5 +56,5 @@
56
56
  "internet of things"
57
57
  ],
58
58
  "homepage": "http://node-opcua.github.io/",
59
- "gitHead": "97f47e2e242a1fd737495fd64cb65e8fb7a9964b"
59
+ "gitHead": "7bcb67b06ea755d438e91f5c143d20531497e286"
60
60
  }
@@ -139,7 +139,7 @@ function writeStructuredTypeWithSchema(structuredType: StructuredTypeSchema) {
139
139
  }
140
140
 
141
141
  export async function generate(filename: string, generatedTypescriptFilename: string): Promise<void> {
142
- const content = await readFile(filename, "ascii");
142
+ const content = await readFile(filename, "utf-8");
143
143
 
144
144
  const idProvider: MapDataTypeAndEncodingIdProvider = {
145
145
  getDataTypeAndEncodingId(name: string): DataTypeAndEncodingId | null {
@@ -27,7 +27,7 @@ const doDebug = checkDebugFlag(__filename);
27
27
  */
28
28
 
29
29
  function compileTScriptCode(typescriptFilename: string): string {
30
- const content = fs.readFileSync(typescriptFilename, "ascii");
30
+ const content = fs.readFileSync(typescriptFilename, "utf-8");
31
31
 
32
32
  const compilerOptions = {
33
33
  module: ts.ModuleKind.CommonJS,
@@ -48,8 +48,8 @@ function compileTScriptCode(typescriptFilename: string): string {
48
48
  const javascriptFilename = typescriptFilename.replace(/\.ts$/, ".js");
49
49
  const sourceMapFilename = typescriptFilename.replace(/\.ts$/, ".js.map");
50
50
 
51
- fs.writeFileSync(javascriptFilename, res1.outputText, "ascii");
52
- fs.writeFileSync(sourceMapFilename, res1.sourceMapText!, "ascii");
51
+ fs.writeFileSync(javascriptFilename, res1.outputText, "utf-8");
52
+ fs.writeFileSync(sourceMapFilename, res1.sourceMapText!, "utf-8");
53
53
 
54
54
  return res1.outputText;
55
55
  }
@@ -13,11 +13,11 @@ export class LineFile1 extends LineFile {
13
13
  this.write(" */");
14
14
  }
15
15
  public save(filename: string): void {
16
- writeFileSync(filename, this.toString(), "ascii");
16
+ writeFileSync(filename, this.toString(), "utf-8");
17
17
  }
18
18
 
19
19
  public saveFormat(filename: string, formatter: (code: string) => string): void {
20
20
  const code = formatter(this.toString());
21
- writeFileSync(filename, code, "ascii");
21
+ writeFileSync(filename, code, "utf-8");
22
22
  }
23
23
  }
@@ -12,10 +12,10 @@ import * as path from "path";
12
12
  export function normalize_require_file(baseFolder: string, fullPathToFile: string): string {
13
13
  let localFile = path.relative(baseFolder, fullPathToFile).replace(/\\/g, "/");
14
14
  // append ./ if necessary
15
- if (localFile.substr(0, 1) !== ".") {
15
+ if (localFile.substring(0, 1) !== ".") {
16
16
  localFile = "./" + localFile;
17
17
  }
18
18
  // remove extension
19
- localFile = localFile.substr(0, localFile.length - path.extname(localFile).length);
19
+ localFile = localFile.substring(0, localFile.length - path.extname(localFile).length);
20
20
  return localFile;
21
21
  }