* Gets a file from the file manager * @param {string|number} checkFor * @param {"id"|"name"|"uri"} [type] * @returns {File}
(checkFor, type = "id")
| 3006 | * @returns {File} |
| 3007 | */ |
| 3008 | function getFile(checkFor, type = "id") { |
| 3009 | return manager.files.find((file) => { |
| 3010 | switch (type) { |
| 3011 | case "id": |
| 3012 | if (file.id === checkFor) return true; |
| 3013 | return false; |
| 3014 | case "name": |
| 3015 | if (file.filename === checkFor) return true; |
| 3016 | return false; |
| 3017 | case "uri": |
| 3018 | if (file.uri === checkFor) return true; |
| 3019 | return false; |
| 3020 | default: |
| 3021 | return false; |
| 3022 | } |
| 3023 | }); |
| 3024 | } |
| 3025 | |
| 3026 | /** |
| 3027 | * Gets the height of the editor |
nothing calls this directly
no outgoing calls
no test coverage detected