Download src/audit/execution-identity-ordering.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 405 Bytes
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/audit/execution-identity-ordering.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/audit/execution-identity-ordering.ts
-
curl -L -o execution-identity-ordering.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/audit/execution-identity-ordering.ts
405 Bytes
| export function sortUniqueExecutionIdentityEntries<T>( | |
| values: readonly T[], | |
| key: (value: T) => string, | |
| ): T[] { | |
| // Last-key-wins UTF-16 ordering protects canonical execution-identity bytes. | |
| return [...new Map(values.map((value) => [key(value), value])).values()].toSorted((a, b) => { | |
| const left = key(a); | |
| const right = key(b); | |
| return left < right ? -1 : left > right ? 1 : 0; | |
| }); | |
| } | |