Skip to content

Instantly share code, notes, and snippets.

@developit
Created October 15, 2019 17:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save developit/ee19a1db75175aa023e45a687dc4e58d to your computer and use it in GitHub Desktop.
Save developit/ee19a1db75175aa023e45a687dc4e58d to your computer and use it in GitHub Desktop.
package-lock.json
node_modules
/**Joins two strings.
* @param {string} a The first string to join
* @param {string} [b] The second string to join
* @returns {string} text
*/
export default function join(a: string, b?: string): string;
/**Joins two strings.
* @param {string} a The first string to join
* @param {string} [b] The second string to join
* @returns {string} text
*/
export default function join(a, b) {
if (b) return a + b;
return a;
}
{
"name": "tsc-checkjs-dts-demo",
"main": "index.js",
"scripts": {
"build": "tsc -d --emitDeclarationOnly --allowJs --checkJs index.js"
},
"devDependencies": {
"typescript": "^3.7.0-beta"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment