You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
403 B
JavaScript
17 lines
403 B
JavaScript
import mergeSupportedDomains from '../utils/merge-supported-domains';
|
|
|
|
export const apiExtractors = {};
|
|
|
|
export default function addExtractor(extractor) {
|
|
if (!extractor || !extractor.domain) {
|
|
return {
|
|
error: true,
|
|
message: 'Unable to add custom extractor. Invalid parameters.',
|
|
};
|
|
}
|
|
|
|
Object.assign(apiExtractors, mergeSupportedDomains(extractor));
|
|
|
|
return apiExtractors;
|
|
}
|