1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-05 09:10:53 +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[] { 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',

View File

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