Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function handlePrimitive(x) {
const t = typeof x
if (x === null || x === undefined || t === 'number' || t === 'boolean' || isRegexp(x)) {
return String(x)
}
return null
}
self.feed().map(feed => {
const options = objectAssign({}, self.options, feed.options);
if (!feed.screenname) {
throw new Error('Screenname required');
}
if (options.filterTags) {
if (Array.isArray(options.filterTags)) {
options.filterTags = hashRegex(options.filterTags);
} else if (!isRegexp(options.filterTags)) {
throw new TypeError(
`Invalid regex: ${options.filterTags} for ${feed.screenname}`
);
}
}
self.feeds.push({
screenname: feed.screenname,
options
});
return Promise.resolve();
})
);