is-extendable

中文文档
1.0.1发布于 2017/09/12MITTypeScriptCommonJS近 30 天下载 2.2亿

Returns true if a value is a plain object, array or function.

原始使用文档
文档目录12 节
  1. Install
  2. Usage
  3. Notes
  4. Release history
  5. v1.0.0 - 2017/07/20
  6. About
  7. Related projects
  8. Contributing
  9. Building docs
  10. Running tests
  11. Author
  12. License

is-extendable NPM version NPM monthly downloads NPM total downloads Linux Build Status

Returns true if a value is a plain object, array or function.

Install

Install with npm:

$ npm install --save is-extendable

Usage

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

Returns true if the value is any of the following:

  • array
  • plain object
  • function

Notes

All objects in JavaScript can have keys, but it's a pain to check for this, since we ether need to verify that the value is not null or undefined and:

  • the value is not a primitive, or
  • that the object is a plain object, function or array

Also note that an extendable object is not the same as an extensible object, which is one that (in es6) is not sealed, frozen, or marked as non-extensible using preventExtensions.

Release history

v1.0.0 - 2017/07/20

Breaking changes

  • No longer considers date, regex or error objects to be extendable

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

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

Running tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

Author

Jon Schlinkert

License

Copyright © 2017, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.6.0, on July 20, 2017.

版本与发布记录

is-extendable 共发布 4 个版本,首次发布于 2015/06/29;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.0.1latest2017/09/129 年前
1.0.02017/07/219 年前
0.1.12015/07/0511 年前
0.1.02015/06/2911 年前

关于 is-extendable 的常见问题

is-extendable 是什么?

Returns true if a value is a plain object, array or function.

如何安装 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 和提交记录判断。