From d82461fecf3912ec9cc9e9d299cb37c4eff4fc2a Mon Sep 17 00:00:00 2001 From: Blaine Bublitz Date: Wed, 7 Sep 2016 14:08:57 -0700 Subject: [PATCH] Docs: Improve isDirectory & add isSymbolic docs (closes #104) --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c80cf91..ef3592d 100644 --- a/README.md +++ b/README.md @@ -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.
By default custom attributes are deep-cloned.