aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/app/_services/csv-parse.service.ts
diff options
context:
space:
mode:
authorDanijel Andjelkovic <adanijel99@gmail.com>2022-03-31 13:54:06 +0200
committerDanijel Andjelkovic <adanijel99@gmail.com>2022-03-31 13:54:06 +0200
commit8779b55a3a3637dbfb1bea518ebdc4d340687097 (patch)
treeb0f8b749f0769649bbaf32714920ca5d9c0fd0a9 /frontend/src/app/_services/csv-parse.service.ts
parentb573b0069512f4444aefdac0a24eb99c8fcb6586 (diff)
parente5d06f541553597d5db1b0e8a552935679875132 (diff)
Merge branch 'dev' of http://gitlab.pmf.kg.ac.rs/igrannonica/neuronstellar into dev
# Conflicts: # frontend/src/app/_pages/add-model/add-model.component.html # frontend/src/app/_pages/add-model/add-model.component.ts
Diffstat (limited to 'frontend/src/app/_services/csv-parse.service.ts')
-rw-r--r--frontend/src/app/_services/csv-parse.service.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/frontend/src/app/_services/csv-parse.service.ts b/frontend/src/app/_services/csv-parse.service.ts
index e44af238..4a05535a 100644
--- a/frontend/src/app/_services/csv-parse.service.ts
+++ b/frontend/src/app/_services/csv-parse.service.ts
@@ -2,7 +2,7 @@ import { Injectable } from "@angular/core";
@Injectable({ providedIn: 'root' })
export class CsvParseService {
- csvToArray(strData: string, strDelimiter: string): string[][] {
+ csvToArray(strData: string, strDelimiter: string): (string | null)[][] {
strDelimiter = (strDelimiter || ",");
let objPattern = new RegExp(
@@ -19,7 +19,7 @@ export class CsvParseService {
"gi"
);
- let arrData: string[][] = [[]];
+ let arrData: (string | null)[][] = [[]];
let arrMatches = null;
@@ -45,8 +45,10 @@ export class CsvParseService {
strMatchedValue = arrMatches[3];
}
- //if (strMatchedValue.length > 0)
+ if (strMatchedValue.length > 0)
arrData[arrData.length - 1].push(strMatchedValue);
+ else
+ arrData[arrData.length - 1].push(null);
}
return (arrData);