mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add definitions for trim (#12292)
* Add definitions for trim * comments from PR
This commit is contained in:
parent
fd7d42b3f1
commit
374978e36a
12
trim/index.d.ts
vendored
Normal file
12
trim/index.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
// Type definitions for trim 0.01
|
||||
// Project: https://www.npmjs.com/package/trim
|
||||
// Definitions by: Steve Jenkins <https://github.com/skysteve>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function Trim(str: string): string;
|
||||
declare namespace Trim {
|
||||
function left(str: string): string;
|
||||
function right(str: string): string;
|
||||
}
|
||||
|
||||
export = Trim;
|
||||
9
trim/trim-tests.ts
Normal file
9
trim/trim-tests.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import trim = require("trim");
|
||||
|
||||
var original: string = " padded string ";
|
||||
|
||||
trim(original);
|
||||
|
||||
trim.left(original);
|
||||
|
||||
trim.right(original);
|
||||
19
trim/tsconfig.json
Normal file
19
trim/tsconfig.json
Normal 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",
|
||||
"trim-tests.ts"
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user