src/vs/workbench/services/extensions/common/rpcProtocol.ts/createURIReplacer
function createURIReplacer(transformer: IURITransformer | null): JSONStringifyReplacer | null {
	if (!transformer) {
		return null;
	}
	return (key: string, value: any): any => {
		if (value && value.$mid === MarshalledId.Uri) {
			return transformer.transformOutgoing(value);
		}
		return value;
	};
}