MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / $unuse

Method $unuse

packages/orm/src/client/client-impl.ts:400–419  ·  view source on GitHub ↗
(pluginId: string)

Source from the content-addressed store, hash-verified

398 }
399
400 $unuse(pluginId: string) {
401 // tsc perf
402 const newPlugins: AnyPlugin[] = [];
403 for (const plugin of this.options.plugins ?? []) {
404 if (plugin.id !== pluginId) {
405 newPlugins.push(plugin);
406 }
407 }
408 const newOptions: ClientOptions<SchemaDef> = {
409 ...this.options,
410 plugins: newPlugins,
411 };
412 const newClient = new ClientImpl(this.schema, newOptions, this);
413 // create a new validator to have a fresh schema cache, because plugins may
414 // extend the query args schemas
415 newClient.inputValidator = new InputValidator(newClient as any, {
416 enabled: newClient.$options.validateInput !== false,
417 });
418 return newClient;
419 }
420
421 $unuseAll() {
422 // tsc perf

Callers 3

ext-result.test.tsFile · 0.80

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected