mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-07-13 00:12:02 +08:00
feat: |Worker| NO_LIMIT_SEND_ROLE support multi role splited by ',' (#588)
This commit is contained in:
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user