Skip to content

Commit

Permalink
dev: enhance microbundle build output
Browse files Browse the repository at this point in the history
  • Loading branch information
webketje committed Aug 5, 2022
1 parent 5e97ec2 commit 0e44407
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ function isDraft(value, fallback) {
*/
function configureDrafts(options = defaultOptions) {
if (typeof options === 'boolean') {
options = { ...defaultOptions, include: options }
options = Object.assign({}, defaultOptions, { include: options })
} else {
options = { ...defaultOptions, ...options }
options = Object.assign({}, defaultOptions, options)
}

return function drafts(files, metalsmith, done) {
Expand Down
4 changes: 3 additions & 1 deletion test/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

const equal = require('assert-dir-equal')
const Metalsmith = require('metalsmith')
const drafts = require('..')

/* eslint-disable-next-line import/no-internal-modules */
const drafts = require('../lib/index.cjs')

describe('@metalsmith/drafts', function () {
it('should remove drafts from output (default behavior / ensure backwards-compatibility)', function (done) {
Expand Down

0 comments on commit 0e44407

Please sign in to comment.