Skip to content

Commit

Permalink
undo my careless
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Chen committed Oct 2, 2019
1 parent 012897c commit 580f7b2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
4 changes: 0 additions & 4 deletions dev/src/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,8 @@ export function timestampFromJson(
*/
function bytesFromJson(bytesValue: string | Uint8Array): Uint8Array {
if (typeof bytesValue === 'string') {
console.error('string bytesfromjson');
return Buffer.from(bytesValue, 'base64');
} else {
console.error('NOT string bytesfromjson');
return bytesValue;
}
}
Expand Down Expand Up @@ -147,7 +145,6 @@ export function detectValueType(proto: ProtobufJsValue): string {
detectedValues.push('geoPointValue');
}
if (proto.bytesValue !== undefined) {
console.error('DETECTEDVALUE', proto.bytesValue);
detectedValues.push('bytesValue');
}

Expand Down Expand Up @@ -177,7 +174,6 @@ export function valueFromJson(fieldValue: api.IValue): api.IValue {
timestampValue: timestampFromJson(fieldValue.timestampValue!),
};
case 'bytesValue':
console.error('valuefromjson', fieldValue.bytesValue);
return {
bytesValue: bytesFromJson(fieldValue.bytesValue!),
};
Expand Down
2 changes: 0 additions & 2 deletions dev/src/serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ export class Serializer {
}

if (val instanceof Buffer || val instanceof Uint8Array) {
console.error('encoder', val);
return {
bytesValue: val,
};
Expand Down Expand Up @@ -254,7 +253,6 @@ export class Serializer {
return GeoPoint.fromProto(proto.geoPointValue!);
}
case 'bytesValue': {
console.error('bytesValue', proto.bytesValue);
return proto.bytesValue;
}
default: {
Expand Down
5 changes: 2 additions & 3 deletions dev/system-test/firestore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,7 @@ describe('DocumentReference class', () => {
});
});

it.only('has set() method', () => {
setLogFunction(console.log);
it('has set() method', () => {
const allSupportedTypesObject = {
stringValue: 'a',
trueValue: true,
Expand All @@ -267,7 +266,7 @@ describe('DocumentReference class', () => {
nilValue: null,
geoPointValue: new GeoPoint(50.1430847, -122.947778),
zeroGeoPointValue: new GeoPoint(0, 0),
bytesValue: Buffer.alloc(2)
bytesValue: Buffer.from([0x01, 0x02]),
};
const ref = randomCol.doc('doc');
return ref
Expand Down

0 comments on commit 580f7b2

Please sign in to comment.