Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit 53d92b5

Browse files
committed
added option to pass string as multiple content type
1 parent aac8088 commit 53d92b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/module.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ const contentOptions = (content, defaults) => {
2323
const opts = {}
2424
if (!Array.isArray(content)) opts['/'] = { ...defaults, ...content }
2525
else {
26-
content.forEach(registeredArr => {
27-
const dirName = registeredArr[0]
28-
const dirOpts = registeredArr[1]
26+
content.forEach(strOrArr => {
27+
const dirName = Array.isArray(strOrArr) ? strOrArr[0] : strOrArr
28+
const dirOpts = Array.isArray(strOrArr) ? strOrArr[1] : {}
2929
if (dirName === '/' && registered.length > 1) { // prevent endpoint conflict
3030
throw new Error('Top level files not allowed with nested registered directories')
3131
}

0 commit comments

Comments
 (0)