MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / isProcedureIncluded

Function isProcedureIncluded

packages/orm/src/client/client-impl.ts:576–600  ·  view source on GitHub ↗

* Checks if a procedure should be included based on slicing configuration.

(options: ClientOptions<SchemaDef>, procedureName: string)

Source from the content-addressed store, hash-verified

574 * Checks if a procedure should be included based on slicing configuration.
575 */
576function isProcedureIncluded(options: ClientOptions<SchemaDef>, procedureName: string): boolean {
577 const slicing = options.slicing;
578 if (!slicing) {
579 // No slicing config, include all procedures
580 return true;
581 }
582
583 const { includedProcedures, excludedProcedures } = slicing;
584
585 // If includedProcedures is specified (even if empty), only include those procedures
586 if (includedProcedures !== undefined) {
587 if (!(includedProcedures as readonly string[]).includes(procedureName)) {
588 return false;
589 }
590 }
591
592 // Then check if procedure is excluded (exclusion takes precedence)
593 if (excludedProcedures && excludedProcedures.length > 0) {
594 if ((excludedProcedures as readonly string[]).includes(procedureName)) {
595 return false;
596 }
597 }
598
599 return true;
600}
601
602function createModelCrudHandler(
603 client: ClientContract<any>,

Callers 1

$procsMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected