MCPcopy Index your code
hub / github.com/callstack/agent-device / orderRequestExecutionLockKeys

Function orderRequestExecutionLockKeys

src/daemon/request-binding.ts:75–83  ·  view source on GitHub ↗
(
  keys: Iterable<RequestExecutionLockKey>,
)

Source from the content-addressed store, hash-verified

73}
74
75function orderRequestExecutionLockKeys(
76 keys: Iterable<RequestExecutionLockKey>,
77): RequestExecutionLockKey[] {
78 return Array.from(keys).sort((left, right) => {
79 const categoryOrder = lockKeyCategoryOrder(left) - lockKeyCategoryOrder(right);
80 if (categoryOrder !== 0) return categoryOrder;
81 return left.localeCompare(right);
82 });
83}
84
85function lockKeyCategoryOrder(key: RequestExecutionLockKey): number {
86 return key.startsWith('session:') ? 0 : 1;

Callers 1

Calls 1

lockKeyCategoryOrderFunction · 0.85

Tested by

no test coverage detected