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

Method processParams

packages/core/src/utils/QueryHelper.ts:63–89  ·  view source on GitHub ↗
(params: unknown)

Source from the content-addressed store, hash-verified

61 }
62
63 static processParams(params: unknown): any {
64 if (Reference.isReference(params)) {
65 params = params.unwrap();
66 }
67
68 if (Utils.isEntity(params)) {
69 if (helper(params).__meta.compositePK) {
70 return helper(params).__primaryKeys;
71 }
72
73 return helper(params).getPrimaryKey();
74 }
75
76 if (params === undefined) {
77 return null;
78 }
79
80 if (Array.isArray(params)) {
81 return (params as unknown[]).map(item => QueryHelper.processParams(item));
82 }
83
84 if (Utils.isPlainObject(params)) {
85 QueryHelper.processObjectParams(params);
86 }
87
88 return params;
89 }
90
91 static processObjectParams<T extends Dictionary>(params: T = {} as T): T {
92 Utils.getObjectQueryKeys(params).forEach(k => {

Callers 6

upsertMethod · 0.80
upsertManyMethod · 0.80
processObjectParamsMethod · 0.80
processWhereMethod · 0.80
mergeDataMethod · 0.80

Calls 8

helperFunction · 0.85
isReferenceMethod · 0.80
isPlainObjectMethod · 0.80
processObjectParamsMethod · 0.80
getPrimaryKeyMethod · 0.65
unwrapMethod · 0.45
isEntityMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected