Skip to content
New issue

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

refactor(ts): enable noImplicitAny on test/request.ts #343

Merged
merged 6 commits into from
Mar 6, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ class DatastoreRequest {
get(keys: Entities, optionsOrCallback?: CreateReadStreamOptions|GetCallback,
cb?: GetCallback): void|Promise<Entity|Transform> {
const options =
typeof optionsOrCallback === 'object' && optionsOrCallback !== null ?
typeof optionsOrCallback === 'object' && optionsOrCallback ?
optionsOrCallback :
{};
const callback =
Expand Down Expand Up @@ -667,8 +667,7 @@ class DatastoreRequest {
query = extend(true, new Query(), query);

const makeRequest = (query: Query) => {
// tslint:disable-next-line no-any
const reqOpts: any = {
const reqOpts: Any = {
query: entity.queryToQueryProto(query),
};

Expand Down Expand Up @@ -701,17 +700,15 @@ class DatastoreRequest {
return;
}

// tslint:disable-next-line no-any
const info: any = {
const info: Any = {
moreResults: resp.batch.moreResults,
};

if (resp.batch.endCursor) {
info.endCursor = resp.batch.endCursor.toString('base64');
}

// tslint:disable-next-line no-any
let entities: any[] = [];
let entities: Any[] = [];

if (resp.batch.entityResults) {
entities = entity.formatArray(resp.batch.entityResults);
Expand Down Expand Up @@ -1051,7 +1048,7 @@ class DatastoreRequest {
}

arrify(resp.mutationResults)
.forEach((result: Entity, index: number) => { //! Entity malo
.forEach((result: Entity, index) => {
josecervino marked this conversation as resolved.
Show resolved Hide resolved
if (!result.key) {
return;
}
Expand Down Expand Up @@ -1208,6 +1205,8 @@ class DatastoreRequest {
}
}

//tslint:disable-next-line no-any
type Any = any;
export interface BooleanObject {
[key: string]: boolean;
}
Expand Down Expand Up @@ -1254,7 +1253,7 @@ export interface Mutation extends google.datastore.v1.IMutation {
}
export interface PrepareEntityObject {
[key: string]: google.datastore.v1.Key|
undefined; // TODO: Fix "Symbol cannot be key" TS error
undefined;
}
export interface PrepareEntityObjectResponse {
key?: google.datastore.v1.Key;
Expand All @@ -1269,22 +1268,22 @@ export interface RequestCallback {
}
export interface RequestConfig {
client: string;
gaxOpts?: number|CallOptions|KeyProto|undefined;
gaxOpts?: number|CallOptions|KeyProto;
method: string;
prepared?: boolean;
reqOpts?: RequestOptions;
reqOpts?: Entity|RequestOptions;
}
export interface RequestOptions {
mutations?: []|Array<{delete: KeyProto;}>|Array<{}>;
keys?: Entity;
readOptions?: {readConsistency?: number
readOptions?: {
readConsistency?: number
transaction?: string|number;
};
transaction?: string|number;
mode?: string;
projectId?: string;
transaction?: string|number;
mode?: string;
projectId?: string;
}
export interface RequestResponse extends google.datastore.v1.ICommitResponse {}
export interface RunQueryStreamOptions {
gaxOptions?: CallOptions;
consistency?: 'strong'|'eventual';
Expand Down
Loading