Skip to content

Commit 95c1eac

Browse files
wendopieh
authored andcommitted
feat: added option to support 'defval' option (#8980)
* Added option to support 'defval' option The default behaviour is to make them null or undefined and cells are skipped. Often when parsing Excel spreadsheets it may be practical to include blank cells for a record. This added option allows you to specify what the default value is, such as an empty string (i.e. ''). * Removed semi-colons for circle-ci to pass
1 parent 0ac577c commit 95c1eac

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/gatsby-transformer-excel/src/gatsby-node.js

+4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ async function onCreateNode(
3030
if (!_.has(xlsxOptions, `raw`) && _.has(xlsxOptions, `rawOutput`)) {
3131
xlsxOptions.raw = xlsxOptions.rawOutput
3232
}
33+
if (!_.has(xlsxOptions, `defval`) && _.has(xlsxOptions, `defaultValue`)) {
34+
xlsxOptions.defval = xlsxOptions.defaultValue
35+
}
3336
delete xlsxOptions.rawOutput
37+
delete xlsxOptions.defaultValue
3438
delete xlsxOptions.plugins
3539

3640
// Parse

0 commit comments

Comments
 (0)