@contrail/util
Advanced tools
Comparing version 1.0.44 to 1.0.45
@@ -36,4 +36,4 @@ "use strict"; | ||
if (property.propertyType === types_1.PropertyType.MultiSelect) { | ||
const propertyValueOneAsArray = typeof propertyValueOne === 'string' ? propertyValueOne.split(',') : propertyValueOne; | ||
const propertyValueTwoAsArray = typeof propertyValueTwo === 'string' ? propertyValueTwo.split(',') : propertyValueTwo; | ||
const propertyValueOneAsArray = getMultiSelectValueAsArray(propertyValueOne); | ||
const propertyValueTwoAsArray = getMultiSelectValueAsArray(propertyValueTwo); | ||
return areArraysEqualIgnoreOrder(propertyValueOneAsArray, propertyValueTwoAsArray); | ||
@@ -62,6 +62,3 @@ } | ||
function areArraysEqualIgnoreOrder(arrayOne, arrayTwo) { | ||
if (!arrayOne && !arrayTwo) { | ||
return true; | ||
} | ||
if ((arrayOne === null || arrayOne === void 0 ? void 0 : arrayOne.length) !== (arrayTwo === null || arrayTwo === void 0 ? void 0 : arrayTwo.length)) { | ||
if (arrayOne.length !== arrayTwo.length) { | ||
return false; | ||
@@ -80,1 +77,11 @@ } | ||
} | ||
function getMultiSelectValueAsArray(multiSelectValue) { | ||
if (!multiSelectValue) | ||
return []; | ||
if (typeof multiSelectValue === 'string') { | ||
if (multiSelectValue.trim().length === 0) | ||
return []; | ||
return multiSelectValue.split(','); | ||
} | ||
return multiSelectValue; | ||
} |
{ | ||
"name": "@contrail/util", | ||
"version": "1.0.44", | ||
"version": "1.0.45", | ||
"description": "General javascript utilities", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
32459
727