Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shinnn/is-vfile-message
Check if a value is a VFileMessage object
https://github.com/shinnn/is-vfile-message
Last synced: 27 days ago
JSON representation
Check if a value is a VFileMessage object
- Host: GitHub
- URL: https://github.com/shinnn/is-vfile-message
- Owner: shinnn
- License: mit
- Created: 2015-11-29T15:42:25.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-29T16:05:00.000Z (almost 9 years ago)
- Last Synced: 2024-04-27T21:05:03.810Z (7 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# is-vfile-message
[![NPM version](https://img.shields.io/npm/v/is-vfile-message.svg)](https://www.npmjs.com/package/is-vfile-message)
[![Bower version](https://img.shields.io/bower/v/is-vfile-message.svg)](https://github.com/shinnn/is-vfile-message/releases)
[![Build Status](https://travis-ci.org/shinnn/is-vfile-message.svg?branch=master)](https://travis-ci.org/shinnn/is-vfile-message)
[![Coverage Status](https://img.shields.io/coveralls/shinnn/is-vfile-message.svg)](https://coveralls.io/github/shinnn/is-vfile-message)
[![devDependency Status](https://david-dm.org/shinnn/is-vfile-message/dev-status.svg)](https://david-dm.org/shinnn/is-vfile-message#info=devDependencies)Check if a value is a [VFileMessage](https://github.com/wooorm/vfile#vfilemessage) object
```javascript
const VFile = require('vfile');
const isVFileMessage = require('is-vfile-message');const file = new VFile();
isVFileMessage(file.warn('error!')); //=> true
```## Installation
### Package managers
#### [npm](https://www.npmjs.com/)
```
npm install is-vfile-message
```#### [bower](http://bower.io/)
```
bower install is-vfile-message
```### Standalone
[Download the script file directly.](https://raw.githubusercontent.com/shinnn/is-vfile-message/master/browser.js)
## API
### isVFileMessage(*value*)
*value*: any value
Return: `Boolean`It returns `true` if the argument is a valid [VFileMessage](https://github.com/wooorm/vfile/blob/500c69c2faa29cc837d6859009ff6b0788690aa9/index.js#L45-L71) object, otherwise `false`.
```javascript
isVFileMessage(new Error()); //=> false
isVFileMessage({name: 'error!'}); //=> false
isVFileMessage(); //=> false
```## License
Copyright (c) 2015 [Shinnosuke Watanabe](https://github.com/shinnn)
Licensed under [the MIT License](./LICENSE).