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

boolean

Package Overview
Dependencies
Maintainers
5
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 2.0.2 to 2.0.3

18

build/lib/boolean.js

@@ -5,3 +5,19 @@ "use strict";

if (typeof value === 'string') {
return /^(?<truthy>true|t|yes|y|on|1)$/iu.test(value.trim());
// According to our ESLint rules, the regular expression following below
// should be using a named capture group. This is an official part of
// ES2018, but Firefox fails to implement it. There has been an open issue
// for this (see https://bugzilla.mozilla.org/show_bug.cgi?id=1362154) since
// 2016 now, and Mozilla fails to fix this. To avoid breaking support with
// Firefox, we explicitly disable the ESLint rule here and use a regular
// expression without a named capture group. We should check from time to
// time, whether support in Firefox has finally been added. Besides the
// issue, we can check this using the following link to the kangax table:
// https://kangax.github.io/compat-table/es2016plus/#test-RegExp_named_capture_groups
// The original line, which is failing in Firefox:
// return /^(?<truthy>true|t|yes|y|on|1)$/iu.test(value.trim());
// The replacement line, which should be removed at some point in the
// future, including the ESLint comments:
/* eslint-disable prefer-named-capture-group */
return /^(true|t|yes|y|on|1)$/iu.test(value.trim());
/* eslint-enable prefer-named-capture-group */
}

@@ -8,0 +24,0 @@ if (typeof value === 'number') {

const boolean = function (value: any): boolean {
if (typeof value === 'string') {
return /^(?<truthy>true|t|yes|y|on|1)$/iu.test(value.trim());
// According to our ESLint rules, the regular expression following below
// should be using a named capture group. This is an official part of
// ES2018, but Firefox fails to implement it. There has been an open issue
// for this (see https://bugzilla.mozilla.org/show_bug.cgi?id=1362154) since
// 2016 now, and Mozilla fails to fix this. To avoid breaking support with
// Firefox, we explicitly disable the ESLint rule here and use a regular
// expression without a named capture group. We should check from time to
// time, whether support in Firefox has finally been added. Besides the
// issue, we can check this using the following link to the kangax table:
// https://kangax.github.io/compat-table/es2016plus/#test-RegExp_named_capture_groups
// The original line, which is failing in Firefox:
// return /^(?<truthy>true|t|yes|y|on|1)$/iu.test(value.trim());
// The replacement line, which should be removed at some point in the
// future, including the ESLint comments:
/* eslint-disable prefer-named-capture-group */
return /^(true|t|yes|y|on|1)$/iu.test(value.trim());
/* eslint-enable prefer-named-capture-group */
}

@@ -5,0 +23,0 @@

4

package.json
{
"name": "boolean",
"version": "2.0.2",
"version": "2.0.3",
"description": "boolean converts lots of things to boolean.",

@@ -24,3 +24,3 @@ "contributors": [

"assertthat": "4.0.2",
"roboter": "7.3.1"
"roboter": "9.0.6"
},

@@ -27,0 +27,0 @@ "repository": {

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