https://github.com/hugoalh/is-object-plain-es
An ES (JavaScript & TypeScript) module to determine whether the object is plain.
https://github.com/hugoalh/is-object-plain-es
es is javascript js modulejs object plain ts typescript
Last synced: about 1 month ago
JSON representation
An ES (JavaScript & TypeScript) module to determine whether the object is plain.
- Host: GitHub
- URL: https://github.com/hugoalh/is-object-plain-es
- Owner: hugoalh
- License: other
- Created: 2024-03-12T08:40:01.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-25T05:32:06.000Z (7 months ago)
- Last Synced: 2024-10-25T06:20:19.964Z (7 months ago)
- Topics: es, is, javascript, js, modulejs, object, plain, ts, typescript
- Language: TypeScript
- Homepage:
- Size: 84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.cff
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
# Is Object Plain (ES)
[**⚖️** MIT](./LICENSE.md)
[](https://github.com/hugoalh/is-object-plain-es)
[](https://jsr.io/@hugoalh/is-object-plain)
[](https://www.npmjs.com/package/@hugoalh/is-object-plain)An ES (JavaScript & TypeScript) module to determine whether the object is plain.
## 🔰 Begin
### 🎯 Targets
| | **Remote** | **JSR** | **NPM** |
|:--|:--|:--|:--|
| **[Bun](https://bun.sh/)** >= v1.1.0 | ❌ | ❓ | ✔️ |
| **[Cloudflare Workers](https://workers.cloudflare.com/)** | ❌ | ❓ | ✔️ |
| **[Deno](https://deno.land/)** >= v1.42.0 | ✔️ | ✔️ | ✔️ |
| **[NodeJS](https://nodejs.org/)** >= v16.13.0 | ❌ | ❓ | ✔️ |> [!NOTE]
> - It is possible to use this module in other methods/ways which not listed in here, however those methods/ways are not officially supported, and should beware maybe cause security issues.### #️⃣ Resources Identifier
- **Remote - GitHub Raw:**
```
https://raw.githubusercontent.com/hugoalh/is-object-plain-es/{Tag}/mod.ts
```
- **JSR:**
```
[jsr:]@hugoalh/is-object-plain[@{Tag}]
```
- **NPM:**
```
[npm:]@hugoalh/is-object-plain[@{Tag}]
```> [!NOTE]
> - For usage of remote resources, it is recommended to import the entire module with the main path `mod.ts`, however it is also able to import part of the module with sub path if available, but do not import if:
>
> - it's path has an underscore prefix (e.g.: `_foo.ts`, `_util/bar.ts`), or
> - it is a benchmark or test file (e.g.: `foo.bench.ts`, `foo.test.ts`), or
> - it's symbol has an underscore prefix (e.g.: `_bar`, `_foo`).
>
> These elements are not considered part of the public API, thus no stability is guaranteed for them.
> - For usage of JSR or NPM resources, it is recommended to import the entire module with the main entrypoint, however it is also able to import part of the module with sub entrypoint if available, please visit the [file `jsr.jsonc`](./jsr.jsonc) property `exports` for available sub entrypoints.
> - It is recommended to use this module with tag for immutability.### 🛡️ Runtime Permissions
*This module does not request any runtime permission.*
## 🧩 APIs
- ```ts
function isObjectPlain(item: object): boolean;
```> [!NOTE]
> - For the full or prettier documentation, can visit via:
> - [Deno CLI `deno doc`](https://docs.deno.com/runtime/reference/cli/documentation_generator/)
> - [JSR](https://jsr.io/@hugoalh/is-object-plain)## ✍️ Examples
- ```ts
isObjectPlain(new Map([
["a", 1],
["b", 2],
["c", 3]
]));
//=> false
```
- ```ts
isObjectPlain({
a: 1,
b: 2,
c: 3
});
//=> true
```