From 25a22bf571c66cbbe279155a1f2f2876b3571162 Mon Sep 17 00:00:00 2001 From: Janice Niemeir Date: Mon, 24 Sep 2018 14:39:37 -0700 Subject: [PATCH] Docs: Add Vinyl.isVinyl() documentation --- docs/api/vinyl-isvinyl.md | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docs/api/vinyl-isvinyl.md diff --git a/docs/api/vinyl-isvinyl.md b/docs/api/vinyl-isvinyl.md new file mode 100644 index 000000000..ab9bf2d07 --- /dev/null +++ b/docs/api/vinyl-isvinyl.md @@ -0,0 +1,41 @@ + + +# Vinyl.isVinyl() + +Determines if an object is a Vinyl instance. Use this method instead of `instanceof`. + +**Note**: This method uses an internal property that some older versions of Vinyl didn't expose resulting in a false negative if using an outdated version. + +## Usage + +```js +const Vinyl = require('vinyl'); + +const file = new Vinyl(); +const notAFile = {}; + +Vinyl.isVinyl(file) === true; +Vinyl.isVinyl(notAFile) === false; +``` + +## Signature + +```js +Vinyl.isVinyl(file); +``` + +### Parameters + +| parameter | type | note | +|:--------------:|:------:|-------| +| file | object | The object to check. | + +### Returns + +True if the `file` object is a Vinyl instance. +