# is-extendable 中文文档

规范地址：https://npmcn.com/package/is-extendable/

版本：1\.0\.1
npm 元数据更新时间：2023-07-12T19:15:33.987Z
中文译文更新时间：2026-11-05T16:21:52.392Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/is-extendable
原文对照：https://npmcn.com/package/is-extendable/?lang=original
项目主页：https://github.com/jonschlinkert/is-extendable
源码仓库：https://github.com/jonschlinkert/is-extendable

## 关键信息（来自 npm 元数据）

- 模块格式：CommonJS
- TypeScript 类型：包内自带
- Node.js 要求：\>=0\.10\.0
- 运行依赖：1 个
- 首次发布：2015-06-29T03:05:39.042Z
- 最新版本发布：2017-09-11T20:38:26.333Z
- 近 30 天下载量：218933309（2026-10-05 至 2026-11-03，npm 官方下载统计）
- 已发布版本数：4（近 12 个月 0 个）

## 中文简介

如果一个值是普通对象、数组或函数,则返回真值.

## 安装

```sh
npm install is-extendable
```

也可以使用：`pnpm add is-extendable`、`yarn add is-extendable`、`bun add is-extendable`

## README

# 可扩展 [![NPM version](https://img.shields.io/npm/v/is-extendable.svg?style=flat)](https://www.npmjs.com/package/is-extendable) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-extendable.svg?style=flat)](https://npmjs.org/package/is-extendable) [![NPM total downloads](https://img.shields.io/npm/dt/is-extendable.svg?style=flat)](https://npmjs.org/package/is-extendable) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/is-extendable.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/is-extendable)

> 如果一个值是普通对象、数组或函数,则返回真值.

## 安装

安装方式 [无](https://www.npmjs.com/)数字 :

```sh
$ npm install --save is-extendable
```

## 使用量

```js
var isExtendable = require('is-extendable');
```

如果值为下列任何一项,则返回真值:

-   数组
-   普通对象
-   函数

## 页:1

JavaScript 中的所有对象都可以有密钥, 但是检查这个很痛苦, 因为我们需要验证值不是 `null` 或者说 `undefined` 和:

-   数值不是原始的,或者
-   对象是一个普通对象、函数或阵列

还注意到 `extendable` 对象与 [可扩展对象](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible),即(在es6中)没有被封存、被冻结或标记为不可扩展的 `preventExtensions`。 。 。 .

## 发布历史

### v1.0.0 - 2017/07/20 (英语)

**中断更改**

-   不再考虑日期、正则ex或出错对象可扩展

## 关于

### 相关项目

-   [指派深](https://www.npmjs.com/package/assign-deep): 将源对象的可假定属性和/或 es6 符号正性深入指定给目标 [更多](https://github.com/jonschlinkert/assign-deep) | [主页](https://github.com/jonschlinkert/assign-deep "Deeply assign the enumerable properties and/or es6 Symbol properies of source objects to the target (first) object.")
-   [等宽](https://www.npmjs.com/package/is-equal-shallow): 对两个对象进行浅度比较, 如果密钥或值不同, 则返回虚假 。 [主页](https://github.com/jonschlinkert/is-equal-shallow "Does a shallow comparison of two objects, returning false if the keys or values differ.")
-   [平面对象](https://www.npmjs.com/package/is-plain-object): 如果对象是由 `Object` 建筑师 [主页](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.")
-   [对象](https://www.npmjs.com/package/isobject): 如果值是对象而不是数组或数组为无效,则返回真值 [主页](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.")
-   [类型](https://www.npmjs.com/package/kind-of): 获取一个值的原生类型 。 @ @ info [主页](https://github.com/jonschlinkert/kind-of "Get the native type of a value.")

### 捐款

拉出请求和星星总是受欢迎的. 对于错误和特性请求, [请创建一个问题](https://npmcn.com/issues/new)。 。 。 .

### 大楼文件

_(此工程的 readme.md 由 [动词](https://github.com/verbose/verb-generate-readme)请不要直接编辑读取器。 读取器的任何改动必须在 [动词 md](https://npmcn.com/package/is-extendable/.verb.md) 读取我的模板。 )_

要生成读取, 请运行以下命令 :

```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

### 正在测试

运行和审查单元测试是熟悉图书馆及其API的好办法。 您可以使用以下命令安装依赖性并运行测试:

```sh
$ npm install && npm test
```

### 作者

**乔恩·斯林克特**

-   [千兆克/正弦链路](https://github.com/jonschlinkert)
-   [推特/简斯林克特](https://twitter.com/jonschlinkert)

### 许可证

版权:2017年, [乔恩·斯林克特](https://github.com/jonschlinkert)。 。 。 . 释放 [MIT 许可证](https://npmcn.com/package/is-extendable/LICENSE)。 。 。 .

* * *

_此文件由 [动词基因读取器](https://github.com/verbose/verb-generate-readme), v 6.0,于2017年7月20日查阅._

## 常见问题

### is-extendable 是什么？

如果一个值是普通对象、数组或函数,则返回真值\.

### 如何安装 is-extendable？

在项目目录运行 npm install is-extendable，或使用 pnpm add / yarn add / bun add。

### is-extendable 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### is-extendable 支持 ESM 还是 CommonJS？

以 CommonJS 形式发布，可以直接 require\(\)；在 ES Module 项目中也可以用 import 引入（Node\.js 会把 module\.exports 作为默认导出）。

### is-extendable 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=0\.10\.0。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### is-extendable 可以商用吗？

is-extendable 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### is-extendable 的下载量有多少？

根据 npm 官方下载统计，is-extendable 在 2026/10/05 – 2026/11/03 这 30 天内被下载 218,933,309 次，日均约 7,297,777 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### is-extendable 还在维护吗？

最新版本 1\.0\.1 发布于 2017/09/12（9 年前）；至今共发布 4 个版本，其中过去 12 个月发布了 0 个；首次发布于 2015/06/29。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

