/** * 生成对象配置的缓存键 * * Generate cache key of geometry configuration * @param props - 对象配置 geometry configuration * @returns 缓存键 cache key */ export function getCacheKey(props: Record): symbol { const entries = Object.entries(props); if (entries.some(([, value]) => typeof value === 'object')) { return Symbol(); } const str = entries .sort((a, b) => a[0].localeCompare(b[0])) .map(([key, value]) => { return `${key}:${value}`; }) .join(' '); return Symbol.for(str); }