Files
homarr/packages/custom-widgets/src/jsx/safe-language-policy.ts
T

67 lines
934 B
TypeScript

export const CUSTOM_JSX_BINARY_OPERATORS: ReadonlySet<string> = new Set([
"+",
"-",
"*",
"/",
"%",
"**",
"<",
"<=",
">",
">=",
"==",
"!=",
"===",
"!==",
]);
export const CUSTOM_JSX_CALLBACK_METHODS: ReadonlySet<string> = new Set([
"every",
"filter",
"find",
"findIndex",
"flatMap",
"map",
"reduce",
"some",
"sort",
]);
export const CUSTOM_JSX_SAFE_VALUE_METHODS: ReadonlySet<string> = new Set([
...CUSTOM_JSX_CALLBACK_METHODS,
"at",
"charAt",
"concat",
"endsWith",
"flat",
"flatMap",
"includes",
"indexOf",
"join",
"lastIndexOf",
"localeCompare",
"match",
"padEnd",
"padStart",
"pop",
"repeat",
"replace",
"replaceAll",
"reverse",
"slice",
"search",
"split",
"startsWith",
"substring",
"toFixed",
"toLocaleString",
"toLowerCase",
"toPrecision",
"toString",
"toUpperCase",
"trim",
"trimEnd",
"trimStart",
"test",
]);