From 4e8102f77e39859b5755e79b5de8048756436f99 Mon Sep 17 00:00:00 2001 From: liangyuanruo Date: Mon, 30 Mar 2020 21:29:02 +0800 Subject: [PATCH 1/2] Do the destructuring in the function body instead of the parameter --- index.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) 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, + } } From ba3607c61eb97d5f93e904dc8ee8ffe47d5bbb1a Mon Sep 17 00:00:00 2001 From: liangyuanruo Date: Mon, 30 Mar 2020 21:33:17 +0800 Subject: [PATCH 2/2] 0.3.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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": {