bb-drummer /
node-patternlibrary
| 1 | 1 | var extend = require('extend'); |
|
| 2 | |||
| 3 | /** |
||
| 4 | * Assembles generic/default data for templates to render... |
||
| 5 | * |
||
| 6 | * in templates/partials the key: value pair are accessible template variables `{{key}}` |
||
| 7 | * |
||
| 8 | * @param {object} data |
||
| 9 | * @param {object} opts |
||
| 10 | * @returns |
||
| 11 | */ |
||
| 12 | function renderData ( data, opts ) { |
||
|
0 ignored issues
–
show
|
|||
| 13 | |||
| 14 | 25 | return extend( {}, this.data, { |
|
| 15 | // templates' -default- key: value pairs here... |
||
| 16 | |||
| 17 | // patternlibrary options |
||
| 18 | options : this.options, |
||
| 19 | |||
| 20 | // list of patterns, while `{{patterns}}` always hold all patterns |
||
| 21 | // `{{patternlist}}` is meant to contain a filtered list of patterns |
||
| 22 | patternlist : this.listpatterns(), |
||
| 23 | |||
| 24 | // list of patterns, while `{{categories}}` always hold all patterns |
||
| 25 | // `{{categorylist}}` is meant to contain a filtered list of patterns |
||
| 26 | categorylist : this.listcategories(), |
||
| 27 | |||
| 28 | // some set of generic patternlibrary statistics |
||
| 29 | stats : this.statistics() |
||
| 30 | |||
| 31 | }, data ); |
||
| 32 | } |
||
| 33 | |||
| 34 | module.exports = renderData; |
This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.