* Checks if a model should be included based on slicing configuration.
(options: ClientOptions<SchemaDef>, model: string)
| 545 | * Checks if a model should be included based on slicing configuration. |
| 546 | */ |
| 547 | function isModelIncluded(options: ClientOptions<SchemaDef>, model: string): boolean { |
| 548 | const slicing = options.slicing; |
| 549 | if (!slicing) { |
| 550 | // No slicing config, include all models |
| 551 | return true; |
| 552 | } |
| 553 | |
| 554 | const { includedModels, excludedModels } = slicing; |
| 555 | |
| 556 | // If includedModels is specified (even if empty), only include those models |
| 557 | if (includedModels !== undefined) { |
| 558 | if (!includedModels.includes(model as any)) { |
| 559 | return false; |
| 560 | } |
| 561 | } |
| 562 | |
| 563 | // Then check if model is excluded |
| 564 | if (excludedModels && excludedModels.length > 0) { |
| 565 | if (excludedModels.includes(model as any)) { |
| 566 | return false; |
| 567 | } |
| 568 | } |
| 569 | |
| 570 | return true; |
| 571 | } |
| 572 | |
| 573 | /** |
| 574 | * Checks if a procedure should be included based on slicing configuration. |