mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-30 13:03:53 +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[] {
|
protected parseCsv(data: string, header: boolean): any[] {
|
||||||
|
data = this.splitNewLine(data).join('\n').trim();
|
||||||
const result = papa.parse(data, {
|
const result = papa.parse(data, {
|
||||||
header: header,
|
header: header,
|
||||||
encoding: 'UTF-8',
|
encoding: 'UTF-8',
|
||||||
|
@ -39,11 +39,6 @@ export class LastPassCsvImporter extends BaseImporter implements Importer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const cipher = this.buildBaseCipher(value);
|
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) {
|
if (cipher.type === CipherType.Login) {
|
||||||
cipher.notes = this.getValueOrDefault(value.extra);
|
cipher.notes = this.getValueOrDefault(value.extra);
|
||||||
cipher.login = new LoginView();
|
cipher.login = new LoginView();
|
||||||
|
Loading…
Reference in New Issue
Block a user