( ast: t.Node, rscEnabled: boolean, )
| 226 | } |
| 227 | |
| 228 | export function getModuleExecutionMode( |
| 229 | ast: t.Node, |
| 230 | rscEnabled: boolean, |
| 231 | ): "client" | "server" { |
| 232 | // if rscEnabled is true, then server mode is the default |
| 233 | // if rscEnabled is false, then client mode is the default |
| 234 | // default mode is when there is no directive |
| 235 | |
| 236 | if (rscEnabled) { |
| 237 | if (hasClientDirective(ast)) { |
| 238 | return "client"; |
| 239 | } else { |
| 240 | return "server"; |
| 241 | } |
| 242 | } else { |
| 243 | return "client"; |
| 244 | } |
| 245 | } |
| 246 | |
| 247 | export { getJsxAttributeValue, setJsxAttributeValue }; |
no test coverage detected