mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-06 09:20:43 +01:00
normalize new lines and trim csv data
This commit is contained in:
parent
b5353551a8
commit
2fe65e27e2
@ -72,6 +72,7 @@ export abstract class BaseImporter {
|
||||
}
|
||||
|
||||
protected parseCsv(data: string, header: boolean): any[] {
|
||||
data = this.splitNewLine(data).join('\n').trim();
|
||||
const result = papa.parse(data, {
|
||||
header: header,
|
||||
encoding: 'UTF-8',
|
||||
|
@ -39,11 +39,6 @@ export class LastPassCsvImporter extends BaseImporter implements Importer {
|
||||
}
|
||||
|
||||
const cipher = this.buildBaseCipher(value);
|
||||
if (cipher.name === '--' && results.length > 2 && index >= (results.length - 2)) {
|
||||
// LastPass file traditionally has two empty lines at the end
|
||||
return;
|
||||
}
|
||||
|
||||
if (cipher.type === CipherType.Login) {
|
||||
cipher.notes = this.getValueOrDefault(value.extra);
|
||||
cipher.login = new LoginView();
|
||||
|
Loading…
Reference in New Issue
Block a user