boolify-string
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -0,1 +1,7 @@ | ||
<a name="2.0.1"></a> | ||
## 2.0.1 (2015-07-19) | ||
* Use type-detect instead of my implementation | ||
<a name="2.0.0"></a> | ||
@@ -2,0 +8,0 @@ # 2.0.0 (2015-07-19) |
@@ -10,12 +10,6 @@ /* | ||
'use strict'; | ||
var type = require('type-detect'); | ||
// 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 (!is('String', obj)) { | ||
if (type(obj) !== 'string') { | ||
return !!obj; | ||
@@ -22,0 +16,0 @@ } |
{ | ||
"name": "boolify-string", | ||
"description": "Check a string whether truthy or falsy.", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"author": { | ||
@@ -10,3 +10,5 @@ "name": "sanemat", | ||
"bugs": "https://github.com/sanemat/node-boolify-string/issues", | ||
"dependencies": {}, | ||
"dependencies": { | ||
"type-detect": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
@@ -13,0 +15,0 @@ "conventional-changelog": "^0.1.0-beta.3", |
@@ -88,2 +88,7 @@ # boolify-string | ||
## Simular | ||
* [yn](https://github.com/sindresorhus/yn) | ||
## Changelog | ||
@@ -90,0 +95,0 @@ |
111
14050
1
243
+ Addedtype-detect@^1.0.0
+ Addedtype-detect@1.0.0(transitive)