Skip to content

Commit

Permalink
Docs: Add Vinyl.isVinyl() documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
janiceilene authored and phated committed Oct 19, 2018
1 parent fc09067 commit 25a22bf
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions docs/api/vinyl-isvinyl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!-- front-matter
id: api-vinyl-isvinyl
title: Vinyl.isVinyl()
hide_title: true
sidebar_label: Vinyl.isVinyl()
-->

# 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.

0 comments on commit 25a22bf

Please sign in to comment.