npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@plandek-utils/plain-object

v2.2.0

Published

TypeScript types and predicate `isPlainObject` and `isPlainObjectValue`, which are serializable POJOs.

Readme

@plandek-utils/plain-object

npm version CI Maintainability Test Coverage

TypeScript types and predicate utils isPlainObject and isPlainObjectValue. Also includes fast checks isPlainObjectValueAnObject and `isPlainObjectValueAnArrayOfObjects.

A PlainObject is a POJO where all values are PlainObjectValue.

A PlainObjectValue is one of:

  • null or undefined
  • Finite number (no NaN or Infinite)
  • String
  • Boolean
  • Dayjs
  • Array of PlainObjectValue (or readonly array of PlainObjectValue)
  • PlainObject

Usage

import { isPlainObject, isPlainObjectValue } from "@plandek-utils/plain-object";

isPlainObjectValue(null); // => true
isPlainObjectValue(undefined); // => true
isPlainObjectValue(1); // => true
isPlainObjectValue(Infinite); // => false
isPlainObjectValue(NaN); // => false
isPlainObjectValue("something"); // => true
isPlainObjectValue(true); // => true
isPlainObjectValue(false); // => true
isPlainObjectValue([]); // => true
isPlainObjectValue([1, 2]); // => true
isPlainObjectValue([1, "something", 2]); // => true
isPlainObjectValue([1, "something", [2, 3]]); // => true
isPlainObjectValue(() => "oh no"); // => false
isPlainObjectValue({ a: 1, b: "stuff", c: [1], d: {}, e: { e1: true } }); // => true
isPlainObjectValue({ a: 1, b: "stuff", c: [1], d: {}, e: { e1: () => "oh no" } }); // => false

isPlainObject(null); // => false
isPlainObject(undefined); // => false
isPlainObject(1); // => false
isPlainObject(Infinite); // => false
isPlainObject(NaN); // => false
isPlainObject("something"); // => false
isPlainObject(true); // => false
isPlainObject(false); // => false
isPlainObject([]); // => false
isPlainObject([1, 2]); // => false
isPlainObject([1, "something", 2]); // => false
isPlainObject([1, "something", [2, 3]]); // => false
isPlainObject(() => "oh no"); // => false
isPlainObject({ a: 1, b: "stuff", c: [1], d: {}, e: { e1: true } }); // => true
isPlainObject({ a: 1, b: "stuff", c: [1], d: {}, e: { e1: () => "oh no" } }); // => false

isPlainObject will check exhaustively all values of the given object using zod. This can be slow for large quantities of data. If we already know that the given data is a PlainObjectValue, we can use isPlainObjectValueAnObject or isPlainObjectValueAnArrayOfObjects to check if the value is an object or an array of objects respectively.

import { isPlainObjectValueAnObject, isPlainObjectValueAnArrayOfObjects } from "@plandek-utils/plain-object";

isPlainObjectValueAnObject({ a: 1, b: "stuff", c: [1], d: {}, e: { e1: true } }); // => true
isPlainObjectValueAnArrayOfObjects([{ a: 1, b: "stuff", c: [1], d: {}, e: { e1: true } }]); // => true

Development

TypeScript types and predicate isPlainObject and isPlainObjectValue. PlainObject = POJO where all values are PlainObjectValue. PlainObjectValue = serializable value (Dayjs, nil, number, string, boolean, PlainObjectValue[], PlainObject)