Download src/plugins/contracts/shared.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 534 Bytes
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/plugins/contracts/shared.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/plugins/contracts/shared.ts
-
curl -L -o shared.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/plugins/contracts/shared.ts
534 Bytes
| /** Returns unique normalized string values while preserving first-seen order. */ | |
| export function normalizeContractStringValues( | |
| values: readonly string[] | undefined, | |
| normalize: (value: string) => string = (value) => value, | |
| ): string[] { | |
| const result: string[] = []; | |
| const seen = new Set<string>(); | |
| for (const value of values ?? []) { | |
| const normalized = normalize(value); | |
| if (!normalized || seen.has(normalized)) { | |
| continue; | |
| } | |
| seen.add(normalized); | |
| result.push(normalized); | |
| } | |
| return result; | |
| } | |