( session: Session, filename: string, contextableQuery: Contextable<any, any>, contextableWhere: Contextable<any, any>, contextablePostOps: Array<Contextable<any, any>>, contextablePreOps: Array<Contextable<any, any>> )
| 249 | } |
| 250 | |
| 251 | export function validateNoMixedCompilationMode( |
| 252 | session: Session, |
| 253 | filename: string, |
| 254 | contextableQuery: Contextable<any, any>, |
| 255 | contextableWhere: Contextable<any, any>, |
| 256 | contextablePostOps: Array<Contextable<any, any>>, |
| 257 | contextablePreOps: Array<Contextable<any, any>> |
| 258 | ) { |
| 259 | let flattenPostOps: unknown[] = []; |
| 260 | contextablePostOps.forEach(op => { |
| 261 | flattenPostOps = flattenPostOps.concat(typeof op === "object" ? op : [op]); |
| 262 | }); |
| 263 | let flattenPreOps: unknown[] = []; |
| 264 | contextablePreOps.forEach(op => { |
| 265 | flattenPreOps = flattenPreOps.concat(typeof op === "object" ? op : [op]); |
| 266 | }); |
| 267 | const conflictingProperties: string[] = []; |
| 268 | if (!!contextableQuery) { conflictingProperties.push("query"); } |
| 269 | if (!!contextableWhere) { conflictingProperties.push("where"); } |
| 270 | if (!!flattenPostOps.length) { conflictingProperties.push("postOps"); } |
| 271 | if (!!flattenPreOps.length) { conflictingProperties.push("preOps"); } |
| 272 | if (conflictingProperties.length) { |
| 273 | const err = new Error( |
| 274 | `Cannot mix AoT and JiT compilation in action. The following AoT properties were found: ${conflictingProperties.join(", ") |
| 275 | }` |
| 276 | ); |
| 277 | session.compileError(err, filename); |
| 278 | throw err; |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | /** |
| 283 | * Checks if the Cloud Resource connection has a valid format. |
no test coverage detected