MCPcopy Index your code
hub / github.com/grid-js/gridjs / setID

Method setID

src/header.ts:148–168  ·  view source on GitHub ↗
(columns?: OneDArray<TColumn>)

Source from the content-addressed store, hash-verified

146 }
147
148 private setID(columns?: OneDArray<TColumn>): void {
149 const cols = columns || this.columns || [];
150
151 for (const column of cols) {
152 if (!column.id && typeof column.name === 'string') {
153 // let's guess the column ID if it's undefined
154 column.id = camelCase(column.name);
155 }
156
157 if (!column.id) {
158 logger.error(
159 `Could not find a valid ID for one of the columns. Make sure a valid "id" is set for all columns.`,
160 );
161 }
162
163 // nested columns
164 if (column.columns) {
165 this.setID(column.columns);
166 }
167 }
168 }
169
170 private populatePlugins(
171 pluginManager: PluginManager,

Callers 1

createFromConfigMethod · 0.95

Calls 2

camelCaseFunction · 0.90
errorMethod · 0.80

Tested by

no test coverage detected