1 | // |
||
2 | // @SOON: split up into testsass, testjs, testui |
||
3 | // |
||
4 | 1 | var fs = require('fs'); |
|
5 | |||
6 | 1 | module.exports = function(value, config, cb, pl) { |
|
7 | 2 | var data = getPatternSpecs (value, config, pl); |
|
8 | 2 | cb(null, processTree(data)); |
|
9 | } |
||
10 | |||
11 | 1 | module.exports.config = { |
|
12 | verbose: false |
||
13 | } |
||
14 | |||
15 | 1 | module.exports.search = function(items, link) { |
|
16 | 1 | var results = []; |
|
17 | // this => collider |
||
18 | /* results.push({ |
||
19 | name: name, |
||
20 | type: 'sass ' + type, |
||
21 | description: description, |
||
22 | link: link + hash |
||
23 | }); */ |
||
24 | |||
25 | 1 | return results; |
|
26 | } |
||
27 | |||
28 | |||
29 | function getPatternSpecs(value, config, pl) { |
||
30 | 2 | if (!fs.existsSync(value)) return false; |
|
0 ignored issues
–
show
|
|||
31 | //var sourceFile = frontMatter(fs.readFileSync(value).toString()); |
||
32 | 1 | return {}; |
|
33 | } |
||
34 | |||
35 | |||
36 | function processTree(tree) { |
||
37 | |||
38 | // do stuff... |
||
39 | |||
40 | 2 | return tree; //my_stuff; |
|
41 | } |
||
42 | |||
43 |
Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.
Consider:
If you or someone else later decides to put another statement in, only the first statement will be executed.
In this case the statement
b = 42
will always be executed, while the logging statement will be executed conditionally.ensures that the proper code will be executed conditionally no matter how many statements are added or removed.