Skip to content

Commit

Permalink
Add strict types
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Nov 14, 2022
1 parent 381b9bf commit 295e77b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
12 changes: 8 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/**
* Parse space separated tokens to an array of strings.
*
* @param {string} value Space separated tokens
* @returns {Array.<string>} Tokens
* @param {string} value
* Space separated tokens.
* @returns {Array<string>}
* Tokens.
*/
export function parse(value) {
const input = String(value || '').trim()
Expand All @@ -12,8 +14,10 @@ export function parse(value) {
/**
* Serialize an array of strings as space separated tokens.
*
* @param {Array.<string|number>} values Tokens
* @returns {string} Space separated tokens
* @param {Array<string|number>} values
* Tokens.
* @returns {string}
* Space separated tokens.
*/
export function stringify(values) {
return values.join(' ').trim()
Expand Down
19 changes: 10 additions & 9 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"files": ["index.js"],
"include": ["*.js"],
"include": ["**/**.js"],
"exclude": ["coverage", "node_modules"],
"compilerOptions": {
"target": "ES2020",
"lib": ["ES2020"],
"module": "ES2020",
"moduleResolution": "node",
"allowJs": true,
"checkJs": true,
"declaration": true,
"emitDeclarationOnly": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"lib": ["es2020"],
"module": "node16",
"newLine": "lf",
"skipLibCheck": true,
"strict": true,
"target": "es2020"
}
}

0 comments on commit 295e77b

Please sign in to comment.