@oneblink/sdk-core
Advanced tools
Comparing version 0.4.0 to 0.4.1-beta.1
@@ -98,4 +98,4 @@ "use strict"; | ||
element.name === propertyName); | ||
const value = submission[propertyName]; | ||
if (value === undefined || value === null) { | ||
const unknown = submission[propertyName]; | ||
if (unknown === undefined || unknown === null) { | ||
return undefined; | ||
@@ -105,8 +105,11 @@ } | ||
case 'datetime': { | ||
const value = unknown; | ||
return `${formatDate(value)} ${formatTime(value)}`; | ||
} | ||
case 'date': { | ||
const value = unknown; | ||
return formatDate(value); | ||
} | ||
case 'time': { | ||
const value = unknown; | ||
return formatTime(value); | ||
@@ -116,2 +119,3 @@ } | ||
case 'autocomplete': { | ||
const value = unknown; | ||
const option = (_a = formElement.options) === null || _a === void 0 ? void 0 : _a.find((opt) => opt.value === value); | ||
@@ -121,2 +125,3 @@ return (option === null || option === void 0 ? void 0 : option.label) || value; | ||
case 'checkboxes': { | ||
const value = unknown; | ||
const selectedOptionLabels = value.reduce((labels, selectedOption) => { | ||
@@ -132,2 +137,3 @@ var _a; | ||
case 'compliance': { | ||
const value = unknown; | ||
const option = (formElement.options || []).find((option) => option.value === value.value); | ||
@@ -141,2 +147,3 @@ return { | ||
if (formElement.multi) { | ||
const value = unknown; | ||
const selectedOptionLabels = value.reduce((labels, selectedOption) => { | ||
@@ -152,2 +159,3 @@ var _a; | ||
else { | ||
const value = unknown; | ||
const option = (_b = formElement.options) === null || _b === void 0 ? void 0 : _b.find((opt) => opt.value === value); | ||
@@ -158,5 +166,7 @@ return (option === null || option === void 0 ? void 0 : option.label) || ''; | ||
case 'boolean': { | ||
const value = unknown; | ||
return value ? 'Yes' : 'No'; | ||
} | ||
case 'calculation': { | ||
const value = unknown; | ||
if (!Number.isNaN(value) && Number.isFinite(value)) { | ||
@@ -176,8 +186,11 @@ let text; | ||
case 'geoscapeAddress': { | ||
const value = unknown; | ||
return ((_c = value === null || value === void 0 ? void 0 : value.addressDetails) === null || _c === void 0 ? void 0 : _c.formattedAddress) || (value === null || value === void 0 ? void 0 : value.addressId); | ||
} | ||
case 'civicaStreetName': { | ||
const value = unknown; | ||
return value === null || value === void 0 ? void 0 : value.formattedStreet; | ||
} | ||
case 'civicaNameRecord': { | ||
const value = unknown; | ||
return ([value === null || value === void 0 ? void 0 : value.title, value === null || value === void 0 ? void 0 : value.givenName1, value === null || value === void 0 ? void 0 : value.familyName] | ||
@@ -188,6 +201,7 @@ .filter((t) => t) | ||
case 'abn': { | ||
const value = unknown; | ||
return value ? (0, abnService_1.getABNNumberFromABNRecord)(value) : undefined; | ||
} | ||
default: { | ||
return value; | ||
return unknown; | ||
} | ||
@@ -194,0 +208,0 @@ } |
{ | ||
"name": "@oneblink/sdk-core", | ||
"description": "OneBlink SDK for JavaScript (works in Browsers and NodeJS)", | ||
"version": "0.4.0", | ||
"version": "0.4.1-beta.1", | ||
"author": "OneBlink <developers@oneblink.io> (https://oneblink.io)", | ||
@@ -6,0 +6,0 @@ "bugs": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
227464
2564