@opengovsg/formsg-sdk 7.5.0 → 7.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cjs-entry.cjs +4 -1
  2. package/package.json +1 -1
package/cjs-entry.cjs CHANGED
@@ -2,4 +2,7 @@
2
2
  // TypeScript compiles `export default function` to `exports.default = fn`,
3
3
  // but CJS consumers expect `require('@opengovsg/formsg-sdk')` to return
4
4
  // the function directly (matching the old v0.15.0 behavior).
5
- module.exports = require('./dist/cjs/index.js').default
5
+ // Object.assign preserves named exports (adaptV3ToV4, etc.) on the
6
+ // callable default so both `formsg(config)` and `formsg.adaptV3ToV4` work.
7
+ const mod = require('./dist/cjs/index.js')
8
+ module.exports = Object.assign(mod.default, mod)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengovsg/formsg-sdk",
3
- "version": "7.5.0",
3
+ "version": "7.6.0",
4
4
  "main": "./cjs-entry.cjs",
5
5
  "module": "./dist/esm/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",