{"name":"@phun-ky/typeof","version":"3.0.2","keywords":["types","string","number","object","javascript","typeof","isString","isNotString","isNumber","isNotNumber","isBoolean","isNotBoolean","isUndefined","isNotUndefined","isDefined","isObjectStrict","isObjectLoose","isClass","isBuiltInConstructor","isBuiltInCallable","isInstanceOfUnknownClass"],"author":{"name":"Alexander Vassbotn Røyne-Helgesen","email":"alexander@phun-ky.net"},"license":"MIT","_id":"@phun-ky/typeof@3.0.2","maintainers":[{"name":"phun-ky","email":"alexander+npmjs.com@phun-ky.net"}],"homepage":"https://phun-ky.net/projects/typeof","bugs":{"url":"https://github.com/phun-ky/typeof/issues"},"dist":{"shasum":"caecf82d43ccea8a8f18d945c7f960e15495c2bb","tarball":"http://registry-npm.ywwl.com/@phun-ky/typeof/download/@phun-ky/typeof-3.0.2.tgz","fileCount":6,"integrity":"sha512-xSVAxATw9q9PXg/KGnqRyUz4VJKWNBpViBjG/7PJ4cb4HAjVlhYFstDYLlws8KLUFXVl3TtbJ6/VcEnuATl/nw==","signatures":[{"sig":"MEUCIQCQG60oinglk2AlqKDL7o9MYGO8UOnGZktULT3ISAhRawIgX2ZDQH7JOd07OV5X52J8/hQEKKaqfLsWNba6gAzxKQQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@phun-ky%2ftypeof@3.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":56390,"size":11266,"noattachment":false,"key":"/@phun-ky/typeof/-/@phun-ky/typeof-3.0.2.tgz"},"main":"dist/typeof.js","type":"module","types":"dist/typeof.d.ts","config":{"commitizen":{"path":"./node_modules/git-cz"}},"engines":{"npm":">=11.0.0","node":">=22.9.0"},"funding":"https://github.com/phun-ky/typeof?sponsor=1","gitHead":"1222226d9b0896ffcb65cabcea6b06501d849051","scripts":{"test":"glob-bin -c \"node --import tsx --import global-jsdom/register --test --no-warnings\" \"./src/**/__tests__/**/*.[jt]s\"","build":"npm run clean && npm run rollup","clean":"rm -rf dist dts","commit":"npx git-cz","rollup":"rollup -c","release":"npx release-it --ci","test:ci":"glob-bin -c \"node --import tsx --import global-jsdom/register --test --no-warnings --experimental-test-coverage --test-reporter=cobertura --test-reporter-destination=coverage/cobertura-coverage.xml --test-reporter=spec --test-reporter-destination=stdout\" \"./src/**/__tests__/**/*.[jt]s\"","docs:gen":"node ./node_modules/.bin/typedoc","pretest:ci":"rm -rf coverage && mkdir -p coverage","rollup:dev":"rollup -c -w","style:code":"npx putout src","style:lint":"eslint -c ./eslint.config.mjs src/**/*.ts --no-warn-ignored && ./node_modules/.bin/prettier --check src","style:format":"eslint -c ./eslint.config.mjs src/**/*.ts  --fix --no-warn-ignored && ./node_modules/.bin/prettier --write ./eslint.config.mjs src","prerollup:dev":"npm run clean"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0164c115-5845-4e92-b4be-2745e7b9e3b9"}},"repository":{"url":"git+https://github.com/phun-ky/typeof.git","type":"git"},"_npmVersion":"11.15.0","description":"A set of JavaScript helper functions to check for types","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.1","jsdom":"^29.0.2","tslib":"^2.3.1","eslint":"^10.0.0","git-cz":"^4.9.0","putout":"^42.0.13","rollup":"^4.12.0","quibble":"^0.9.1","typedoc":"^0.28.2","glob-bin":"^1.0.0","prettier":"^3.8.0","cobertura":"^1.0.1","release-it":"^20.0.1","remark-toc":"^9.0.0","typescript":"^6.0.2","@types/node":"^25.2.1","global-jsdom":"^29.0.0","remark-github":"^12.0.0","unified-prettier":"^2.0.1","rollup-plugin-dts":"^6.1.0","@testing-library/dom":"^10.4.0","@rollup/plugin-terser":"^1.0.0","eslint-config-phun-ky":"^2.0.0","typedoc-plugin-remark":"^2.0.0","typedoc-plugin-markdown":"^4.2.3","typedoc-plugin-mdn-links":"^5.0.1","@testing-library/jest-dom":"^6.4.2","rollup-plugin-typescript2":"^0.37.0","typedoc-plugin-no-inherit":"^1.4.0","typedoc-plugin-frontmatter":"^1.0.0","@rollup/plugin-node-resolve":"^16.0.1","typedoc-plugin-rename-defaults":"^0.7.1","@release-it/conventional-changelog":"^11.0.0"},"_npmOperationalInternal":{"tmp":"tmp/typeof_3.0.2_1779778359906_0.9952461889405988","host":"s3://npm-registry-packages-npm-production"},"readme":"# @phun-ky/typeof\n\n[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg)](http://makeapullrequest.com) [![SemVer 2.0](https://img.shields.io/badge/SemVer-2.0-green.svg)](http://semver.org/spec/v2.0.0.html) ![npm version](https://img.shields.io/npm/v/@phun-ky/typeof) ![issues](https://img.shields.io/github/issues/phun-ky/typeof) ![license](https://img.shields.io/npm/l/@phun-ky/typeof) ![size](https://img.shields.io/bundlephobia/min/@phun-ky/typeof) ![npm](https://img.shields.io/npm/dm/%40phun-ky/typeof) ![GitHub Repo stars](https://img.shields.io/github/stars/phun-ky/typeof) [![codecov](https://codecov.io/gh/phun-ky/typeof/graph/badge.svg?token=VA91DL7ZLZ)](https://codecov.io/gh/phun-ky/typeof) [![build](https://github.com/phun-ky/typeof/actions/workflows/check.yml/badge.svg)](https://github.com/phun-ky/typeof/actions/workflows/check.yml)\n\n## About\n\nA set of JavaScript helper functions to check for types.\n\n## Table of Contents<!-- omit from toc -->\n\n- [@phun-ky/typeof](#phun-kytypeof)\n  - [About](#about)\n  - [Installation](#installation)\n  - [Usage](#usage)\n  - [API](#api)\n    - [isBoolean()](#isboolean)\n    - [isBuiltInCallable()](#isbuiltincallable)\n    - [isBuiltInConstructor()](#isbuiltinconstructor)\n    - [isClass()](#isclass)\n    - [isDefined()](#isdefined)\n    - [isFunction()](#isfunction)\n    - [isInstanceOfUnknownClass()](#isinstanceofunknownclass)\n    - [isNotBoolean()](#isnotboolean)\n    - [isNotNumber()](#isnotnumber)\n    - [isNotString()](#isnotstring)\n    - [isNotUndefined()](#isnotundefined)\n    - [isNumber()](#isnumber)\n    - [isObjectLoose()](#isobjectloose)\n    - [isObjectPlain()](#isobjectplain)\n    - [isObjectStrict()](#isobjectstrict)\n    - [isString()](#isstring)\n    - [isUndefined()](#isundefined)\n  - [Development](#development)\n  - [Contributing](#contributing)\n  - [License](#license)\n  - [Changelog](#changelog)\n  - [Sponsor me](#sponsor-me)\n\n## Installation\n\n```shell-session\nnpm i --save @phun-ky/typeof\n```\n\n## Usage\n\nEither import and run the required functions:\n\n```javascript\nimport { isString } from '@phun-ky/typeof';\n\nisString('asd'); // true;\n```\n\n## API\n\n### isBoolean()\n\nChecks if the given value is a boolean.\n\n#### Param\n\nThe value to check.\n\n#### Call Signature\n\n```ts\nfunction isBoolean(value): value is boolean;\n```\n\nDefined in: [main.ts:85](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L85)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`value is boolean`\n\n#### Call Signature\n\n```ts\nfunction isBoolean(value): boolean;\n```\n\nDefined in: [main.ts:90](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L90)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n### isBuiltInCallable()\n\nChecks if a given value is a **built-in JavaScript callable**.\n\nA built-in callable is either:\n\n- a standard **constructor** (e.g., `Object`, `Array`, `Date`, `Map`), or\n- a callable **non-constructable** built-in (`BigInt`, `Symbol`).\n\nThis function first verifies the value is a function, then tests identity\nagainst a curated set of built-ins.\n\nOverloads:\n\n- **Predicate:** narrows the value to `BuiltInCallable` on success.\n- **Boolean:** usable in contexts that require a plain `(v) => boolean`.\n\n#### Param\n\nThe value to check.\n\n#### Example\n\n```ts\nisBuiltInCallable(Object); // true\nisBuiltInCallable(Array); // true\nisBuiltInCallable(BigInt); // true (callable but not a constructor)\nisBuiltInCallable(Symbol); // true (callable but not a constructor)\nisBuiltInCallable(class X {}); // false\nisBuiltInCallable(() => {}); // false\nisBuiltInCallable(123); // false\n\n// Type narrowing:\ndeclare const fn: unknown;\nif (isBuiltInCallable(fn)) {\n  // fn is now typed as BuiltInCallable\n  console.log(fn.name);\n}\n```\n\n#### See\n\n- <https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global\\_Objects>\n- <https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global\\_Objects/BigInt>\n- <https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global\\_Objects/Symbol>\n\n#### Call Signature\n\n```ts\nfunction isBuiltInCallable(value): value is BuiltInCallable;\n```\n\nDefined in: [main.ts:541](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L541)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`value is BuiltInCallable`\n\n#### Call Signature\n\n```ts\nfunction isBuiltInCallable(value): boolean;\n```\n\nDefined in: [main.ts:546](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L546)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n### isBuiltInConstructor()\n\nChecks if a given value is a built-in JavaScript constructor.\n\nThis function verifies whether the provided value is a function and matches\none of JavaScript's built-in constructors, such as `Object`, `Array`, `Function`, etc.\n\n#### Param\n\nThe value to check.\n\n#### Example\n\n```ts\nconsole.log(isBuiltInConstructor(Object)); // Output: true\nconsole.log(isBuiltInConstructor(Array)); // Output: true\nconsole.log(isBuiltInConstructor(class MyClass {})); // Output: false\nconsole.log(isBuiltInConstructor(() => {})); // Output: false\nconsole.log(isBuiltInConstructor(123)); // Output: false\n```\n\n#### Call Signature\n\n```ts\nfunction isBuiltInConstructor(value): value is BuiltInConstructor;\n```\n\nDefined in: [main.ts:441](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L441)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`value is BuiltInConstructor`\n\n#### Call Signature\n\n```ts\nfunction isBuiltInConstructor(value): boolean;\n```\n\nDefined in: [main.ts:448](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L448)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n### isClass()\n\nChecks if a given value is a class constructor.\n\nThis function determines whether the provided value is a class by verifying\nif it is a function and checking its prototype descriptor. Class constructors\nalways have a non-writable prototype, while regular functions do not.\n\nWill always return false on built in constructors like `Date` or `Array`.\n\n#### Param\n\nThe value to check.\n\n#### Example\n\n```ts\nclass MyClass {}\nconsole.log(isClass(MyClass)); // Output: true\n\nfunction regularFunction() {}\nconsole.log(isClass(regularFunction)); // Output: false\n\nconsole.log(isClass(() => {})); // Output: false\nconsole.log(isClass(null)); // Output: false\n```\n\n#### Call Signature\n\n```ts\nfunction isClass(value): value is ClassCtor<any>;\n```\n\nDefined in: [main.ts:366](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L366)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`value is ClassCtor<any>`\n\n#### Call Signature\n\n```ts\nfunction isClass(value): boolean;\n```\n\nDefined in: [main.ts:371](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L371)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n### isDefined()\n\nCopy of `isNotUndefined`\n\n#### Param\n\nThe value to check.\n\n#### Call Signature\n\n```ts\nfunction isDefined<T>(value): value is Exclude<T, undefined>;\n```\n\nDefined in: [main.ts:166](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L166)\n\n##### Type Parameters\n\n| Type Parameter |\n| -------------- |\n| `T`            |\n\n##### Parameters\n\n| Parameter | Type |\n| --------- | ---- |\n| `value`   | `T`  |\n\n##### Returns\n\n`value is Exclude<T, undefined>`\n\n#### Call Signature\n\n```ts\nfunction isDefined(value): boolean;\n```\n\nDefined in: [main.ts:171](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L171)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n### isFunction()\n\nChecks if the given value is a function.\n\n#### Param\n\nThe value to check.\n\n#### Call Signature\n\n```ts\nfunction isFunction(value): value is (args: unknown[]) => unknown;\n```\n\nDefined in: [main.ts:635](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L635)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`value is (args: unknown[]) => unknown`\n\n#### Call Signature\n\n```ts\nfunction isFunction(value): boolean;\n```\n\nDefined in: [main.ts:642](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L642)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n### isInstanceOfUnknownClass()\n\nChecks if a given value is an instance of a non-standard (unknown) class.\n\nThis function determines whether the provided value is an object and has a prototype\nthat is neither `Object.prototype` (standard object) nor `null` (no prototype).\nIt helps differentiate between instances of custom classes and plain objects.\n\n#### Param\n\nThe value to check.\n\n#### Example\n\n```ts\nclass MyClass {}\nconsole.log(isInstanceOfUnknownClass(new MyClass())); // Output: true\nconsole.log(isInstanceOfUnknownClass({})); // Output: false\nconsole.log(isInstanceOfUnknownClass(Object.create(null))); // Output: false\nconsole.log(isInstanceOfUnknownClass([])); // Output: true\n```\n\n#### Call Signature\n\n```ts\nfunction isInstanceOfUnknownClass(value): value is object;\n```\n\nDefined in: [main.ts:597](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L597)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`value is object`\n\n#### Call Signature\n\n```ts\nfunction isInstanceOfUnknownClass(value): boolean;\n```\n\nDefined in: [main.ts:602](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L602)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n### isNotBoolean()\n\nChecks if the given value is not a boolean.\n\n#### Param\n\nThe value to check.\n\n#### Call Signature\n\n```ts\nfunction isNotBoolean<T>(value): value is Exclude<T, boolean>;\n```\n\nDefined in: [main.ts:105](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L105)\n\n##### Type Parameters\n\n| Type Parameter |\n| -------------- |\n| `T`            |\n\n##### Parameters\n\n| Parameter | Type |\n| --------- | ---- |\n| `value`   | `T`  |\n\n##### Returns\n\n`value is Exclude<T, boolean>`\n\n#### Call Signature\n\n```ts\nfunction isNotBoolean(value): boolean;\n```\n\nDefined in: [main.ts:110](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L110)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n### isNotNumber()\n\nChecks if the given value is not a number.\n\n#### Param\n\nThe value to check.\n\n#### Call Signature\n\n```ts\nfunction isNotNumber<T>(value): value is Exclude<T, number>;\n```\n\nDefined in: [main.ts:65](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L65)\n\n##### Type Parameters\n\n| Type Parameter |\n| -------------- |\n| `T`            |\n\n##### Parameters\n\n| Parameter | Type |\n| --------- | ---- |\n| `value`   | `T`  |\n\n##### Returns\n\n`value is Exclude<T, number>`\n\n#### Call Signature\n\n```ts\nfunction isNotNumber(value): boolean;\n```\n\nDefined in: [main.ts:70](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L70)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n### isNotString()\n\nChecks if the given value is not a string.\n\n#### Param\n\nThe value to check.\n\n#### Call Signature\n\n```ts\nfunction isNotString<T>(value): value is Exclude<T, string>;\n```\n\nDefined in: [main.ts:25](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L25)\n\n##### Type Parameters\n\n| Type Parameter |\n| -------------- |\n| `T`            |\n\n##### Parameters\n\n| Parameter | Type |\n| --------- | ---- |\n| `value`   | `T`  |\n\n##### Returns\n\n`value is Exclude<T, string>`\n\n#### Call Signature\n\n```ts\nfunction isNotString(value): boolean;\n```\n\nDefined in: [main.ts:30](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L30)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n### isNotUndefined()\n\nChecks if the given value is not undefined.\n\n#### Param\n\nThe value to check.\n\n#### Call Signature\n\n```ts\nfunction isNotUndefined<T>(value): value is Exclude<T, undefined>;\n```\n\nDefined in: [main.ts:145](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L145)\n\n##### Type Parameters\n\n| Type Parameter |\n| -------------- |\n| `T`            |\n\n##### Parameters\n\n| Parameter | Type |\n| --------- | ---- |\n| `value`   | `T`  |\n\n##### Returns\n\n`value is Exclude<T, undefined>`\n\n#### Call Signature\n\n```ts\nfunction isNotUndefined(value): boolean;\n```\n\nDefined in: [main.ts:150](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L150)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n### isNumber()\n\nChecks if the given value is a number.\n\n#### Param\n\nThe value to check.\n\n#### Call Signature\n\n```ts\nfunction isNumber(value): value is number;\n```\n\nDefined in: [main.ts:45](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L45)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`value is number`\n\n#### Call Signature\n\n```ts\nfunction isNumber(value): boolean;\n```\n\nDefined in: [main.ts:50](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L50)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n### isObjectLoose()\n\nChecks if a given value is an object or a function.\n\nThis function verifies whether the provided value is of type `'object'` or `'function'`\nwhile ensuring that `null` is excluded.\n\n#### Param\n\nThe value to check.\n\n#### Example\n\n```ts\nconsole.log(isObjectLoose({})); // Output: true\nconsole.log(isObjectLoose([])); // Output: true\nconsole.log(isObjectLoose(() => {})); // Output: true\nconsole.log(isObjectLoose(null)); // Output: false\nconsole.log(isObjectLoose(42)); // Output: false\n```\n\n**Features**\n\n- ✅ Recognizes **all objects** (plain objects, arrays, functions, dates, etc.).\n- ✅ Recognizes **functions** as objects (since functions are technically objects in JavaScript).\n- ❌ Does **not** differentiate between plain objects and special objects (like arrays, functions, DOM nodes, etc.).\n\n**Behavior**\n\n- ✅ `isObjectLoose({})` → `true`\n- ✅ `isObjectLoose([])` → `true`\n- ✅ `isObjectLoose(() => {})` → `true`\n- ❌ `isObjectLoose(null)` → `false`\n\n**When to use**\n\n- Use `isObjectStrict` when you need a **strict check for plain objects**.\n- Use `isObjectLoose` if you need to check if a value is an **object-like structure**, including functions.\n\n**Comparison**\n\n| Feature                                  | Strict Check (`isObjectStrict`) | Loose Check (`isObjectLoose`) |\n| ---------------------------------------- | ------------------------------- | ----------------------------- |\n| Recognizes plain objects                 | ✅ Yes                           | ✅ Yes                         |\n| Recognizes functions                     | ❌ No                            | ✅ Yes                         |\n| Recognizes arrays                        | ❌ No                            | ✅ Yes                         |\n| Recognizes `Object.create(null)` objects | ✅ Yes                           | ✅ Yes                         |\n| Recognizes class instances               | ❌ No                            | ✅ Yes                         |\n| Recognizes DOM elements                  | ❌ No                            | ✅ Yes                         |\n| Complexity                               | 🔴 High                          | 🟢 Low                         |\n\n#### Call Signature\n\n```ts\nfunction isObjectLoose(value): value is object;\n```\n\nDefined in: [main.ts:303](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L303)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`value is object`\n\n#### Call Signature\n\n```ts\nfunction isObjectLoose(value): boolean;\n```\n\nDefined in: [main.ts:308](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L308)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n### isObjectPlain()\n\nDetermines whether a value is a plain object (i.e., created via an object literal,\n`Object.create(null)`, or with `Object` as its prototype).\n\nThis excludes arrays, functions, class instances, built-ins like `Date`/`Map`/`Set`,\nand other exotic objects.\n\n#### Param\n\nThe value to test.\n\n#### Example\n\n```ts\nconst a: unknown = { x: 1 };\nconst b: unknown = [];\nconst c: unknown = new Date();\nconst d: unknown = Object.create(null);\n\nisObjectPlain(a); // true\nisObjectPlain(b); // false (array)\nisObjectPlain(c); // false (built-in)\nisObjectPlain(d); // true (null prototype)\n\n// Type narrowing example:\nconst value: unknown = { foo: 42 };\nif (isObjectPlain(value)) {\n  // value is now Record<string, unknown>\n  console.log(value.foo);\n}\n```\n\n#### See\n\n- <https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global\\_Objects/Object/toString>\n- <https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global\\_Objects/Object/getPrototypeOf>\n\n#### Call Signature\n\n```ts\nfunction isObjectPlain(value): value is Record<string, unknown>;\n```\n\nDefined in: [main.ts:187](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L187)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`value is Record<string, unknown>`\n\n#### Call Signature\n\n```ts\nfunction isObjectPlain(value): boolean;\n```\n\nDefined in: [main.ts:192](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L192)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n### isObjectStrict()\n\nChecks if a given value is a plain object.\n\nA plain object is an object created by the `{}` syntax, `Object.create(null)`,\nor using `new Object()`. This function ensures that the value is an object\nand does not have an unusual prototype chain.\n\n#### Param\n\nThe value to check.\n\n#### Example\n\n```ts\nconsole.log(isObjectStrict({})); // Output: true\nconsole.log(isObjectStrict(Object.create(null))); // Output: true\nconsole.log(isObjectStrict([])); // Output: false\nconsole.log(isObjectStrict(new Date())); // Output: false\nconsole.log(isObjectStrict(null)); // Output: false\n```\n\n**Features**\n\n- ✅ Recognizes only **plain objects** (created via `{}`, `new Object()`, `Object.create(null)`, etc.).\n- ❌ Rejects **arrays**, **functions**, **DOM elements**, **class instances**, and **custom objects** with modified constructors.\n\n**Behavior**\n\n- ✅ `isObjectStrict({})` → `true`\n- ❌ `isObjectStrict([])` → `false`\n- ❌ `isObjectStrict(() => {})` → `false`\n- ✅ `isObjectStrict(Object.create(null))` → `true`\n\n**When to use**\n\n- Use `isObjectStrict` when you need a **strict check for plain objects**.\n- Use `isObjectLoose` if you need to check if a value is an **object-like structure**, including functions.\n\n#### Call Signature\n\n```ts\nfunction isObjectStrict(value): value is Record<string, unknown>;\n```\n\nDefined in: [main.ts:238](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L238)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`value is Record<string, unknown>`\n\n#### Call Signature\n\n```ts\nfunction isObjectStrict(value): boolean;\n```\n\nDefined in: [main.ts:245](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L245)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n### isString()\n\nChecks if the given value is a string.\n\n#### Param\n\nThe value to check.\n\n#### Call Signature\n\n```ts\nfunction isString(value): value is string;\n```\n\nDefined in: [main.ts:5](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L5)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`value is string`\n\n#### Call Signature\n\n```ts\nfunction isString(value): boolean;\n```\n\nDefined in: [main.ts:10](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L10)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n### isUndefined()\n\nChecks if the given value is undefined.\n\n#### Param\n\nThe value to check.\n\n#### Call Signature\n\n```ts\nfunction isUndefined(value): value is undefined;\n```\n\nDefined in: [main.ts:125](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L125)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`value is undefined`\n\n#### Call Signature\n\n```ts\nfunction isUndefined(value): boolean;\n```\n\nDefined in: [main.ts:130](https://github.com/phun-ky/typeof/blob/main/src/main.ts#L130)\n\n##### Parameters\n\n| Parameter | Type      |\n| --------- | --------- |\n| `value`   | `unknown` |\n\n##### Returns\n\n`boolean`\n\n---\n\n## Development\n\n```shell-session\n// Build\n$ npm run build\n// Run dev\n$ npm run dev\n// Test\n$ npm test\n```\n\n## Contributing\n\nWant to contribute? Please read the [CONTRIBUTING.md](https://github.com/phun-ky/typeof/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/phun-ky/typeof/blob/main/CODE_OF_CONDUCT.md)\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/phun-ky/typeof/blob/main/LICENSE) file for details.\n\n## Changelog\n\nSee the [CHANGELOG.md](https://github.com/phun-ky/typeof/blob/main/CHANGELOG.md) for details on the latest updates.\n\n## Sponsor me\n\nI'm an Open Source evangelist, creating stuff that does not exist yet to help get rid of secondary activities and to enhance systems already in place, be it documentation or web sites.\n\nThe sponsorship is an unique opportunity to alleviate more hours for me to maintain my projects, create new ones and contribute to the large community we're all part of :)\n\n[Support me on GitHub Sponsors](https://github.com/sponsors/phun-ky).\n\np.s. **Ukraine is still under brutal Russian invasion. A lot of Ukrainian people are hurt, without shelter and need help**. You can help in various ways, for instance, directly helping refugees, spreading awareness, putting pressure on your local government or companies. You can also support Ukraine by donating e.g. to [Red Cross](https://www.icrc.org/en/donate/ukraine), [Ukraine humanitarian organisation](https://savelife.in.ua/en/donate-en/#donate-army-card-weekly) or [donate Ambulances for Ukraine](https://www.gofundme.com/f/help-to-save-the-lives-of-civilians-in-a-war-zone).\n","publish_time":1779778360031,"_cnpm_publish_time":1779778360031,"dist-tags":{"latest":"3.0.10"}}