| Conditions | 2 |
| Paths | 4 |
| Total Lines | 31 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | /** |
||
| 17 | var Util = function (config) { |
||
| 18 | |||
| 19 | /** Constructor */ |
||
| 20 | var ocrConfig; |
||
| 21 | config !== undefined ? ocrConfig = config : console.error('OCR config is not defined.'); |
||
| 22 | |||
| 23 | /** TODO: |
||
| 24 | * Filter file array for files with supported mimetypes and return |
||
| 25 | * the clean array of all input elements with a proper mimetype. |
||
| 26 | * @public |
||
| 27 | * @param {Array<File>} selectedFiles |
||
| 28 | * @returns {Array<File>} |
||
| 29 | */ |
||
| 30 | this.filterFilesWithMimeTypes = function (selectedFiles) { |
||
| 31 | return selectedFiles.filter(function(file){ |
||
| 32 | return ocrConfig.ALLOWED_MIMETYPES.indexOf(file.mimetype) == -1 ? false : true; |
||
| 33 | }); |
||
| 34 | } |
||
| 35 | |||
| 36 | /** Reduce the input array of file elements to only contain the file id. |
||
| 37 | * @public |
||
| 38 | * @param {Array<File>} files |
||
| 39 | * @returns {Array<File>} |
||
| 40 | */ |
||
| 41 | this.shrinkData = function(files) { |
||
| 42 | return files.map(function(file){ |
||
| 43 | return {id: file.id}; |
||
| 44 | }); |
||
| 45 | } |
||
| 46 | |||
| 47 | } |
||
| 48 | |||
| 68 |
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.