MCPcopy
hub / github.com/bower/bower / validLink

Function validLink

lib/util/validLink.js:4–20  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

2var fs = require('./fs');
3
4function validLink(file) {
5 // Ensures that a file is a symlink that points
6 // to a valid file
7 return Q.nfcall(fs.lstat, file)
8 .then(function(lstat) {
9 if (!lstat.isSymbolicLink()) {
10 return [false];
11 }
12
13 return Q.nfcall(fs.stat, file).then(function(stat) {
14 return [stat];
15 });
16 })
17 .fail(function(err) {
18 return [false, err];
19 });
20}
21
22module.exports = validLink;

Callers 1

Project.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…