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

boolean

Package Overview
Dependencies
Maintainers
3
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

boolean - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

2

lib/boolean.js

@@ -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 @@

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