-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Truncates the input text to the desired length.
Example usage
import toEllipsis from '@plexis/to-ellipsis';
toEllipsis('foo');
// => 'foo'
toEllipsis('foo', 1);
// => '...'
toEllipsis('foo', 3);
// => 'foo'
toEllipsis('As Gregor Samsa awoke one morning from uneasy dreams he found himself transformed in his bed into a monstrous vermin.', 20);
// => 'As Gregor Samsa a...'
toEllipsis('In a hole in the ground there lived a hobbit.', Infinity)
// => 'In a hole in the ground there lived a hobbit.'
toEllipsis('Last night I dreamt I went to Manderley again.', 5);
// => Last...Aliases
import toEllipsis from '@plexis/to-ellipsis';
import {toEllipsis, truncate, fit} from 'plexis';Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed