mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-30 13:30:31 +00:00
And rewrite all the require calls. ```bash git mv src/utils/* packages/@uppy/utils/src sed -i 's/[./]*\/utils\//@uppy\/utils\/lib\//' src/**/*.js # transform (../)*utils → @uppy/utils ```
9 lines
276 B
JavaScript
9 lines
276 B
JavaScript
module.exports = function truncateString (str, length) {
|
|
if (str.length > length) {
|
|
return str.substr(0, length / 2) + '...' + str.substr(str.length - length / 4, str.length)
|
|
}
|
|
return str
|
|
|
|
// more precise version if needed
|
|
// http://stackoverflow.com/a/831583
|
|
}
|