feat: |Worker| NO_LIMIT_SEND_ROLE support multi role splited by ',' (#588)

This commit is contained in:
Dream Hunter
2025-02-22 16:58:48 +08:00
committed by GitHub
parent 241e0b7b28
commit 3a542a8391
8 changed files with 24 additions and 10 deletions

View File

@@ -1,6 +1,6 @@
import { Context } from "hono";
import { createMimeMessage } from "mimetext";
import { HonoCustomType, UserRole,AnotherWorker } from "./types";
import { HonoCustomType, UserRole, AnotherWorker } from "./types";
export const getJsonObjectValue = <T = any>(
value: string | any
@@ -69,6 +69,15 @@ export const getStringValue = (value: any): string => {
return "";
}
export const getSplitStringListValue = (
value: any, demiliter: string = ","
): string[] => {
const valueToSplit = getStringValue(value);
return valueToSplit.split(demiliter)
.map((item: string) => item.trim())
.filter((item: string) => item.length > 0);
}
export const getBooleanValue = (
value: boolean | string | any
): boolean => {