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

Function isCSS

src/js/utils/fileUtils.js:47–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45};
46
47export const isCSS = () => {
48 const isSavedFile = ORIGINAL_FILE_PATH !== '?';
49 const useEditorFileSyntaxForDeterminingFileType = EDITOR_FILE_SYNTAX !== '?';
50
51 const isAllowedExtension = hasAllowedFileExtension('css', ORIGINAL_FILE_PATH);
52 const isAllowedSyntax = hasAllowedFileSyntax('css', EDITOR_FILE_SYNTAX);
53 const isDisallowedFilePattern = hasDisallowedFilePathPattern('css', ORIGINAL_FILE_PATH);
54
55 if (!isSavedFile) {
56 return useEditorFileSyntaxForDeterminingFileType
57 ? isAllowedSyntax
58 : false;
59 }
60
61 if (isDisallowedFilePattern) {
62 return false;
63 }
64
65 return useEditorFileSyntaxForDeterminingFileType
66 ? isAllowedSyntax || isAllowedExtension
67 : isAllowedExtension;
68};
69
70export const isHTML = (bufferContents) => {
71 const isSavedFile = ORIGINAL_FILE_PATH !== '?';

Callers

nothing calls this directly

Calls 3

hasAllowedFileExtensionFunction · 0.85
hasAllowedFileSyntaxFunction · 0.85

Tested by

no test coverage detected