1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-24 12:06:15 +01:00

normalize new lines and trim csv data

This commit is contained in:
Kyle Spearrin 2018-07-21 08:21:08 -04:00
parent b5353551a8
commit 2fe65e27e2
2 changed files with 1 additions and 5 deletions

View File

@ -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',

View File

@ -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();