Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Return un-wrapped Float and Ints by default. - #84

Merged
stephenplusplus merged 6 commits into
googleapis:masterfrom
stephenplusplus:spp--80
Jan 9, 2018
Merged

stephenplusplus merged 6 commits into
googleapis:masterfrom
stephenplusplus:spp--80

Conversation

@stephenplusplus

@stephenplusplus stephenplusplus commented Jan 5, 2018 •

Copy link
Copy Markdown
Contributor

Fixes #80

When toJSON() is called on a Row object, Float64 and Int64 values will now be returned as a JavaScript Number:

var values = row.toJSON()
values.numUsers; // 8

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 5, 2018
@ghost ghost assigned stephenplusplus Jan 5, 2018
@codecov

codecov Bot commented Jan 5, 2018 •

Copy link
Copy Markdown

Codecov Report

Merging #84 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #84   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          11     11           
  Lines        1214   1221    +7     
=====================================
+ Hits         1214   1221    +7
Impacted Files Coverage Δ
src/transaction-request.js 100% <ø> (ø) ⬆️
src/table.js 100% <ø> (ø) ⬆️
src/partial-result-stream.js 100% <100%> (ø) ⬆️
src/row-builder.js 100% <100%> (ø) ⬆️
src/codec.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f7f378...3cff0cb. Read the comment docs.

@stephenplusplus

Copy link
Copy Markdown
Contributor Author

@WaldoJeffers feel free to check this out!

@WaldoJeffers WaldoJeffers left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement to the API 👍 The tests look thorough.
(I don't know what kind of reviews you expect, or if you have specific conventions, but here are my 2 cents 😄 )

Comment thread src/codec.js Outdated
*/
function generateToJSONFromRow(row) {
return function(options) {
options = options || {

This comment was marked as spam.

Comment thread src/codec.js Outdated

var serializedRow = {};

row.forEach(function(keyVal) {

This comment was marked as spam.

@stephenplusplus

Copy link
Copy Markdown
Contributor Author

@WaldoJeffers great suggestions! Made the changes :)

Comment thread src/codec.js

codec.Int = Int;

function generateToJSONFromRow(row) {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Comment thread src/codec.js Outdated

function generateToJSONFromRow(row) {
return function(options) {
options = options || {

This comment was marked as spam.

This comment was marked as spam.

@stephenplusplus
stephenplusplus merged commit 2f13744 into googleapis:master Jan 9, 2018
@stephenplusplus
stephenplusplus deleted the spp--80 branch January 9, 2018 22:54
@ghost ghost removed the cla: yes This human has signed the Contributor License Agreement. label Jan 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants