MCPcopy
hub / github.com/victorporof/Sublime-HTMLPrettify / hasAllowedFileSyntax

Function hasAllowedFileSyntax

src/js/utils/fileUtils.js:38–45  ·  view source on GitHub ↗
(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.
38const 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
47export const isCSS = () => {
48 const isSavedFile = ORIGINAL_FILE_PATH !== '?';

Callers 4

isCSSFunction · 0.85
isHTMLFunction · 0.85
isJSONFunction · 0.85
isJSFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected