Merge pull request #12975 from Goldsmith42/types-2.0

Definition for left-pad.
This commit is contained in:
Paul van Brenk
2016-11-29 15:56:04 -08:00
committed by GitHub
4 changed files with 43 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
// Type definitions for left-pad 1.1
// Project: https://github.com/stevemao/left-pad
// Definitions by: Zlatko Andonovski <https://github.com/Goldsmith42/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare function leftPad(str: string|number, len: number, ch?: string|number): string;
export = leftPad;
+15
View File
@@ -0,0 +1,15 @@
import leftPad = require("left-pad");
// Tests based on examples in https://github.com/stevemao/left-pad#usage
leftPad("foo", 5);
// => " foo"
leftPad("foobar", 6);
// => "foobar"'
leftPad(1, 2, "0");
// => "01"
leftPad(17, 5, 0);
// => "00017"
+19
View File
@@ -0,0 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"left-pad-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "../tslint.json" }