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

chore: update array types #555

Merged
merged 1 commit into from
Feb 25, 2019
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 4 additions & 4 deletions dev/src/field-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class FieldValue {
* // doc.get('array') contains field 'foo'
* });
*/
static arrayUnion(...elements: Array<unknown>): FieldValue {
static arrayUnion(...elements: unknown[]): FieldValue {
validateMinNumberOfArguments('FieldValue.arrayUnion', arguments, 1);
return new ArrayUnionTransform(elements);
}
Expand All @@ -129,7 +129,7 @@ export class FieldValue {
* // doc.get('array') no longer contains field 'foo'
* });
*/
static arrayRemove(...elements: Array<unknown>): FieldValue {
static arrayRemove(...elements: unknown[]): FieldValue {
validateMinNumberOfArguments('FieldValue.arrayRemove', arguments, 1);
return new ArrayRemoveTransform(elements);
}
Expand Down Expand Up @@ -282,7 +282,7 @@ class ServerTimestampTransform extends FieldTransform {
* @private
*/
class ArrayUnionTransform extends FieldTransform {
constructor(private readonly elements: Array<unknown>) {
constructor(private readonly elements: unknown[]) {
super();
}

Expand Down Expand Up @@ -335,7 +335,7 @@ class ArrayUnionTransform extends FieldTransform {
* @private
*/
class ArrayRemoveTransform extends FieldTransform {
constructor(private readonly elements: Array<unknown>) {
constructor(private readonly elements: unknown[]) {
super();
}

Expand Down
2 changes: 1 addition & 1 deletion dev/src/reference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,7 @@ export class Query {
*/
static _extractFieldValues(
documentSnapshot: DocumentSnapshot, fieldOrders: FieldOrder[]) {
const fieldValues: Array<unknown> = [];
const fieldValues: unknown[] = [];

for (const fieldOrder of fieldOrders) {
if (FieldPath.documentId().isEqual(fieldOrder.field)) {
Expand Down
4 changes: 2 additions & 2 deletions dev/src/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class Serializer {
return this.createReference(resourcePath.relativeName);
}
case 'arrayValue': {
const array: Array<unknown> = [];
const array: unknown[] = [];
if (Array.isArray(proto.arrayValue!.values)) {
for (const value of proto.arrayValue!.values!) {
array.push(this.decodeValue(value));
Expand Down Expand Up @@ -312,7 +312,7 @@ export function validateUserInput(
const fieldPathMessage = path ? ` (found in field ${path.toString()})` : '';

if (Array.isArray(value)) {
const arr = value as Array<unknown>;
const arr = value as unknown[];
for (let i = 0; i < arr.length; ++i) {
validateUserInput(
arg, arr[i]!, desc, options,
Expand Down
10 changes: 5 additions & 5 deletions synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-02-13T12:15:47.405884Z",
"updateTime": "2019-02-24T12:13:23.461769Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.16.13",
"dockerImage": "googleapis/artman@sha256:5fd9aee1d82a00cebf425c8fa431f5457539562f5867ad9c54370f0ec9a7ccaa"
"version": "0.16.14",
"dockerImage": "googleapis/artman@sha256:f3d61ae45abaeefb6be5f228cda22732c2f1b00fb687c79c4bd4f2c42bb1e1a7"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "ca61898878f0926dd9dcc68ba90764f17133efe4",
"internalRef": "233680013"
"sha": "59f2494f1b00511bbb813d647cfbe95c949de0fe",
"internalRef": "235350912"
}
},
{
Expand Down