We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 924bc61 commit b1179d8Copy full SHA for b1179d8
packages/optimizely-cms-sdk/src/graph/index.ts
@@ -386,9 +386,10 @@ export class GraphClient {
386
}
387
388
// Return sorted by the "sortedKeys"
389
+ const linkMap = new Map(links.map((link) => [link._metadata?.key, link]));
390
return sortedKeys
- .map((key) => links.find((link) => link._metadata?.key === key))
391
- .filter((item) => typeof item !== 'undefined');
+ .map((key) => linkMap.get(key))
392
+ .filter((item) => item !== undefined);
393
394
395
/**
0 commit comments