
Company News
/Security News
Socket Selected for OpenAI's Cybersecurity Grant Program
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.
It checks if a variable is empty or not and returns true (not empty) or false (empty) accordingly. It also can return a CheckResponse type as response, which also includes the variable type.
type CheckResponse = {
type: CheckType
result: boolean
}
This module doesn't strictly consider truthy/falsy values, so if you checks 0 or false, you'll get true as result.
Always use the === operator to check for booleans and 0 or 1, use this module just to exclude the "emptiness" of a value.
This module has the following rules:
null and undefined are always considered empty, as as such the function will return false.number will be false only when the passed value is NaN. 0 will return true instead, as it may be a desired value.function will be considered empty only if it's body is completely empty (comments are stripped away).boolean, symbol and bigint will always return true.string will be considered empty if, after having being trimmed, its length is 0.object will be considered empty if its JSON serialization returns {} or '""' (if it was a wrapper for a primitive type like new String()).FAQs
It checks if a variable is empty or not
The npm package checkvar receives a total of 5 weekly downloads. As such, checkvar popularity was classified as not popular.
We found that checkvar 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.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.

Security News
Socket CEO Feross Aboukhadijeh joins 10 Minutes or Less, a podcast by Ali Rohde, to discuss the recent surge in open source supply chain attacks.

Research
/Security News
Campaign of 108 extensions harvests identities, steals sessions, and adds backdoors to browsers, all tied to the same C2 infrastructure.