| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 年前 | ||
| 11 个月前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 11 个月前 | ||
| 11 个月前 | ||
| 2 年前 | ||
| 11 个月前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 |
is-plain-object
简介
is-plain-object。如果对象是由object构造函数或object .create(null)创建的,则返回true。
下载安装
ohpm install is-plain-object@5.0.0
OpenHarmony ohpm 环境配置等更多内容,请参考 如何安装OpenHarmony ohpm包 。
使用说明
import { isPlainObject } from 'is-plain-object';
isPlainObject(Object.create({}));
//=> true
isPlainObject(Object.create(Object.prototype));
//=> true
isPlainObject({ foo: 'bar' });
//=> true
isPlainObject({});
//=> true
isPlainObject(null);
//=> true
isPlainObject(1);
//=> false
isPlainObject(['foo', 'bar']);
//=> false
isPlainObject([]);
//=> false
isPlainObject(new Foo);
//=> false
isPlainObject(Object.create(null));
//=> false
接口说明
| 接口名 | 入参内容 | 功能简介 |
|---|---|---|
| isPlainObject() | object | 判断普通对象 |
约束与限制
在下述版本验证通过:
- DevEco Studio 版本: 4.1 Canary(4.1.3.317),OpenHarmony SDK:API11 (4.1.0.36)。
目录结构
|---- is_plain_object
| |---- entry # 示例代码文件夹
├── src
├── main
├── ets
├── pages
├── Index.ets sample代码
| |---- README.md # 安装使用方法
| |---- README_zh.md # 安装使用方法
贡献代码
使用过程中发现任何问题都可以提 Issue 给我们,当然,我们也非常欢迎你给我们发 PR 。
开源协议
本项目基于 MIT ,请自由地享受和参与开源。