private cloneAndChange()

in src/common/baseTelemetryReporter.ts [96:106]


	private cloneAndChange(obj?: { [key: string]: string }, change?: (key: string, val: string) => string): { [key: string]: string } | undefined {
		if (obj === null || typeof obj !== "object") return obj;
		if (typeof change !== "function") return obj;

		const ret: { [key: string]: string } = {};
		for (const key in obj) {
			ret[key] = change(key, obj[key]!);
		}

		return ret;
	}