fix(usb): user-config-json-to-bin compile
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
"build": "tsc"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "8.0.28"
|
||||
"@types/node": "8.0.28",
|
||||
"typescript": "2.5.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"chalk": "2.1.0",
|
||||
|
||||
21
packages/usb/tsconfig.json
Normal file
21
packages/usb/tsconfig.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"compileOnSave": false,
|
||||
"compilerOptions": {
|
||||
"sourceMap": true,
|
||||
"declaration": false,
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"target": "es2016",
|
||||
"typeRoots": [
|
||||
"node_modules/@types"
|
||||
],
|
||||
"lib": [
|
||||
"es2015.iterable",
|
||||
"es2016",
|
||||
"dom",
|
||||
"dom.iterable"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
import { UhkBuffer, UserConfiguration } from '../uhk-common/src/config-serializer/index';
|
||||
import { UhkBuffer, UserConfiguration } from 'uhk-common';
|
||||
import * as fs from 'fs';
|
||||
|
||||
const inputFile = process.argv[2];
|
||||
console.log(inputFile);
|
||||
const outputFile = process.argv[3];
|
||||
|
||||
const config1Js = JSON.parse(fs.readFileSync(inputFile));
|
||||
const config1Js = JSON.parse(fs.readFileSync(inputFile).toString());
|
||||
const config1Ts: UserConfiguration = new UserConfiguration().fromJsonObject(config1Js);
|
||||
const config1Buffer = new UhkBuffer();
|
||||
config1Ts.toBinary(config1Buffer);
|
||||
|
||||
Reference in New Issue
Block a user