@9fv.io/invalidtype-error 中文文档教程

发布于 7年前 浏览 25 项目主页 更新于 3年前

[圆徽章网址]:https://circleci.com/gh/9fv/node-invalidtype-error/tree/master [ember-observer-badge-url]:http://emberobserver.com/addons/node-invalidtype-error

node-invalidtype-error

抛出“无效类型”错误的异常类。


Warning ! Work in progress…

JavaScript 风格指南最新的 NPM 版本NPM 下载TravisCI 构建状态测试覆盖率代码气候许可证依赖关系Dev DependenciesGreenkeeper 徽章

Table of Contents

Synopsis

抛出“无效类型”错误的异常类。

Usage

const {InvalidTypeError} = require('@9fv.io/invalidtype-error')

function test(o) {
  if (typeof o !== 'object') {
    throw new InvalidTypeError('Provided paramater must be an object!')
  }
}

test('string') // throw an error of type {InvalidTypeError}.

Installation

npm install @9fv.io/invalidtype-error

API Reference

请参考API文档

Tests

Run unit tests

npm test

Build

Build documentation

小心! 文档(READMEAPI) 是使用模板生成的。 请修改来自相关模板的文档。

然后您可以使用以下命令构建文档:

npm run docs

或:

gulp docs

Compatibility

Node

Tested using 节点 9.5.0

Browser

目前未经测试。

Issues

随时提交问题和增强请求。

Contributing

请参考项目的风格指南和提交补丁和添加的指南。 通常,我们遵循“fork-and-pull”Git 工作流程。

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

注意:在发出拉取请求之前,一定要合并来自“上游”的最新版本!

Credits

History

请参考变更日志文件

License

>

MIT 许可证

版权所有 (c) 2018 SAS 9 Février

特此免费向任何获得副本的人授予许可 本软件和相关文档文件(“软件”),处理 在软件中不受限制,包括但不限于权利 使用、复制、修改、合并、发布、分发、再许可和/或出售 该软件的副本,并允许该软件是 提供这样做,但须满足以下条件:

上述版权声明和本许可声明应包含在所有 软件的副本或重要部分。

本软件“按原样”提供,不提供任何形式的明示或保证 暗示的,包括但不限于适销性保证, 适用于特定目的和非侵权。 在任何情况下都不得 作者或版权持有人对任何索赔、损害或其他 责任,无论是在合同、侵权或其他方面的行为中,由以下原因引起, 出于或与软件或使用或其他交易有关 软件。

[circle-badge-url]: https://circleci.com/gh/9fv/node-invalidtype-error/tree/master [ember-observer-badge-url]: http://emberobserver.com/addons/node-invalidtype-error

node-invalidtype-error

An exception class to throw 'invalid type' errors.


🍎 Warning ! Work in progress…

JavaScript Style GuideLatest NPM releaseNPM DownloadsTravisCI Build StatusTest CoverageCode ClimateLicenseDependenciesDev DependenciesGreenkeeper badge

Table of Contents

Synopsis

An exception class to throw 'invalid type' errors.

Usage

const {InvalidTypeError} = require('@9fv.io/invalidtype-error')

function test(o) {
  if (typeof o !== 'object') {
    throw new InvalidTypeError('Provided paramater must be an object!')
  }
}

test('string') // throw an error of type {InvalidTypeError}.

Installation

npm install @9fv.io/invalidtype-error

API Reference

Please refer to API documentation.

Tests

Run unit tests

npm test

Build

Build documentation

Be careful! Documentation (README and API) is generated using templates. Please only modify documentation from related templates.

Then you can build documentation using the following command:

npm run docs

or:

gulp docs

Compatibility

Node

Tested using Node 9.5.0.

Browser

Untested at this time.

Issues

Feel free to submit issues and enhancement requests.

Contributing

Please refer to project's style guidelines and guidelines for submitting patches and additions. In general, we follow the "fork-and-pull" Git workflow.

  1. Fork the repo on GitHub
  2. Clone the project to your own machine
  3. Commit changes to your own branch
  4. Push your work back up to your fork
  5. Submit a Pull request so that we can review your changes

NOTE: Be sure to merge the latest from "upstream" before making a pull request!

Credits

History

Please refer to the changelog file.

License

>

The MIT License

Copyright (c) 2018 SAS 9 Février

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文