Closed bwgjoseph closed 3 years ago
Hi,
The return type of model and getModel is slightly different
model
getModel
export declare const getModel: (name: string) => Model<any, any> & (new (data: any, options?: CastOptions | undefined) => any); export declare const model: <T = any>(name: string, schema: Schema | Record<string, unknown>, options?: any) => import("..").ModelTypes<T>;
Should it be the same? returning ModelTypes? The definition also seems slightly different, I'm not quite sure though
ModelTypes
I face issue while trying to get back the type
// can be any or ModelTypes const postModel = getModel(modelName) || model(modelName, schema, modelOptions); export default postModel;
Created an Investigation ticket https://github.com/couchbaselabs/node-ottoman/issues/467
Will be done in the next release.
Fixed w/ alpha 29
Hi,
The return type of
model
andgetModel
is slightly differentShould it be the same? returning
ModelTypes
? The definition also seems slightly different, I'm not quite sure thoughI face issue while trying to get back the type