We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
model.get
| undefined
Return type of Model<T>.get is T, even though it returns undefined if item is not found. This behavior is also mentioned in the documentation.
Model<T>.get
T
undefined
const UserSchema = ...
const UserModel = dynamoose.model<UserItem>(tableName, UserSchema);
const user = UserModel.get('non-existing-id');
// type of user is UserItem
user
UserItem
// type of user should be UserItem | undefined
UserItem | undefined
Dynamoose version: 3.2.0
The text was updated successfully, but these errors were encountered:
Model.get
Successfully merging a pull request may close this issue.
Summary:
Return type of
Model<T>.get
isT
, even though it returnsundefined
if item is not found. This behavior is also mentioned in the documentation.Code sample:
Schema
Model
General
Current output and behavior (including stack trace):
// type of
user
isUserItem
Expected output and behavior:
// type of
user
should beUserItem | undefined
Environment:
Dynamoose version: 3.2.0
Other:
The text was updated successfully, but these errors were encountered: