Skip to content

Commit

Permalink
Use strict types
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Nov 7, 2021
1 parent 91b8838 commit dcf9560
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -13,7 +13,7 @@ const ltr = new RegExp('^[^' + rtlRange + ']*[' + ltrRange + ']')
* Detect direction.
*
* @param {string} value
* @returns {'rtl' | 'ltr' | 'neutral'}
* @returns {'rtl'|'ltr'|'neutral'}
*/
export function direction(value) {
const source = String(value || '')
Expand Down
9 changes: 5 additions & 4 deletions package.json
Expand Up @@ -46,11 +46,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": {
Expand All @@ -72,6 +72,7 @@
"typeCoverage": {
"atLeast": 100,
"detail": true,
"strict": true
"strict": true,
"ignoreCatch": true
}
}
2 changes: 2 additions & 0 deletions test.js
@@ -1,3 +1,4 @@
import assert from 'node:assert'
import fs from 'node:fs'
import childProcess from 'node:child_process'
import {PassThrough} from 'node:stream'
Expand Down Expand Up @@ -72,6 +73,7 @@ test('cli', function (t) {
}
)

assert(subprocess.stdin, 'expected stdin')
input.pipe(subprocess.stdin)
input.write('لة')
setImmediate(function () {
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
@@ -1,5 +1,4 @@
{
"files": ["index.js"],
"include": ["*.js"],
"compilerOptions": {
"target": "ES2020",
Expand All @@ -11,6 +10,7 @@
"declaration": true,
"emitDeclarationOnly": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true
"skipLibCheck": true,
"strict": true
}
}

0 comments on commit dcf9560

Please sign in to comment.