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

@3-/is_obj

v0.1.1

Published

Non-null object validator / 非空对象验证工具

Downloads

87

Readme

English | 中文


@3-/is_obj : Non-null object validator

Table of Contents

Introduction

@3-/is_obj checks if value is non-null object.

Installation

Install with bun:

bun i @3-/is_obj

Usage Demo

Import function, pass value to check:

import isObj from "@3-/is_obj";

isObj({}); // true
isObj([]); // true
isObj(null); // false
isObj(123); // false

Design & Architecture

The function checks value truthiness and evaluates typeof operator.

Evaluation flow:

graph TD
    A[Input val] --> B{val is truthy?}
    B -- No --> C[Return false]
    B -- Yes --> D{typeof val is 'object'?}
    D -- No --> E[Return false]
    D -- Yes --> F[Return true]

Directory Structure

.
├── src/
│   └── lib.js      # Core logic
└── package.json    # Package configuration

Tech Stack

  • JavaScript (ES Modules): Core implementation language.
  • Bun: Dependency management.

History & Trivia

In JavaScript, typeof null returns "object". This behavior is a remnant from the first version of JavaScript.

Early implementations stored values using type tags. The type tag for objects was 0. Because null was represented as the null pointer (all zeros), the engine interpreted the type tag of null as 0.

@3-/is_obj filters out null before checking if typeof returns "object".


@3-/is_obj : 非空对象验证工具

目录

功能介绍

@3-/is_obj 用于判断输入值是否为非空对象。

安装

使用 bun 安装:

bun i @3-/is_obj

使用演示

导入函数,传入待检测值:

import isObj from "@3-/is_obj";

isObj({}); // true
isObj([]); // true
isObj(null); // false
isObj(123); // false

设计思路

函数首先验证输入值真值属性,随后使用 typeof 运算符判定。

判定流程:

graph TD
    A[输入值 val] --> B{val 是否为真值?}
    B -- 否 --> C[返回 false]
    B -- 是 --> D{typeof val 是否为 'object'?}
    D -- 否 --> E[返回 false]
    D -- 是 --> F[返回 true]

目录结构

.
├── src/
│   └── lib.js      # 核心逻辑
└── package.json    # 项目配置

技术堆栈

  • JavaScript (ES Modules): 核心逻辑语言。
  • Bun: 依赖管理。

历史小故事

在 JavaScript 中,typeof null 返回 "object"。此现象为早期版本遗留问题。

早期 JavaScript 引擎使用类型标签区分不同数据类型。对象类型标签定义为 0。由于 null 表示空指针(二进制全为 0),导致引擎将 null 识别为对象。

@3-/is_obj 在验证 typeof 前排除 null 值,以避免上述问题导致判定失准。


About

This project is an open-source component of i18n.site ⋅ Internationalization Solution.

关于

本项目为 i18n.site ⋅ 国际化解决方案 的开源组件。