
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Using key paths that may contain "falsey" patterns, check if a property on an object is enabled.
Using key paths that may contain "falsey" patterns, check if a property on an object is enabled.
Install with npm:
$ npm i is-enabled --save
Require in the is-enabled
function and setup an object to use.
var isEnabled = require('is-enabled');
var options = {};
Check if the verbose
property is enabled.
Returns true
when verbose
is true
.
options.verbose = true;
console.log(isEnabled(options, 'verbose'));
//=> true
Returns false
when verbose
is false
.
options.verbose = false;
console.log(isEnabled(options, 'verbose'));
//=> false
Use "falsey" patterns in the key path to toggle the results.
Returns false
when verbose
is true
.
options.verbose = true;
console.log(isEnabled(options, 'not.verbose'));
//=> false
Returns true
when verbose
is false
.
options.verbose = false;
console.log(isEnabled(options, 'not.verbose'));
//=> true
falsey: Returns true if value
is falsey. Works for strings, arrays and arguments
objects with a… more | homepage
Generate readme and API documentation with [verb][]:
$ npm i -d && npm run docs
Or, if [verb][] is installed globally:
$ verb
Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Brian Woodward
Copyright © 2016 Brian Woodward Released under the MIT license.
This file was generated by verb, v0.1.0, on February 20, 2016.
FAQs
Using key paths that may contain "falsey" patterns, check if a property on an object is enabled.
The npm package is-enabled receives a total of 74 weekly downloads. As such, is-enabled popularity was classified as not popular.
We found that is-enabled demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.