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

opencadc-js

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opencadc-js - npm Package Compare versions

Comparing version 2.0.7 to 2.0.8

17

lib/org.opencadc.js

@@ -139,3 +139,6 @@ 'use strict';

new RegExp('^' + '\\s*' + '\\b' + 'y[es]?|true' + '\\b' + '\\s*' + '$','i');
var _FALSE_REGEX_ =
new RegExp('^' + '\\s*' + '\\b' + 'n[o]?|false' + '\\b' + '\\s*' + '$','i');
/**

@@ -147,3 +150,3 @@ * Return whether the given value is true, or 'positive'. This will test for

*/
this.truthiness = function(_val)
this.isTrueValue = function(_val)
{

@@ -153,2 +156,14 @@ return (_val == true)

};
/**
* Return whether the given value is false, or 'negative'. This will test for
* things like 'false', false, 0, 'no', 'n'.
*
* @param {*} _val
*/
this.isFalseValue = function(_val)
{
return (_val == false)
|| ((typeof _val === 'string') && _FALSE_REGEX_.test(_val));
};
}

@@ -155,0 +170,0 @@

6

package.json
{
"name": "opencadc-js",
"version": "2.0.7",
"version": "2.0.8",
"description": "OpenCADC JavaScript libraries.",
"dependencies": {
"jquery": "^3.1.0",
"jsdom": "^9.9.1",
"uglify-js": "^2.7.5"
},
"devDependencies": {
"jquery": "^3.1.0",
"jsdom": "^9.9.1",
"jsdom-global": "^2.1.1",

@@ -12,0 +12,0 @@ "mocha": "^3.2.0"

@@ -317,3 +317,3 @@ var assert = require('assert');

describe('BooleanUtil values.', function ()
describe('BooleanUtil true values.', function ()
{

@@ -324,4 +324,4 @@ var testSubject = new opencadcJS.BooleanUtil();

{
assert.ok(testSubject.truthiness(true));
assert.ok(testSubject.truthiness(1), 'Check value of 1.');
assert.ok(testSubject.isTrueValue(true));
assert.ok(testSubject.isTrueValue(1), 'Check value of 1.');
});

@@ -331,3 +331,3 @@

{
assert.ok(testSubject.truthiness('y'), 'Check for "y"');
assert.ok(testSubject.isTrueValue('y'), 'Check for "y"');
});

@@ -337,3 +337,3 @@

{
assert.ok(testSubject.truthiness('Y'), 'Check for "Y"');
assert.ok(testSubject.isTrueValue('Y'), 'Check for "Y"');
});

@@ -343,4 +343,4 @@

{
assert.ok(testSubject.truthiness('Yes'), 'Check for "Yes"');
assert.ok(testSubject.truthiness('yEs'), 'Check for "yEs"');
assert.ok(testSubject.isTrueValue('Yes'), 'Check for "Yes"');
assert.ok(testSubject.isTrueValue('yEs'), 'Check for "yEs"');
});

@@ -350,3 +350,3 @@

{
assert.ok(testSubject.truthiness('true'));
assert.ok(testSubject.isTrueValue('true'));
});

@@ -356,3 +356,3 @@

{
assert.ok(testSubject.truthiness('false') === false);
assert.ok(testSubject.isTrueValue('false') === false);
});

@@ -362,3 +362,3 @@

{
assert.ok(testSubject.truthiness('no') === false);
assert.ok(testSubject.isTrueValue('no') === false);
});

@@ -368,4 +368,51 @@

{
assert.ok(testSubject.truthiness('n') === false);
assert.ok(testSubject.isTrueValue('n') === false);
});
});
describe('BooleanUtil false values.', function ()
{
var testSubject = new opencadcJS.BooleanUtil();
it ('Check base primitive.', function ()
{
assert.ok(testSubject.isFalseValue(false));
assert.ok(testSubject.isFalseValue(0), 'Check value of 0.');
});
it ('Check for "n"', function ()
{
assert.ok(testSubject.isFalseValue('n'), 'Check for "n"');
});
it ('Check for "Y"', function ()
{
assert.ok(testSubject.isFalseValue('N'), 'Check for "N"');
});
it ('Check for "no"', function ()
{
assert.ok(testSubject.isFalseValue('No'), 'Check for "No"');
assert.ok(testSubject.isFalseValue('nO'), 'Check for "nO"');
});
it ('Check string "false"', function ()
{
assert.ok(testSubject.isFalseValue('false'));
});
it ('Check string "true"', function ()
{
assert.ok(testSubject.isFalseValue('true') === false);
});
it ('Check string "yes"', function ()
{
assert.ok(testSubject.isFalseValue('yes') === false);
});
it ('Check string "y"', function ()
{
assert.ok(testSubject.isFalseValue('y') === false);
});
});
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