-
Notifications
You must be signed in to change notification settings - Fork 109
Open
Labels
api: datastoreIssues related to the googleapis/nodejs-datastore API.Issues related to the googleapis/nodejs-datastore API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.
Description
The issue
The Datastore instance inherits from DatastoreRequest which among other things contain:
[key: string]: Entity; // Entity is aliased to anyThis is a problem when dealing with typos since the return types are any all code following still compiles without warning.
Example:
const datastore = new Datastore()
datastore.fooBar('hello') // No warning or anything here
const [data] = await datastore.GET(key)
// obvious typo here but the `data` variable has type "any"
// and all following code compiles without warning
model.process(data) // No warning here eitherRequest
Since my knowledge of how the class works is very limited I'm not sure if it's possible but it would be nice if obvious errors like the one I showed are caught at write-time by having stricter types.
Metadata
Metadata
Assignees
Labels
api: datastoreIssues related to the googleapis/nodejs-datastore API.Issues related to the googleapis/nodejs-datastore API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.‘Nice-to-have’ improvement, new feature or different behavior or design.