Merge pull request #33685 from djcsdy/condense-whitespace

[condense-whitespace] Add type definitions.
This commit is contained in:
Nathan Shively-Sanders 2019-03-08 11:05:21 -08:00 committed by GitHub
commit 26aee874b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,7 @@
import condense = require("condense-whitespace");
// $ExpectType string
condense(" \n\n\t Hello World \t\n");
// $ExpectError
condense(1);

8
types/condense-whitespace/index.d.ts vendored Normal file
View File

@ -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;

View File

@ -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"
]
}

View File

@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }