MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / validateThemeExtensions

Function validateThemeExtensions

src/cm/themes/index.js:78–92  ·  view source on GitHub ↗
(themeId, extensions)

Source from the content-addressed store, hash-verified

76}
77
78function validateThemeExtensions(themeId, extensions) {
79 if (!extensions.length) {
80 logInvalidThemeOnce(themeId, null, "no extensions were returned");
81 return false;
82 }
83
84 try {
85 // Validate against Acode's own CodeMirror instance.
86 EditorState.create({ doc: "", extensions });
87 return true;
88 } catch (error) {
89 logInvalidThemeOnce(themeId, error);
90 return false;
91 }
92}
93
94function resolveThemeEntryExtensions(theme, fallbackExtensions) {
95 const fallback = fallbackExtensions.length

Callers 2

addThemeFunction · 0.85

Calls 2

logInvalidThemeOnceFunction · 0.85
createMethod · 0.65

Tested by

no test coverage detected