Skip to content

Commit

Permalink
Merge pull request DefinitelyTyped#33685 from djcsdy/condense-whitespace
Browse files Browse the repository at this point in the history
[condense-whitespace] Add type definitions.
  • Loading branch information
sandersn authored Mar 8, 2019
2 parents 5c87264 + 9baa009 commit 26aee87
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
7 changes: 7 additions & 0 deletions types/condense-whitespace/condense-whitespace-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import condense = require("condense-whitespace");

// $ExpectType string
condense(" \n\n\t Hello World \t\n");

// $ExpectError
condense(1);
8 changes: 8 additions & 0 deletions types/condense-whitespace/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Type definitions for condense-whitespace 1.0
// Project: https://github.com/sindresorhus/condense-whitespace
// Definitions by: Daniel Cassidy <https://github.com/djcsdy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare function condenseWhitespace(str: string): string;

export = condenseWhitespace;
23 changes: 23 additions & 0 deletions types/condense-whitespace/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"condense-whitespace-tests.ts"
]
}
1 change: 1 addition & 0 deletions types/condense-whitespace/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

0 comments on commit 26aee87

Please sign in to comment.