@cnbcool/cnb-api-generate 2.3.1 → 2.3.3

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.
@@ -1,13 +1,7 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
-
4
- const flatOptionsFilePath = path.join(__dirname, '../flat-options.json');
5
-
6
1
  let data: Record<string, Record<string, Record<string, any>>> = {};
7
2
 
8
- if (fs.existsSync(flatOptionsFilePath)) {
9
- const content = fs.readFileSync(flatOptionsFilePath, 'utf8');
10
- data = JSON.parse(content);
11
- }
3
+ try {
4
+ data = require('../flat-options.json');
5
+ } catch {}
12
6
 
13
7
  export const flatOptionsData = data;
@@ -1,13 +1 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
-
4
- const helpFileContent = fs.readFileSync(
5
- path.join(__dirname, '../help.json'),
6
- 'utf8',
7
- );
8
- if (!helpFileContent) {
9
- console.error('help.json not found');
10
- process.exit(1);
11
- }
12
-
13
- export const helpData = JSON.parse(helpFileContent);
1
+ export const helpData = require('../help.json');
@@ -1,13 +1,7 @@
1
- import fs from 'fs';
2
- import path from 'path';
3
-
4
- const keyMappingFilePath = path.join(__dirname, '../key-mapping.json');
5
-
6
1
  let data: Record<string, Record<string, Record<string, string>>> = {};
7
2
 
8
- if (fs.existsSync(keyMappingFilePath)) {
9
- const content = fs.readFileSync(keyMappingFilePath, 'utf8');
10
- data = JSON.parse(content);
11
- }
3
+ try {
4
+ data = require('../key-mapping.json');
5
+ } catch {}
12
6
 
13
7
  export const keyMappingData = data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnbcool/cnb-api-generate",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "main": "./built/index.js",
5
5
  "module": "./src/index.ts",
6
6
  "types": "./src/index.ts",