@defra/fcp-sfd-frontend-engine 0.2.10 → 0.2.12

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.
package/dist/index.cjs CHANGED
@@ -38,12 +38,7 @@ module.exports = __toCommonJS(index_exports);
38
38
  // src/mappers/personal-business-details-mapper.js
39
39
  var mapPersonalBusinessDetails = (value) => {
40
40
  return {
41
- info: {
42
- userName: [
43
- value.customer.info.name.first,
44
- value.customer.info.name.last
45
- ].filter(Boolean).join(" ")
46
- },
41
+ info: { ...mappers.customerName(value.customer.info.name) },
47
42
  business: {
48
43
  info: {
49
44
  organisationId: value.business.organisationId ?? null,
package/dist/index.js CHANGED
@@ -1,12 +1,7 @@
1
1
  // src/mappers/personal-business-details-mapper.js
2
2
  var mapPersonalBusinessDetails = (value) => {
3
3
  return {
4
- info: {
5
- userName: [
6
- value.customer.info.name.first,
7
- value.customer.info.name.last
8
- ].filter(Boolean).join(" ")
9
- },
4
+ info: { ...mappers.customerName(value.customer.info.name) },
10
5
  business: {
11
6
  info: {
12
7
  organisationId: value.business.organisationId ?? null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/fcp-sfd-frontend-engine",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "description": "Shared frontend engine used by both the internal and external frontend applications.",
5
5
  "main": "./dist/index.cjs",
6
6
  "exports": {
@@ -47,4 +47,4 @@
47
47
  "dependencies": {
48
48
  "joi": "18.2.1"
49
49
  }
50
- }
50
+ }
@@ -6,14 +6,11 @@
6
6
  * @returns {Object} Formatted personal business details data
7
7
  */
8
8
 
9
+ import { mappers } from './mappers'
10
+
9
11
  export const mapPersonalBusinessDetails = (value) => {
10
12
  return {
11
- info: {
12
- userName: [
13
- value.customer.info.name.first,
14
- value.customer.info.name.last
15
- ].filter(Boolean).join(' ')
16
- },
13
+ info: { ...mappers.customerName(value.customer.info.name) },
17
14
  business: {
18
15
  info: {
19
16
  organisationId: value.business.organisationId ?? null,