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

boolify-string

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boolify-string - npm Package Compare versions

Comparing version 1.0.1 to 1.1.0

appveyor.yml

9

lib/boolify-string.js

@@ -11,4 +11,11 @@ /*

// http://qiita.com/Layzie/items/465e715dae14e2f601de
function is(type, obj) {
// e.g. [object String]
var clas = Object.prototype.toString.call(obj).slice(8, -1);
return obj !== undefined && obj !== null && clas === type;
}
module.exports = function(obj){
if (typeof obj !== 'string'){
if (!is('String', obj)) {
return !!obj;

@@ -15,0 +22,0 @@ }

8

package.json
{
"name": "boolify-string",
"description": "Check a string whether truthy or falsy.",
"version": "1.0.1",
"version": "1.1.0",
"author": {

@@ -12,2 +12,3 @@ "name": "sanemat",

"devDependencies": {
"conventional-changelog": "^0.1.0-beta.3",
"david": "^6.1.6",

@@ -27,5 +28,5 @@ "espower-loader": "^0.11.0",

"keywords": [
"string",
"bool",
"environment",
"bool"
"string"
],

@@ -39,2 +40,3 @@ "license": "MIT",

"scripts": {
"changelog": "conventional-changelog -i changelog.md --overwrite --preset angular",
"david": "david",

@@ -41,0 +43,0 @@ "fixpack": "fixpack",

# boolify-string
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-url]][daviddm-image]
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Appveyor Status][appveyor-image]][appveyor-url] [![Dependency Status][daviddm-url]][daviddm-image]

@@ -66,1 +66,3 @@ Check a string whether truthy or falsy.

[daviddm-image]: https://david-dm.org/sanemat/node-boolify-string
[appveyor-url]: https://ci.appveyor.com/project/sanemat/node-boolify-string/branch/master
[appveyor-image]: https://img.shields.io/appveyor/ci/sanemat/node-boolify-string/master.svg?style=flat-square&label=appveyor

@@ -81,2 +81,13 @@ 'use strict';

});
describe('new String("")', function (){
it('new String("true") should be true', function(){
var target = new String('true'); // jshint ignore:line
assert.equal(boolifyString(target), true);
});
it('new String("false") should be false', function(){
var target = new String('false'); // jshint ignore:line
assert.equal(boolifyString(target), 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