mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Add comments to truncate functions
This commit is contained in:
parent
6f79bba69d
commit
b266e81727
@ -24,6 +24,7 @@ export default ({ app = {} }) => {
|
||||
}
|
||||
return accounting.formatNumber(value || 0, precision, thousands, decimals)
|
||||
},
|
||||
// doesn't truncate in the middle of words
|
||||
truncate: (value = '', length = -1) => {
|
||||
if (!value || typeof value !== 'string' || value.length <= 0) {
|
||||
return ''
|
||||
@ -33,6 +34,7 @@ export default ({ app = {} }) => {
|
||||
}
|
||||
return trunc(value, length).html
|
||||
},
|
||||
// truncates in the middle of words
|
||||
truncateStr: (value = '', length = -1) => {
|
||||
if (!value || typeof value !== 'string' || value.length <= 0) {
|
||||
return ''
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user