Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const attributesObject = (attrs, _genus, context = {}) => {
const { fileName, lineNumber } = context
const attrsObject = {}
let genus = _genus
if (!genus || typeof genus !== 'string') {
log.error(`No directive provided: ${fileName}:${lineNumber}`)
}
if (ALL_DIRECTIVES.indexOf(genus) < 0) {
log.error(`Invalid directive: [${genus}] at ${fileName}:${lineNumber}`)
}
if (DRAFT_DIRECTIVES.indexOf(genus) > -1) {
log.warn(`render [epub:${genus}] is [draft]. substituting with [chapter]`)
genus = 'chapter'
}
if (DEPRECATED_DIRECTIVES.indexOf(genus) > -1) {
log.warn(
`render [epub:${genus}] is [deprecated]. substituting with [chapter]`
)
genus = 'chapter'
}
if (attrs && typeof attrs === 'string') {
forOf(parseAttrs(attrs.trim()), (k, v) => {
if (_isUnsupportedAttribute(_genus, k)) {
return log.warn(
`render omitting unsupported attribute [${k}] at [${fileName}:${lineNumber}]`