Comparing version 0.1.1 to 0.1.2
@@ -5,3 +5,3 @@ 'use strict'; | ||
if (typeof value === 'string') { | ||
return /^(true|t|yes|y|1)$/i.test(value); | ||
return /^(true|t|yes|y|1)$/i.test(value.trim()); | ||
} | ||
@@ -8,0 +8,0 @@ |
{ | ||
"name": "boolean", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "boolean converts lots of things to boolean.", | ||
@@ -5,0 +5,0 @@ "contributors": [ |
@@ -7,3 +7,5 @@ # boolean | ||
$ npm install boolean | ||
```bash | ||
$ npm install boolean | ||
``` | ||
@@ -15,3 +17,3 @@ ## Quick start | ||
```javascript | ||
var boolean = require('boolean'); | ||
const boolean = require('boolean'); | ||
``` | ||
@@ -32,4 +34,4 @@ | ||
- `'T'` (string) | ||
- `'yes (string)'` (string) | ||
- `'YES (string)'` (string) | ||
- `'yes'` (string) | ||
- `'YES'` (string) | ||
- `'y'` (string) | ||
@@ -40,2 +42,4 @@ - `'Y'` (string) | ||
*Please note that if you provide a string, it will be trimmed.* | ||
All other values, including `undefined` and `null` are considered to be `false`. | ||
@@ -52,3 +56,3 @@ | ||
The MIT License (MIT) | ||
Copyright (c) 2014 the native web. | ||
Copyright (c) 2014-2016 the native web. | ||
@@ -55,0 +59,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
@@ -149,2 +149,7 @@ 'use strict'; | ||
}); | ||
test('trims whitespace.', function (done) { | ||
assert.that(boolean(' true ')).is.true(); | ||
done(); | ||
}); | ||
}); | ||
@@ -151,0 +156,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
7780
168
59
0