• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gulpjs / fs-mkdirp-stream / 4710000998

pending completion
4710000998

push

github

GitHub
chore: Normalize repository (#21)

40 of 40 branches covered (100.0%)

Branch coverage included in aggregate %.

65 of 65 relevant lines covered (100.0%)

259.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/index.js
1
'use strict';
2

3
var Transform = require('streamx').Transform;
12✔
4

5
var mkdirp = require('./mkdirp');
12✔
6

7
function toFunction(dirpath) {
8
  function stringResolver(chunk, callback) {
9
    callback(null, dirpath);
72✔
10
  }
11

12
  return stringResolver;
72✔
13
}
14

15
function mkdirpStream(resolver) {
16
  // Handle resolver that's just a dirpath
17
  if (typeof resolver === 'string') {
204✔
18
    resolver = toFunction(resolver);
72✔
19
  }
20

21
  return new Transform({
204✔
22
    transform: function (chunk, callback) {
23
      resolver(chunk, onDirpath);
204✔
24

25
      function onDirpath(dirpathErr, dirpath, mode) {
26
        if (dirpathErr) {
204✔
27
          return callback(dirpathErr);
36✔
28
        }
29

30
        mkdirp(dirpath, mode, onMkdirp);
168✔
31
      }
32

33
      function onMkdirp(mkdirpErr) {
34
        if (mkdirpErr) {
168✔
35
          return callback(mkdirpErr);
36✔
36
        }
37

38
        callback(null, chunk);
132✔
39
      }
40
    },
41
  });
42
}
43

44
module.exports = mkdirpStream;
12✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc