
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.
isset-helper
Advanced tools
A tiny helper method for Javascript, checking a variable for existence.
Since checking variable types and existence always has been painful in Javascript, validation conditions normally are exhausting. This module solves this definitely.
Install the library through your preferred package manager:
$ npm install --save isset-helper
# or
$ yarn add isset-helper
Then you can require the module as usual:
const isset = require('isset-helper');
Include one of the following script tags in your pages head:
<script src="https://cdn.jsdelivr.net/npm/isset-helper@2/dist/isset.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/mcstreetguy/isset-helper@2/dist/isset.min.js"></script>
<script src="https://bundle.run/isset-helper@2.0/dist/isset.min.js"></script>
<script src="https://unpkg.com/isset-helper@2/dist/isset.min.js"></script>
The library registers the isset
function automatically on the window
object.
isset(variable, type);
variable
can be anything. It's value is going to be checked.
type
can be a string, class or even left out.
The algorithm follows the subsequent rules:
variable
is not null
variable
is not undefined
type
is a string, typeof variable
has to match type
variable
has to match instanceof type
type
is "string"
, variable
is not an empty stringPlease notice:
instanceof
-check, leaving it out of consideration if the check produces any error.false
will also be considered valid.If, contrary to expectations, you find an error in the function, please report it to the Issues page.
This library is licensed under the MIT License. You may find a copy of the license at the root of the project source.
FAQs
A tiny helper method, checking a variable for existence
The npm package isset-helper receives a total of 2 weekly downloads. As such, isset-helper popularity was classified as not popular.
We found that isset-helper 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.