mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
Merge pull request #12975 from Goldsmith42/types-2.0
Definition for left-pad.
This commit is contained in:
Vendored
+8
@@ -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;
|
||||
@@ -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"
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Reference in New Issue
Block a user