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

poly-js-utils

Package Overview
Dependencies
Maintainers
3
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

poly-js-utils - npm Package Compare versions

Comparing version 1.3.5 to 1.3.6

2

package.json
{
"name": "poly-js-utils",
"version": "1.3.5",
"version": "1.3.6",
"description": "Common client-side tools used in HSS Sites themes and locators.",

@@ -5,0 +5,0 @@ "main": "main.js",

@@ -15,15 +15,18 @@ var utils = require('../src/utils');

var tag = ["true"];
expect(utils.selectBoxIsTrue(tag)).toBeTruthy();
expect(utils.selectBoxIsTrue(tag)).toBe(true);
});
it("should return true if the tag has a value of TRUE", function() {
var tag = ["TRUE"];
expect(utils.selectBoxIsTrue(tag)).toBeTruthy();
expect(utils.selectBoxIsTrue(tag)).toBe(true);
});
it("should return false if the tag does not exist", function() {
expect(utils.selectBoxIsTrue(undefined)).toBeFalsy();
expect(utils.selectBoxIsTrue(undefined)).toBe(false);
});
it("should return false if the tag has any value other than true", function() {
var tag = ["some other value"];
expect(utils.selectBoxIsTrue(tag)).toBeFalsy();
expect(utils.selectBoxIsTrue(tag)).toBe(false);
});
it("should return false if passed in an empty array", function() {
expect(utils.selectBoxIsTrue([])).toBe(false);
});
});

@@ -30,0 +33,0 @@

@@ -184,3 +184,3 @@ var _ = require('underscore');

var selectBoxIsTrue = function(value) {
return (value && value[0].toLowerCase() === "true");
return !!(value && value.length && value[0].toLowerCase() === "true");
};

@@ -187,0 +187,0 @@

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