mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Added type definitions for smart-truncate (#31743)
This commit is contained in:
committed by
Wesley Wigham
parent
e193757d8e
commit
51474e1b4f
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
// Type definitions for smart-truncate 1.0
|
||||
// Project: https://github.com/millerized/smart-truncate
|
||||
// Definitions by: Omer Yalhi <https://github.com/oyalhi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export function smartTruncate(text: string, length: number, options?: { position?: number; mark?: string }): string;
|
||||
@@ -0,0 +1,7 @@
|
||||
import { smartTruncate } from 'smart-truncate';
|
||||
|
||||
const length = 9;
|
||||
let result = '';
|
||||
result = smartTruncate('Steve Miller', length);
|
||||
result = smartTruncate('Steve Miller', length, {position: 4});
|
||||
result = smartTruncate('abcdefghijklmnopqrstuvwxyz', 7, {position: 3, mark: '—'});
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"smart-truncate-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user