node-opcua-generator 2.67.0 → 2.68.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.
@@ -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;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-generator",
3
- "version": "2.67.0",
3
+ "version": "2.68.0",
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.67.0",
17
+ "node-opcua-basic-types": "2.68.0",
18
18
  "node-opcua-buffer-utils": "2.67.0",
19
19
  "node-opcua-constants": "2.67.0",
20
- "node-opcua-data-model": "2.67.0",
21
- "node-opcua-data-value": "2.67.0",
22
- "node-opcua-date-time": "2.67.0",
23
- "node-opcua-debug": "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
24
  "node-opcua-enum": "2.67.0",
25
- "node-opcua-factory": "2.67.0",
25
+ "node-opcua-factory": "2.68.0",
26
26
  "node-opcua-guid": "2.66.0",
27
- "node-opcua-nodeid": "2.67.0",
28
- "node-opcua-numeric-range": "2.67.0",
29
- "node-opcua-schemas": "2.67.0",
27
+ "node-opcua-nodeid": "2.68.0",
28
+ "node-opcua-numeric-range": "2.68.0",
29
+ "node-opcua-schemas": "2.68.0",
30
30
  "node-opcua-status-code": "2.67.0",
31
31
  "node-opcua-utils": "2.67.0",
32
- "node-opcua-variant": "2.67.0",
33
- "node-opcua-xml2json": "2.67.0"
32
+ "node-opcua-variant": "2.68.0",
33
+ "node-opcua-xml2json": "2.68.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "node-opcua-binary-stream": "2.67.0",
37
- "node-opcua-extension-object": "2.67.0",
38
- "node-opcua-packet-analyzer": "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": "74c2fd7d4ce3eb48d25a911258bf90a64218ea0e"
59
+ "gitHead": "363b466440d0910acddd0cde2c37792ce4724d76"
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
  }