Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

497 B
Raw Blame
import { ChartEvent } from 'chart.js';

export type ChartEventHandler = (ev: ChartEvent | MouseEvent) => void;

export function mergeDefaultOptions<T extends Record<string, unknown>>(
	options: T,
	defaultOptions: Required<T>,
): Required<T> {
	const sanitizedOptions = { ...options };
	Object.keys(options).forEach((key) => {
		if (sanitizedOptions[key as keyof T] === undefined) {
			delete sanitizedOptions[key as keyof T];
		}
	});

	return {
		...defaultOptions,
		...sanitizedOptions,
	};
}