{"_id":"@3-/is_obj","name":"@3-/is_obj","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.1":{"name":"@3-/is_obj","version":"0.1.1","description":"Non-null object validator / 非空对象验证工具","keywords":["check","object","type","validator"],"homepage":"https://github.com/i18n-site/lib/tree/dev/is_obj","license":"MulanPSL-2.0","author":{"name":"i18n.site@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/i18n-site/lib.git"},"type":"module","exports":{".":"./lib.js","./*":"./*"},"scripts":{},"devDependencies":{},"gitHead":"08bbc0c7888710766df029d8b10c1467db002027","_id":"@3-/is_obj@0.1.1","bugs":{"url":"https://github.com/i18n-site/lib/issues"},"_nodeVersion":"26.2.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-daKZFqENdKr7s+qNevNzgd7MMLOjvZCo9K5dMY8y+xFyo4m5bsR+/rJxyGdflPNMk6uTiYlP7ClrHlHfr4rSDg==","shasum":"fa734d2bf5b48ce51c10ab3e99452eeb62d7c0d1","tarball":"https://registry.npmjs.org/@3-/is_obj/-/is_obj-0.1.1.tgz","fileCount":3,"unpackedSize":5031,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHU5xwkfzRMn5ARaEHhcmIbSQCmi8TZej9ApCxeI6jgPAiEA6FHbDBKb2kc0HozGz8ey9UgTpBoiJiz8e82kNTlVdP0="}]},"_npmUser":{"name":"i18n-now","email":"i18n.site@gmail.com"},"directories":{},"maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/is_obj_0.1.1_1780436713583_0.009083363199552608"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-02T21:45:13.418Z","0.1.1":"2026-06-02T21:45:13.710Z","modified":"2026-06-02T21:45:13.959Z"},"maintainers":[{"name":"i18n-now","email":"i18n.site@gmail.com"}],"description":"Non-null object validator / 非空对象验证工具","homepage":"https://github.com/i18n-site/lib/tree/dev/is_obj","keywords":["check","object","type","validator"],"repository":{"type":"git","url":"git+https://github.com/i18n-site/lib.git"},"author":{"name":"i18n.site@gmail.com"},"bugs":{"url":"https://github.com/i18n-site/lib/issues"},"license":"MulanPSL-2.0","readme":"[English](#en) | [中文](#zh)\n\n---\n\n<a id=\"en\"></a>\n# @3-/is_obj : Non-null object validator\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Usage Demo](#usage-demo)\n- [Design & Architecture](#design--architecture)\n- [Directory Structure](#directory-structure)\n- [Tech Stack](#tech-stack)\n- [History & Trivia](#history--trivia)\n\n## Introduction\n\n`@3-/is_obj` checks if value is non-null object.\n\n## Installation\n\nInstall with `bun`:\n\n```bash\nbun i @3-/is_obj\n```\n\n## Usage Demo\n\nImport function, pass value to check:\n\n```javascript\nimport isObj from \"@3-/is_obj\";\n\nisObj({}); // true\nisObj([]); // true\nisObj(null); // false\nisObj(123); // false\n```\n\n## Design & Architecture\n\nThe function checks value truthiness and evaluates `typeof` operator.\n\nEvaluation flow:\n\n```mermaid\ngraph TD\n    A[Input val] --> B{val is truthy?}\n    B -- No --> C[Return false]\n    B -- Yes --> D{typeof val is 'object'?}\n    D -- No --> E[Return false]\n    D -- Yes --> F[Return true]\n```\n\n## Directory Structure\n\n```\n.\n├── src/\n│   └── lib.js      # Core logic\n└── package.json    # Package configuration\n```\n\n## Tech Stack\n\n- **JavaScript (ES Modules)**: Core implementation language.\n- **Bun**: Dependency management.\n\n## History & Trivia\n\nIn JavaScript, `typeof null` returns `\"object\"`. This behavior is a remnant from the first version of JavaScript.\n\nEarly 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`.\n\n`@3-/is_obj` filters out `null` before checking if `typeof` returns `\"object\"`.\n\n---\n\n<a id=\"zh\"></a>\n# @3-/is_obj : 非空对象验证工具\n\n## 目录\n\n- [功能介绍](#功能介绍)\n- [安装](#安装)\n- [使用演示](#使用演示)\n- [设计思路](#设计思路)\n- [目录结构](#目录结构)\n- [技术堆栈](#技术堆栈)\n- [历史小故事](#历史小故事)\n\n## 功能介绍\n\n`@3-/is_obj` 用于判断输入值是否为非空对象。\n\n## 安装\n\n使用 `bun` 安装：\n\n```bash\nbun i @3-/is_obj\n```\n\n## 使用演示\n\n导入函数，传入待检测值：\n\n```javascript\nimport isObj from \"@3-/is_obj\";\n\nisObj({}); // true\nisObj([]); // true\nisObj(null); // false\nisObj(123); // false\n```\n\n## 设计思路\n\n函数首先验证输入值真值属性，随后使用 `typeof` 运算符判定。\n\n判定流程：\n\n```mermaid\ngraph TD\n    A[输入值 val] --> B{val 是否为真值?}\n    B -- 否 --> C[返回 false]\n    B -- 是 --> D{typeof val 是否为 'object'?}\n    D -- 否 --> E[返回 false]\n    D -- 是 --> F[返回 true]\n```\n\n## 目录结构\n\n```\n.\n├── src/\n│   └── lib.js      # 核心逻辑\n└── package.json    # 项目配置\n```\n\n## 技术堆栈\n\n- **JavaScript (ES Modules)**: 核心逻辑语言。\n- **Bun**: 依赖管理。\n\n## 历史小故事\n\n在 JavaScript 中，`typeof null` 返回 `\"object\"`。此现象为早期版本遗留问题。\n\n早期 JavaScript 引擎使用类型标签区分不同数据类型。对象类型标签定义为 `0`。由于 `null` 表示空指针（二进制全为 `0`），导致引擎将 `null` 识别为对象。\n\n`@3-/is_obj` 在验证 `typeof` 前排除 `null` 值，以避免上述问题导致判定失准。\n\n---\n\n## About\n\nThis project is an open-source component of [i18n.site ⋅ Internationalization Solution](https://i18n.site).\n\n* [i18 : MarkDown Command Line Translation Tool](https://i18n.site/i18)\n\n  The translation perfectly maintains the Markdown format.\n\n  It recognizes file changes and only translates the modified files.\n\n  The translated Markdown content is editable; if you modify the original text and translate it again, manually edited translations will not be overwritten (as long as the original text has not been changed).\n\n* [i18n.site : MarkDown Multi-language Static Site Generator](https://i18n.site/i18n.site)\n\n  Optimized for a better reading experience\n\n## 关于\n\n本项目为 [i18n.site ⋅ 国际化解决方案](https://i18n.site) 的开源组件。\n\n* [i18 :  MarkDown命令行翻译工具](https://i18n.site/i18)\n\n  翻译能够完美保持 Markdown 的格式。能识别文件的修改，仅翻译有变动的文件。\n\n  Markdown 翻译内容可编辑；如果你修改原文并再次机器翻译，手动修改过的翻译不会被覆盖（如果这段原文没有被修改）。\n\n* [i18n.site : MarkDown多语言静态站点生成器](https://i18n.site/i18n.site) 为阅读体验而优化。\n","readmeFilename":"README.md","_rev":"1-7bb43ecc8fb613ceb9649c3bf6ebb300"}