Skip to content

findUngroundedExampleMethods

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/libs/parser-core/src/techdocs/example-grounding.ts

Return the method names an example calls on an instance of entityName that are NOT among knownMethods — i.e. hallucinated APIs. Conservative to avoid dropping good examples:

  • Binds the entity only via new EntityName( or a <var>: EntityName typed param/field.
  • Returns [] when there are no known methods (nothing to ground) or no bound var (unsure). Calls on other objects (res.status, this.prisma.insert, standard lib) are never flagged.

Signature

ts
function findUngroundedExampleMethods(example: string, entityName: string, knownMethods: string[]): string[]

Parameters

NameType
examplestring
entityNamestring
knownMethodsstring[]

Returns: string[]

Was this page helpful?

Download as PDF