Skip to content

Commit

Permalink
feat: exportDeltaFile can take an optional transformerFunctionName re…
Browse files Browse the repository at this point in the history
…sourceConfig option
  • Loading branch information
jezhiggins committed Jul 4, 2018
1 parent 0d88140 commit f4fc8c5
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
'use strict'
const generateDelta = require('@wmfs/pg-delta-file')
const getFunction = require('@wmfs/tymly/lib/getFunction.js')

class ExportingCsvDeltaFile {
init (resourceConfig, env, callback) {
Expand All @@ -11,6 +12,9 @@ class ExportingCsvDeltaFile {
this.createdColumnName = resourceConfig.createdColumnName || '_created'
this.modifiedColumnName = resourceConfig.modifiedColumnName || '_modified'
this.csvExtracts = resourceConfig.csvExtracts
this.transformFunction = resourceConfig.transformerFunctionName
? getFunction(env, resourceConfig.transformerFunctionName)
: null
callback(null)
}

Expand All @@ -22,6 +26,7 @@ class ExportingCsvDeltaFile {
since: event.lastExportDate,
outputFilepath: event.outputFilepath,
actionAliases: this.actionAliases,
transformFunction: this.transformFunction,
createdColumnName: this.createdColumnName,
modifiedColumnName: this.modifiedColumnName,
csvExtracts: this.csvExtracts
Expand Down

0 comments on commit f4fc8c5

Please sign in to comment.