Skip to content

Commit

Permalink
Merge pull request #9 from karlvr/types
Browse files Browse the repository at this point in the history
Types
  • Loading branch information
FGRibreau authored May 29, 2019
2 parents e9c1412 + 7916cec commit 6f94b00
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"author": "Francois-Guillaume Ribreau <npm@fgribreau.com> (http://fgribreau.com)",
"name": "truncate",
"main": "truncate.js",
"types": "truncate.d.ts",
"description": "Truncate text and keep urls safe",
"version": "2.0.1",
"homepage": "https://github.com/FGRibreau/node-truncate",
Expand Down
7 changes: 7 additions & 0 deletions truncate.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
declare module 'truncate' {
interface TruncateOptions {
ellipsis?: string
}

export default function truncate(string: string, maxLength: number, options?: TruncateOptions): string
}
1 change: 0 additions & 1 deletion truncate.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
* @param {String} string string needs to be truncated
* @param {Number} maxLength length of truncated string
* @param {Object} options (optional)
* @param {Boolean} [options.keepImageTag] flag to specify if keep image tag, false by default
* @param {Boolean|String} [options.ellipsis] omission symbol for truncated string, '...' by default
* @return {String} truncated string
*/
Expand Down

0 comments on commit 6f94b00

Please sign in to comment.