Skip to content

Commit e316796

Browse files
committed
Refactor tsconfig.json
1 parent 67911d1 commit e316796

File tree

3 files changed

+14
-61
lines changed

3 files changed

+14
-61
lines changed

index.d.ts

+1-48
Original file line numberDiff line numberDiff line change
@@ -1,48 +1 @@
1-
/**
2-
* Function called for each element in an array.
3-
*
4-
* @typeParam Value
5-
* Element in array.
6-
* @typeParam ThisArg
7-
* Context object passed as `this`.
8-
* @param value
9-
* Element in array.
10-
* @param index
11-
* Index of `value` in `values`.
12-
* @param values
13-
* List.
14-
* @param [thisArg]
15-
* Context object
16-
* @returns {number|void}
17-
* The `index` to move to next.
18-
*/
19-
export type CallbackFn<Value, ThisArg = undefined> = (
20-
this: ThisArg,
21-
value: Value,
22-
index: number,
23-
array: Value[]
24-
) => number | void
25-
26-
/**
27-
* Perform the specified action for each element in an array.
28-
* When `callbackFn` returns a `number`, moves to the element at that index
29-
* next.
30-
*
31-
* @typeParam Value
32-
* Type in `values`.
33-
* @typeParam ThisArg
34-
* Context passed as `this` to callback.
35-
* @param values
36-
* Values to iterate over.
37-
* @param callbackFn
38-
* Function called for each element.
39-
* Can return the `index` to move to next.
40-
* @param [thisArg]
41-
* Optional object assigned as `this` in `callbackFn`.
42-
* @returns {void}
43-
*/
44-
export function arrayIterate<Value, ThisArg = undefined>(
45-
values: Value[],
46-
callbackFn: CallbackFn<Value, ThisArg>,
47-
thisArg?: ThisArg
48-
): void
1+
export {arrayIterate} from './lib/index.js'

package.json

+4-5
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,17 @@
3434
"prettier": "^2.0.0",
3535
"remark-cli": "^11.0.0",
3636
"remark-preset-wooorm": "^9.0.0",
37-
"rimraf": "^3.0.0",
3837
"tape": "^5.0.0",
3938
"type-coverage": "^2.0.0",
4039
"typescript": "^4.0.0",
4140
"xo": "^0.53.0"
4241
},
4342
"scripts": {
44-
"prepublishOnly": "npm run build && npm run format",
45-
"build": "rimraf \"lib/**/*.d.ts\" \"test.d.ts\" && tsc && type-coverage",
43+
"prepack": "npm run build && npm run format",
44+
"build": "tsc --build --clean && tsc --build && type-coverage",
4645
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
4746
"test-api": "node --conditions development test.js",
48-
"test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api",
47+
"test-coverage": "c8 --check-coverage --100 --reporter lcov npm run test-api",
4948
"test": "npm run build && npm run format && npm run test-coverage"
5049
},
5150
"prettier": {
@@ -61,7 +60,7 @@
6160
},
6261
"remarkConfig": {
6362
"plugins": [
64-
"preset-wooorm"
63+
"remark-preset-wooorm"
6564
]
6665
},
6766
"typeCoverage": {

tsconfig.json

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
{
2-
"include": ["lib/**/*.js", "test.js"],
2+
"include": ["**/**.js"],
3+
"exclude": ["coverage", "node_modules"],
34
"compilerOptions": {
4-
"target": "ES2020",
5-
"lib": ["ES2020"],
6-
"module": "ES2020",
7-
"moduleResolution": "node",
8-
"allowJs": true,
95
"checkJs": true,
106
"declaration": true,
117
"emitDeclarationOnly": true,
12-
"allowSyntheticDefaultImports": true,
8+
"exactOptionalPropertyTypes": true,
9+
"forceConsistentCasingInFileNames": true,
10+
"lib": ["es2020"],
11+
"module": "node16",
12+
"newLine": "lf",
1313
"skipLibCheck": true,
14-
"strict": true
14+
"strict": true,
15+
"target": "es2020"
1516
}
1617
}

0 commit comments

Comments
 (0)