Skip to content

Commit

Permalink
feat: Get rid of enums. (#287)
Browse files Browse the repository at this point in the history
* feat: Get rid of enums.

* fix: Linted code.

* chore: Renamed type.
  • Loading branch information
ShogunPanda authored Jan 30, 2024
1 parent e486f51 commit a3186f7
Show file tree
Hide file tree
Showing 5 changed files with 274 additions and 291 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"wasm": "ts-node bin/build_wasm.ts",
"clean": "rm -rf lib && rm -rf test/tmp",
"prepare": "npm run clean && npm run build-ts",
"test": "node -r ts-node/register/type-check -r ./test/md-test.ts",
"test": "node -r ts-node/register/type-check ./test/md-test.ts",
"lint": "eslint -c eslint.json bin/*.ts src/*.ts src/**/*.ts test/*.ts test/**/*.ts",
"lint-fix": "eslint --fix -c eslint.json bin/*.ts src/*.ts src/**/*.ts test/*.ts test/**/*.ts",
"postversion": "RELEASE=`node -e \"process.stdout.write(require('./package').version)\"` make -B postversion",
Expand Down
6 changes: 3 additions & 3 deletions src/llhttp/c-headers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as constants from './constants';
import { enumToMap, IEnumMap } from './utils';
import { enumToMap } from './utils';

type Encoding = 'none' | 'hex';

Expand Down Expand Up @@ -64,7 +64,7 @@ export class CHeaders {
return res;
}

private buildEnum(name: string, prefix: string, map: IEnumMap,
private buildEnum(name: string, prefix: string, map: constants.IntDict,
encoding: Encoding = 'none'): string {
let res = '';

Expand Down Expand Up @@ -92,7 +92,7 @@ export class CHeaders {
return res;
}

private buildMap(name: string, map: IEnumMap): string {
private buildMap(name: string, map: constants.IntDict): string {
let res = '';

res += `#define ${name}_MAP(XX) \\\n`;
Expand Down
Loading

0 comments on commit a3186f7

Please sign in to comment.