Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contrail/util

Package Overview
Dependencies
Maintainers
10
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contrail/util - npm Package Compare versions

Comparing version 1.0.44 to 1.0.45

19

lib/object-util/applyChangesIfEqual/applyChangesIfEqual.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc