@internetarchive/field-parsers
Advanced tools
Comparing version 0.1.2 to 0.1.3
export class ListParser { | ||
constructor(parser, options) { | ||
this.separators = [',', ';']; | ||
this.separators = [';', ',']; | ||
this.parser = parser; | ||
@@ -5,0 +5,0 @@ if (options && options.separators) { |
@@ -67,3 +67,9 @@ import { expect } from '@open-wc/testing'; | ||
}); | ||
it('defaults to semicolons before commas since commas are common in some terms', async () => { | ||
const stringParser = new StringParser(); | ||
const parser = new ListParser(stringParser); | ||
const response = parser.parseValue('10,000 Maniacs; Boop, Beep, Boop'); | ||
expect(response).to.deep.equal(['10,000 Maniacs', 'Boop, Beep, Boop']); | ||
}); | ||
}); | ||
//# sourceMappingURL=list.test.js.map |
{ | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"name": "@internetarchive/field-parsers", | ||
@@ -4,0 +4,0 @@ "description": "Field parsers for Internet Archive metadata fields.", |
@@ -9,3 +9,3 @@ import { | ||
private separators = [',', ';']; | ||
private separators = [';', ',']; | ||
@@ -12,0 +12,0 @@ constructor( |
@@ -77,2 +77,9 @@ import { expect } from '@open-wc/testing'; | ||
}); | ||
it('defaults to semicolons before commas since commas are common in some terms', async () => { | ||
const stringParser = new StringParser(); | ||
const parser = new ListParser(stringParser); | ||
const response = parser.parseValue('10,000 Maniacs; Boop, Beep, Boop'); | ||
expect(response).to.deep.equal(['10,000 Maniacs', 'Boop, Beep, Boop']); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
151809
1485