chrv-components 1.9.37 → 1.9.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
@@ -1224,9 +1224,17 @@ class FileService {
1224
1224
  this.toBase64 = (file) => {
1225
1225
  return new Observable((observer) => {
1226
1226
  const reader = new FileReader();
1227
+ const indexOfExtension = file?.file?.name.lastIndexOf('.');
1228
+ if (!indexOfExtension)
1229
+ throw '[FileInput] Invalid file name: no file extension found.';
1227
1230
  reader.onloadend = () => {
1228
1231
  var [name, extension] = [
1229
- ...(file?.file ? file.file.name.split('.') : [null, null]),
1232
+ ...(file?.file
1233
+ ? [
1234
+ file.file.name.slice(0, indexOfExtension),
1235
+ file.file.name.slice(indexOfExtension),
1236
+ ]
1237
+ : [null, null]),
1230
1238
  ];
1231
1239
  file = {
1232
1240
  ...file,