|
1
|
import { INJECTION_ZONES } from "./constants" |
|
2
|
import { InjectionZone } from "./types" |
|
3
|
|
|
4
|
/** |
|
5
|
* Validates that the provided zone is a valid injection zone for a widget. |
|
6
|
*/ |
|
7
|
export function isValidInjectionZone(zone: any): zone is InjectionZone { |
|
8
|
if (typeof zone !== "string") return false |
|
9
|
if (INJECTION_ZONES.includes(zone as any)) return true |
|
10
|
console.warn( |
|
11
|
`The injection zone "${zone}" is not a core injection zone. Custom zones are not validated, verify it is correct.` |
|
12
|
) |
|
13
|
return true |
|
14
|
} |