Socket
Socket
Sign inDemoInstall

enabled

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

.travis.yml

4

index.js

@@ -33,4 +33,4 @@ 'use strict';

if ('-' === variable.charAt(0)) {
if (!(new RegExp('^'+ variable.substr(1) +'$')).test(name)) {
return true;
if ((new RegExp('^'+ variable.substr(1) +'$')).test(name)) {
return false;
}

@@ -37,0 +37,0 @@

{
"name": "enabled",
"version": "1.0.1",
"version": "1.0.2",
"description": "Check if a certain debug flag is enabled.",

@@ -13,2 +13,6 @@ "main": "index.js",

},
"repository": {
"type": "git",
"url": "git://github.com/bigpipe/enabled.git"
},
"keywords": [

@@ -29,7 +33,7 @@ "enabled",

"devDependencies": {
"assume": "1.2.x",
"istanbul": "0.3.x",
"mocha": "2.2.x",
"pre-commit": "1.0.x"
"assume": "1.3.x",
"istanbul": "0.4.x",
"mocha": "2.3.x",
"pre-commit": "1.1.x"
}
}

@@ -44,4 +44,9 @@ # enabled

```js
process.env.DEBUG = 'foob';
process.env.DEBUG = 'foo';
enabled('foo') // true;
enabled('bar') // false;
// can use wildcards
process.env.DEBUG = 'foob*';
enabled('foobar') // true;

@@ -48,0 +53,0 @@ enabled('barfoo') // false;

@@ -45,3 +45,3 @@ describe('enabled', function () {

it('can ignore loggers using a -', function () {
process.env.DEBUG = 'bigpipe,-primus,sack';
process.env.DEBUG = 'bigpipe,-primus,sack,-other';

@@ -51,2 +51,4 @@ assume(enabled('bigpipe')).to.be.true();

assume(enabled('primus')).to.be.false();
assume(enabled('other')).to.be.false();
assume(enabled('unknown')).to.be.false();
});

@@ -53,0 +55,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc