Maintenance
This commit is contained in:
parent
9032016305
commit
eae67c45e6
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
"root": true,
|
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"plugins": ["@typescript-eslint"],
|
|
||||||
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
|
|
||||||
"rules": {
|
|
||||||
"@typescript-eslint/no-unused-vars": ["warn", { "varsIgnorePattern": "_" }],
|
|
||||||
"@typescript-eslint/no-inferrable-types": ["off"]
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -12,7 +12,7 @@ jobs:
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [10.x, 12.x, 14.x]
|
node-version: [12.x, 14.x, 16.x, 18.x]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
@ -21,6 +21,5 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
- run: npm i
|
- run: npm i
|
||||||
- run: npm run lint
|
|
||||||
- run: npm test
|
- run: npm test
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,4 +1,4 @@
|
||||||
Copyright (C) 2021 Dmitry Shirokov
|
Copyright (C) 2022 Dmitry Shirokov
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|
11
package.json
11
package.json
|
@ -14,15 +14,15 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rm -rf lib/* && tsc",
|
"build": "rm -rf lib/* && tsc",
|
||||||
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
|
|
||||||
"lint:types": "tsc --noEmit",
|
|
||||||
"format": "prettier --write ./src/**/*.ts",
|
"format": "prettier --write ./src/**/*.ts",
|
||||||
"format:check": "prettier --list-different ./src/**/*.ts",
|
"format:check": "prettier --list-different ./src/**/*.ts",
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"prepublish": "npm run build",
|
"prepublish": "npm run build",
|
||||||
"semantic-release": "semantic-release"
|
"semantic-release": "semantic-release"
|
||||||
},
|
},
|
||||||
"files": ["lib"],
|
"files": [
|
||||||
|
"lib"
|
||||||
|
],
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"typings": "lib/index.d.ts",
|
"typings": "lib/index.d.ts",
|
||||||
"engine": {
|
"engine": {
|
||||||
|
@ -35,14 +35,11 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^26.0.14",
|
"@types/jest": "^26.0.14",
|
||||||
"@types/node": "^14.11.2",
|
"@types/node": "^14.11.2",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.2.0",
|
|
||||||
"@typescript-eslint/parser": "^4.2.0",
|
|
||||||
"eslint": "^7.9.0",
|
|
||||||
"jest": "^26.4.2",
|
"jest": "^26.4.2",
|
||||||
"prettier": "^2.1.2",
|
"prettier": "^2.1.2",
|
||||||
"semantic-release": "^17.1.2",
|
"semantic-release": "^17.1.2",
|
||||||
"ts-jest": "^26.4.0",
|
"ts-jest": "^26.4.0",
|
||||||
"typescript": "^4.0.3"
|
"typescript": "^4.8.4"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"encoding",
|
"encoding",
|
||||||
|
|
|
@ -98,8 +98,7 @@ class mbcs implements Recogniser {
|
||||||
* bits 8-15: The match reason, an enum-like value.
|
* bits 8-15: The match reason, an enum-like value.
|
||||||
*/
|
*/
|
||||||
match(det: Context): Match | null {
|
match(det: Context): Match | null {
|
||||||
let singleByteCharCount = 0, //TODO Do we really need this?
|
let doubleByteCharCount = 0,
|
||||||
doubleByteCharCount = 0,
|
|
||||||
commonCharCount = 0,
|
commonCharCount = 0,
|
||||||
badCharCount = 0,
|
badCharCount = 0,
|
||||||
totalCharCount = 0,
|
totalCharCount = 0,
|
||||||
|
@ -115,9 +114,7 @@ class mbcs implements Recogniser {
|
||||||
} else {
|
} else {
|
||||||
const cv = iter.charValue & 0xffffffff;
|
const cv = iter.charValue & 0xffffffff;
|
||||||
|
|
||||||
if (cv <= 0xff) {
|
if (cv > 0xff) {
|
||||||
singleByteCharCount++;
|
|
||||||
} else {
|
|
||||||
doubleByteCharCount++;
|
doubleByteCharCount++;
|
||||||
if (this.commonChars != null) {
|
if (this.commonChars != null) {
|
||||||
// NOTE: This assumes that there are no 4-byte common chars.
|
// NOTE: This assumes that there are no 4-byte common chars.
|
||||||
|
@ -192,7 +189,7 @@ class mbcs implements Recogniser {
|
||||||
* being iterated over.
|
* being iterated over.
|
||||||
* @return True if a character was returned, false at end of input.
|
* @return True if a character was returned, false at end of input.
|
||||||
*/
|
*/
|
||||||
nextChar(iter: IteratedChar, det: Context): boolean {
|
nextChar(_iter: IteratedChar, _det: Context): boolean {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -120,7 +120,7 @@ class sbcs implements Recogniser {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
name(input: Context): string {
|
name(_input: Context): string {
|
||||||
return 'sbcs';
|
return 'sbcs';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ class UTF_32 implements Recogniser, WithGetChar {
|
||||||
return 'UTF-32';
|
return 'UTF-32';
|
||||||
}
|
}
|
||||||
|
|
||||||
getChar(input: Uint8Array, index: number): number {
|
getChar(_input: Uint8Array, _index: number): number {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,13 +8,15 @@
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"diagnostics": true,
|
"diagnostics": true,
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"extendedDiagnostics": true,
|
"extendedDiagnostics": false,
|
||||||
"listEmittedFiles": true,
|
"listEmittedFiles": true,
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"removeComments": true,
|
"removeComments": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"target": "ES2019"
|
"target": "ES2019",
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true
|
||||||
},
|
},
|
||||||
"exclude": ["node_modules", "**/*.spec.ts", "**/*.test.ts", "__mocks__", "lib"]
|
"exclude": ["node_modules", "**/*.spec.ts", "**/*.test.ts", "__mocks__", "lib"]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue