MCPcopy
hub / github.com/chartjs/Chart.js / _merger

Function _merger

src/helpers/helpers.core.ts:220–234  ·  view source on GitHub ↗
(key: string, target: AnyObject, source: AnyObject, options: AnyObject)

Source from the content-addressed store, hash-verified

218 * @private
219 */
220export function _merger(key: string, target: AnyObject, source: AnyObject, options: AnyObject) {
221 if (!isValidKey(key)) {
222 return;
223 }
224
225 const tval = target[key];
226 const sval = source[key];
227
228 if (isObject(tval) && isObject(sval)) {
229 // eslint-disable-next-line @typescript-eslint/no-use-before-define
230 merge(tval, sval, options);
231 } else {
232 target[key] = clone(sval);
233 }
234}
235
236export interface MergeOptions {
237 merger?: (key: string, target: AnyObject, source: AnyObject, options?: AnyObject) => void;

Callers

nothing calls this directly

Calls 4

isValidKeyFunction · 0.85
isObjectFunction · 0.85
mergeFunction · 0.85
cloneFunction · 0.85

Tested by

no test coverage detected