MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / normalizeFields

Function normalizeFields

packages/sql/src/AbstractSqlDriver.ts:3396–3413  ·  view source on GitHub ↗
(fields: InternalField<T>[], prefix = '')

Source from the content-addressed store, hash-verified

3394 }
3395
3396 protected normalizeFields<T extends object>(fields: InternalField<T>[], prefix = ''): string[] {
3397 const ret: string[] = [];
3398
3399 for (const field of fields) {
3400 if (typeof field === 'string') {
3401 ret.push(prefix + field);
3402 continue;
3403 }
3404
3405 if (Utils.isPlainObject(field)) {
3406 for (const key of Object.keys(field)) {
3407 ret.push(...this.normalizeFields((field as Dictionary)[key], key + '.'));
3408 }
3409 }
3410 }
3411
3412 return ret;
3413 }
3414
3415 protected processField<T extends object>(
3416 meta: EntityMetadata<T>,

Callers

nothing calls this directly

Calls 3

pushMethod · 0.80
isPlainObjectMethod · 0.80
keysMethod · 0.45

Tested by

no test coverage detected