mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 00:33:44 +00:00
processingNotes takes remainder of row lines
This commit is contained in:
@@ -210,31 +210,37 @@ export class LastPassCsvImporter extends BaseImporter implements Importer {
|
|||||||
let notes: string = null;
|
let notes: string = null;
|
||||||
const dataObj: any = {};
|
const dataObj: any = {};
|
||||||
|
|
||||||
|
let processingNotes = false;
|
||||||
extraParts.forEach((extraPart) => {
|
extraParts.forEach((extraPart) => {
|
||||||
if (this.isNullOrWhitespace(extraPart)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let key: string = null;
|
let key: string = null;
|
||||||
let val: string = null;
|
let val: string = null;
|
||||||
const colonIndex = extraPart.indexOf(':');
|
if (!processingNotes) {
|
||||||
if (colonIndex === -1) {
|
if (this.isNullOrWhitespace(extraPart)) {
|
||||||
key = extraPart;
|
return;
|
||||||
} else {
|
}
|
||||||
key = extraPart.substring(0, colonIndex);
|
const colonIndex = extraPart.indexOf(':');
|
||||||
if (extraPart.length > colonIndex) {
|
if (colonIndex === -1) {
|
||||||
val = extraPart.substring(colonIndex + 1);
|
key = extraPart;
|
||||||
|
} else {
|
||||||
|
key = extraPart.substring(0, colonIndex);
|
||||||
|
if (extraPart.length > colonIndex) {
|
||||||
|
val = extraPart.substring(colonIndex + 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.isNullOrWhitespace(key) || this.isNullOrWhitespace(val) || key === 'NoteType') {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.isNullOrWhitespace(key) || this.isNullOrWhitespace(val) || key === 'NoteType') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (key === 'Notes') {
|
if (processingNotes) {
|
||||||
|
notes += ('\n' + extraPart);
|
||||||
|
} else if (key === 'Notes') {
|
||||||
if (!this.isNullOrWhitespace(notes)) {
|
if (!this.isNullOrWhitespace(notes)) {
|
||||||
notes += ('\n' + val);
|
notes += ('\n' + val);
|
||||||
} else {
|
} else {
|
||||||
notes = val;
|
notes = val;
|
||||||
}
|
}
|
||||||
|
processingNotes = true;
|
||||||
} else if (map.hasOwnProperty(key)) {
|
} else if (map.hasOwnProperty(key)) {
|
||||||
dataObj[map[key]] = val;
|
dataObj[map[key]] = val;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user