@takeda4dcs/text-ellipsis
v0.1.4
Published
Provide clipped string functions.
Downloads
2
Readme
@takeda4dcs/text-ellipsis
Table of contents
Functions
Functions
textEllipsisEnd
▸ textEllipsisEnd(origin
, length
, ellipsis?
): undefined
| string
Clip the string from its end
Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| origin
| string
| undefined
| string to truncate |
| length
| number
| undefined
| length to trim - does not include the length of the ellipsis |
| ellipsis
| string
| DEFAULT_ELLIPSIS
| specify the ellipsis - default false '…' |
Returns
undefined
| string
clipped string
Defined in
textEllipsisMiddle
▸ textEllipsisMiddle(origin
, length
, ellipsis?
, rear_longer?
): undefined
| string
Clip the string from its middle
Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| origin
| string
| undefined
| string to truncate |
| length
| number
| undefined
| length to trim - does not include the length of the ellipsis |
| ellipsis
| string
| DEFAULT_ELLIPSIS
| specify the ellipsis - default false '…' |
| rear_longer
| boolean
| false
| rear part be made longer if length is an odd number - default false |
Returns
undefined
| string
clipped string
Defined in
textEllipsisStart
▸ textEllipsisStart(origin
, length
, ellipsis?
): undefined
| string
Clip the string from its start
Parameters
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| origin
| string
| undefined
| string to truncate |
| length
| number
| undefined
| length to trim - does not include the length of the ellipsis |
| ellipsis
| string
| DEFAULT_ELLIPSIS
| specify the ellipsis - default false '…' |
Returns
undefined
| string
clipped string