diff --git a/index.js b/index.js index 2e6b430..650ffbe 100644 --- a/index.js +++ b/index.js @@ -1,12 +1,12 @@ -import {trigram} from 'n-gram' -import {collapseWhiteSpace} from 'collapse-white-space' - /** * @typedef {[string, number]} TrigramTuple * @typedef {TrigramTuple[]} TrigramTuples - * @typedef {Object.} TrigramDictionary + * @typedef {Record} TrigramDictionary */ +import {trigram} from 'n-gram' +import {collapseWhiteSpace} from 'collapse-white-space' + const own = {}.hasOwnProperty /** @@ -14,7 +14,7 @@ const own = {}.hasOwnProperty * Removed general non-important (as in, for language detection) punctuation * marks, symbols, and digits. * - * @param {string} [value] + * @param {string|null} [value] * @returns {string} */ export function clean(value) { diff --git a/package.json b/package.json index c639cb7..88c35ad 100644 --- a/package.json +++ b/package.json @@ -44,11 +44,11 @@ "xo": "^0.46.0" }, "scripts": { - "prepack": "npm run build && npm run format", + "prepublishOnly": "npm run build && npm run format", "build": "rimraf \"*.d.ts\" && tsc && type-coverage", "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", - "test-api": "node test.js", - "test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test.js", + "test-api": "node --conditions development test.js", + "test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api", "test": "npm run build && npm run format && npm run test-coverage" }, "prettier": { @@ -70,6 +70,7 @@ "typeCoverage": { "atLeast": 100, "detail": true, - "strict": true + "strict": true, + "ignoreCatch": true } } diff --git a/tsconfig.json b/tsconfig.json index 8ac10fe..e31adf8 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,4 @@ { - "files": ["index.js"], "include": ["*.js"], "compilerOptions": { "target": "ES2020", @@ -11,6 +10,7 @@ "declaration": true, "emitDeclarationOnly": true, "allowSyntheticDefaultImports": true, - "skipLibCheck": true + "skipLibCheck": true, + "strict": true } }