diff --git a/index.js b/index.js index 0a364dc..7c55ef8 100644 --- a/index.js +++ b/index.js @@ -8,12 +8,17 @@ const crypto = require('./src/crypto') * the SDK for the FormSG staging environment * @param {string} [options.webhookSecretKey] Optional base64 secret key for signing webhooks */ -module.exports = function ({ - mode='production', - webhookSecretKey, -} = {}) { - return { - webhooks: webhooks({ mode, webhookSecretKey }), - crypto, - } +module.exports = function (options) { + const { + mode = 'production', + webhookSecretKey, + } = options || {} + + return { + webhooks: webhooks({ + mode, + webhookSecretKey + }), + crypto, + } } diff --git a/package-lock.json b/package-lock.json index 36acf0a..4f9da88 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@opengovsg/formsg-sdk", - "version": "0.3.0", + "version": "0.3.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 7932ce8..67549cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@opengovsg/formsg-sdk", - "version": "0.3.0", + "version": "0.3.1", "description": "Node.js SDK for integrating with FormSG", "main": "index.js", "scripts": {