shinnn / is-vfile-message

Check if a value is a VFileMessage object
MIT License
1 stars 0 forks source link

is-vfile-message

NPM version Bower version Build Status Coverage Status devDependency Status

Check if a value is a VFileMessage object

const VFile = require('vfile');
const isVFileMessage = require('is-vfile-message');

const file = new VFile();

isVFileMessage(file.warn('error!')); //=> true

Installation

Package managers

npm

npm install is-vfile-message

bower

bower install is-vfile-message

Standalone

Download the script file directly.

API

isVFileMessage(value)

value: any value
Return: Boolean

It returns true if the argument is a valid VFileMessage object, otherwise false.

isVFileMessage(new Error()); //=> false
isVFileMessage({name: 'error!'}); //=> false
isVFileMessage(); //=> false

License

Copyright (c) 2015 Shinnosuke Watanabe

Licensed under the MIT License.