forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add types/tests for deindent (DefinitelyTyped#36549)
- Loading branch information
1 parent
891dfd1
commit aa253dc
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import deindent = require('deindent'); | ||
|
||
// as a string function | ||
deindent(` | ||
this | ||
is | ||
the ${'end'} | ||
my only | ||
friend | ||
the end | ||
`); | ||
|
||
// as a template tag | ||
deindent` | ||
this | ||
is | ||
the ${'end'} | ||
my only | ||
friend | ||
the end | ||
`; | ||
|
||
// as a higher-order template tag | ||
deindent(String.raw)` | ||
this | ||
is | ||
the ${'end'} | ||
my only | ||
friend | ||
the end | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Type definitions for deindent 0.1 | ||
// Project: https://github.com/deanlandolt/deindent | ||
// Definitions by: Avi Vahl <https://github.com/AviVahl> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
|
||
declare function deindent( | ||
tagFn: (template: TemplateStringsArray, ...substitutions: any[]) => string | ||
): (template: TemplateStringsArray, ...substitutions: any[]) => string; | ||
declare function deindent(template: TemplateStringsArray, ...substitutions: any[]): string; | ||
declare function deindent(input: string): string; | ||
|
||
export = deindent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
"deindent-tests.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "extends": "dtslint/dt.json" } |