{"version":3,"file":"string-5522bbbb.js","sources":["../../../app/javascript/utils/string.ts"],"sourcesContent":["const truncateString = (str: string, limit: number, end: string) => {\n limit = (limit)? limit : 100;\n end = (end) ? end : '...';\n if (!str) return;\n\n let strs = str.split('');\n if (strs.length > limit) {\n const cutTolimit = strs.slice(0, limit);\n return cutTolimit.join('') + ' ' + end;\n }\n\n return strs.join('');\n}\n\nconst truncatedFileName = (name: string) => {\n if (name && name.length > 30) {\n return name.substring(0, 30) + '...';\n } else {\n return name;\n }\n}\n\nexport { truncateString, truncatedFileName }\n"],"names":["truncateString","str","limit","end","strs","truncatedFileName","name"],"mappings":"AAAA,MAAMA,EAAiB,CAACC,EAAaC,EAAeC,IAAgB,CAGlE,GAFAD,EAASA,GAAgB,IACzBC,EAAOA,GAAa,MAChB,CAACF,EAAK,OAEN,IAAAG,EAAOH,EAAI,MAAM,EAAE,EACnB,OAAAG,EAAK,OAASF,EACGE,EAAK,MAAM,EAAGF,CAAK,EACpB,KAAK,EAAE,EAAI,IAAMC,EAG9BC,EAAK,KAAK,EAAE,CACrB,EAEMC,EAAqBC,GACrBA,GAAQA,EAAK,OAAS,GACjBA,EAAK,UAAU,EAAG,EAAE,EAAI,MAExBA"}