Skip to content

Commit

Permalink
Docs: Improve isDirectory & add isSymbolic docs (closes #104)
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Sep 27, 2016
1 parent 3af8f01 commit df9e6ff
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,16 @@ Returns true if file is a directory. File is considered a directory when:
- `file.stat` is an object
- `file.stat.isDirectory()` returns `true`

When constructing a Vinyl object, pass in a valid `fs.Stats` object via `options.stat`. Some operations in Vinyl might need to know the file is a directory from the get go. If you are mocking the `fs.Stats` object, ensure it has the `isDirectory()` method.
When constructing a Vinyl object, pass in a valid `fs.Stats` object via `options.stat`. If you are mocking the `fs.Stats` object, you may need to stub the `isDirectory()` method.

### isSymbolic()
Returns true if file is a symbolic link. File is considered symbolic when:

- `file.isNull()` is `true`
- `file.stat` is an object
- `file.stat.isSymbolicLink()` returns `true`

When constructing a Vinyl object, pass in a valid `fs.Stats` object via `options.stat`. If you are mocking the `fs.Stats` object, you may need to stub the `isSymbolicLink()` method.

### clone([opt])
Returns a new File object with all attributes cloned.<br>By default custom attributes are deep-cloned.
Expand Down

0 comments on commit df9e6ff

Please sign in to comment.