Vincit/objection.js

Missing typings for QueryBuilder.tableRef

Open

#2 364 ouverte le 16 mars 2023

Voir sur GitHub
 (2 commentaires) (0 réactions) (0 assignés)JavaScript (663 forks)batch import
good first issuetypings

Métriques du dépôt

Stars
 (7 146 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

QueryBuilder has a convenient method tableRef which returns the alias for the model the query builder operates against:

https://github.com/Vincit/objection.js/blob/1b74f756c8afd3bab7964ac3aea7438b95edce44/lib/queryBuilder/QueryBuilder.js#L87-L89

However it's not exposed in typings and not mentioned in the documentation. Can we add it?


On a side note, its implementation clearly contradicts the typings for tableRefFor:

https://github.com/Vincit/objection.js/blob/1b74f756c8afd3bab7964ac3aea7438b95edce44/typings/objection/index.d.ts#L615-L617

the method is supposed to accept a model class, but the actual implementation passes a string.

Guide contributeur