Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@toolz/is-a-regular-object
Advanced tools
Readme
is-a-regular-object
is a tiny, dead-simple utility function for identifying regular JavaScript objects. In JavaScript, a NULL
will show a typeof
"object". An array will also show a typeof
"object". This function returns TRUE
for non-NULL
, non-array objects - and it returns FALSE
for everything else.
NOTE: This package is for "vanilla" JS. As such, it will identify React elements as being "regular" objects. If you're working in a React project, you should consider using @toolz/is-a-regular-object-react
.
After installation, import the package:
import { isARegularObject } from '@toolz/is-a-regular-object';
const API = {
arguments: {
value: {
required,
format: any,
},
},
returns: Boolean,
}
isARegularObject({}); // true
isARegularObject({one: 'uno', two: 'dos'}); // true
isARegularObject({numbers: [1, 2, 3], letters: ['a', 'b', 'c']}); // true
isARegularObject(null); // false
isARegularObject([]); // false
isARegularObject([1, 2, 3]); // false
isARegularObject(''); // false
isARegularObject('object'); // false
isARegularObject(() => console.log('foo')); // false
FAQs
Utility function for identifying regular JavaScript objects
The npm package @toolz/is-a-regular-object receives a total of 321 weekly downloads. As such, @toolz/is-a-regular-object popularity was classified as not popular.
We found that @toolz/is-a-regular-object 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.