Function
hasAllowedFileSyntax
(expectedType, fileSyntax)
Source from the content-addressed store, hash-verified
| 36 | // Checks if a file is of a particular type by regexing the syntax name and |
| 37 | // expecting a pattern. |
| 38 | const hasAllowedFileSyntax = (expectedType, fileSyntax) => { |
| 39 | for (const pattern of (GLOBAL_FILE_RULES[expectedType] || {}).allowed_file_syntaxes || []) { |
| 40 | if (fileSyntax.toLowerCase().includes(pattern)) { |
| 41 | return true; |
| 42 | } |
| 43 | } |
| 44 | return false; |
| 45 | }; |
| 46 | |
| 47 | export const isCSS = () => { |
| 48 | const isSavedFile = ORIGINAL_FILE_PATH !== '?'; |
Tested by
no test coverage detected