@internetarchive/field-parsers
Advanced tools
Comparing version 0.1.2 to 0.1.3-alpha1
export class ListParser { | ||
constructor(parser, options) { | ||
this.separators = [',', ';']; | ||
this.separators = [';', ',']; | ||
this.parser = parser; | ||
@@ -5,0 +5,0 @@ if (options && options.separators) { |
import { FieldParserInterface, FieldParserRawValue } from '../field-parser-interface'; | ||
export declare type MediaType = 'account' | 'audio' | 'collection' | 'data' | 'etree' | 'image' | 'movies' | 'software' | 'texts' | 'web'; | ||
export declare type MediaType = 'account' | 'audio' | 'collection' | 'data' | 'etree' | 'image' | 'movies' | 'search' | 'software' | 'texts' | 'web'; | ||
export declare class MediaTypeParser implements FieldParserInterface<MediaType> { | ||
@@ -4,0 +4,0 @@ static shared: MediaTypeParser; |
@@ -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-alpha1", | ||
"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( |
@@ -14,2 +14,3 @@ import { | ||
| 'movies' | ||
| 'search' | ||
| 'software' | ||
@@ -16,0 +17,0 @@ | 'texts' |
@@ -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
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
150389
88
1463
1