Conditions | 8 |
Paths | 17 |
Total Lines | 31 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | 'use strict' |
||
8 | Module.getManifest(function (manifest) { |
||
9 | var options = manifest.getDevOption('autoreload') |
||
10 | if (!options || !('paths' in options)) { |
||
11 | return |
||
12 | } |
||
13 | if (typeof options.paths === 'string') { |
||
14 | options.paths = [options.paths] |
||
15 | } |
||
16 | |||
17 | var matched = false |
||
18 | for (var i in options.paths) { |
||
19 | if (!options.paths.hasOwnProperty(i)) { |
||
20 | continue |
||
21 | } |
||
22 | if (minimatch(path, options.paths[i])) { |
||
23 | matched = true |
||
24 | break |
||
25 | } |
||
26 | } |
||
27 | |||
28 | if (!matched) { |
||
29 | return |
||
30 | } |
||
31 | |||
32 | Socket.emit('passthrough', { |
||
33 | plugin: 'autoreload', |
||
34 | data: { |
||
35 | path: path |
||
36 | } |
||
37 | }) |
||
38 | }) |
||
39 | } |
||
40 |