mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 08:51:23 +00:00
refactor(zalo): share outbound chunker
This commit is contained in:
10
src/plugin-sdk/allow-from.ts
Normal file
10
src/plugin-sdk/allow-from.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
export function formatAllowFromLowercase(params: {
|
||||
allowFrom: Array<string | number>;
|
||||
stripPrefixRe?: RegExp;
|
||||
}): string[] {
|
||||
return params.allowFrom
|
||||
.map((entry) => String(entry).trim())
|
||||
.filter(Boolean)
|
||||
.map((entry) => (params.stripPrefixRe ? entry.replace(params.stripPrefixRe, "") : entry))
|
||||
.map((entry) => entry.toLowerCase());
|
||||
}
|
||||
Reference in New Issue
Block a user