@undp/carbon-library 1.0.42 → 1.0.43

Sign up to get free protection for your applications and to get access to all the features.
package/dist/esm/index.js CHANGED
@@ -1208,13 +1208,10 @@ var AddNewCompanyComponent = function (props) {
1208
1208
  }
1209
1209
  else {
1210
1210
  phoneNo = formatPhoneNumber(String(value));
1211
- if (phoneNo === null ||
1212
- phoneNo === "" ||
1213
- phoneNo === undefined) {
1214
- if (String(value) !== "") {
1215
- throw new Error("Phone Number ".concat(t("isInvalid")));
1216
- }
1217
- else {
1211
+ if (String(value).trim() !== "") {
1212
+ if (phoneNo === null ||
1213
+ phoneNo === "" ||
1214
+ phoneNo === undefined) {
1218
1215
  throw new Error("Phone Number ".concat(t("isRequired")));
1219
1216
  }
1220
1217
  }