1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.parse = void 0;
|
4 | var uk_clear_addressing_1 = require("uk-clear-addressing");
|
5 | exports.parse = function (body) {
|
6 | var _a = body.building_name, building_name = _a === void 0 ? "" : _a, _b = body.building_number, building_number = _b === void 0 ? "" : _b, _c = body.sub_building_name, sub_building_name = _c === void 0 ? "" : _c, _d = body.dependant_locality, dependant_locality = _d === void 0 ? "" : _d, _e = body.double_dependant_locality, double_dependant_locality = _e === void 0 ? "" : _e, _f = body.thoroughfare, thoroughfare = _f === void 0 ? "" : _f, _g = body.dependant_thoroughfare, dependant_thoroughfare = _g === void 0 ? "" : _g, _h = body.po_box, po_box = _h === void 0 ? "" : _h, _j = body.post_town, post_town = _j === void 0 ? "" : _j, _k = body.postcode, postcode = _k === void 0 ? "" : _k, _l = body.department_name, department_name = _l === void 0 ? "" : _l, _m = body.organisation_name, organisation_name = _m === void 0 ? "" : _m;
|
7 | var query = {
|
8 | building_name: building_name,
|
9 | building_number: building_number,
|
10 | sub_building_name: sub_building_name,
|
11 | dependant_locality: dependant_locality,
|
12 | double_dependant_locality: double_dependant_locality,
|
13 | thoroughfare: thoroughfare,
|
14 | dependant_thoroughfare: dependant_thoroughfare,
|
15 | po_box: po_box,
|
16 | post_town: post_town,
|
17 | postcode: postcode,
|
18 | department_name: department_name,
|
19 | organisation_name: organisation_name,
|
20 | };
|
21 | var address = new uk_clear_addressing_1.Address(query);
|
22 | var formatted = {
|
23 | line_1: address.line_1,
|
24 | line_2: address.line_2,
|
25 | line_3: address.line_3,
|
26 | post_town: address.post_town,
|
27 | postcode: address.postcode,
|
28 | premise: address.premise,
|
29 | };
|
30 | return { query: query, formatted: formatted };
|
31 | };
|
32 |
|
\ | No newline at end of file |