MCPcopy Index your code
hub / github.com/tinymce/tinymce / createLookupTable

Function createLookupTable

modules/tinymce/src/core/main/ts/api/html/Schema.ts:111–128  ·  view source on GitHub ↗
(option: keyof ElementSettings, defaultValue: string, extendWith?: SchemaMap)

Source from the content-addressed store, hash-verified

109
110 // Creates an lookup table map object for the specified option or the default value
111 const createLookupTable = (option: keyof ElementSettings, defaultValue: string, extendWith?: SchemaMap): SchemaMap => {
112 const value = settings[option];
113
114 if (!value) {
115 // Get cached default map or make it if needed
116 let newValue = mapCache[option];
117
118 if (!newValue) {
119 newValue = createMap(defaultValue, extendWith);
120 mapCache[option] = newValue;
121 }
122
123 return newValue;
124 } else {
125 // Create custom map
126 return makeMap(value, /[, ]/, makeMap(value.toUpperCase(), /[, ]/));
127 }
128 };
129
130 const schemaType = settings.schema ?? 'html5';
131 const schemaItems = SchemaLookupTable.makeSchema(schemaType);

Callers 1

SchemaFunction · 0.85

Calls 2

createMapFunction · 0.85
makeMapFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…