@defra/fcp-sfd-frontend-engine 0.1.0 → 0.2.1

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 ADDED
@@ -0,0 +1,47 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/index.js
20
+ var index_exports = {};
21
+ __export(index_exports, {
22
+ mapPersonalBusinessDetails: () => mapPersonalBusinessDetails
23
+ });
24
+ module.exports = __toCommonJS(index_exports);
25
+
26
+ // src/mappers/personal-business-details-mapper.js
27
+ var mapPersonalBusinessDetails = (value) => {
28
+ return {
29
+ info: {
30
+ userName: [
31
+ value.customer.info.name.first,
32
+ value.customer.info.name.last
33
+ ].filter(Boolean).join(" ")
34
+ },
35
+ business: {
36
+ info: {
37
+ organisationId: value.business.organisationId ?? null,
38
+ sbi: value.business.sbi ?? null,
39
+ name: value.business.info.name ?? null
40
+ }
41
+ }
42
+ };
43
+ };
44
+ // Annotate the CommonJS export names for ESM import in node:
45
+ 0 && (module.exports = {
46
+ mapPersonalBusinessDetails
47
+ });
package/dist/index.js ADDED
@@ -0,0 +1,21 @@
1
+ // src/mappers/personal-business-details-mapper.js
2
+ var mapPersonalBusinessDetails = (value) => {
3
+ return {
4
+ info: {
5
+ userName: [
6
+ value.customer.info.name.first,
7
+ value.customer.info.name.last
8
+ ].filter(Boolean).join(" ")
9
+ },
10
+ business: {
11
+ info: {
12
+ organisationId: value.business.organisationId ?? null,
13
+ sbi: value.business.sbi ?? null,
14
+ name: value.business.info.name ?? null
15
+ }
16
+ }
17
+ };
18
+ };
19
+ export {
20
+ mapPersonalBusinessDetails
21
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra/fcp-sfd-frontend-engine",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "Shared frontend engine used by both the internal and external frontend applications.",
5
5
  "main": "./dist/index.cjs",
6
6
  "exports": {