Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Commit

Permalink
include null data case
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored and lukastaegert committed May 21, 2018
1 parent 1a584e4 commit eea7d7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/dataToEsm.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function dataToNamedExports (data, options = {}) {
const n = options.compact ? '' : '\n';
const declarationType = options.preferConst ? 'const' : 'var';

if (options.namedExports === false || typeof data !== 'object' || Array.isArray(data))
if (options.namedExports === false || typeof data !== 'object' || Array.isArray(data) || data === null)
return `export default${ _ }${ serialize( data, options.compact ? null : t, '' ) };`;

let namedExportCode = '';
Expand Down

0 comments on commit eea7d7e

Please sign in to comment.