GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Translate datastore null entity value to empty protobuf property · toboid/gcloud-node@e714082

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/datastore
    • entity.js
  • test/datastore
    • entity.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/datastore/entity.js‎

Copy file name to clipboardExpand all lines: lib/datastore/entity.js
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@ function valueToProperty(v) {
426426
p.string_value = v;
427427
return p;
428428
}
429+
if (v === null) {
430+
return p;
431+
}
429432
if (v instanceof Buffer) {
430433
p.blob_value = v;
431434
return p;
Collapse file

‎test/datastore/entity.js‎

Copy file name to clipboardExpand all lines: test/datastore/entity.js
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,12 @@ describe('valueToProperty', function() {
419419
assert.deepEqual(val, expected);
420420
});
421421

422+
it('should translate null', function() {
423+
var val = entity.valueToProperty(null);
424+
var expected = {};
425+
assert.deepEqual(val, expected);
426+
});
427+
422428
it('should translate a buffer', function() {
423429
var buffer = new Buffer('Hi');
424430
var val = entity.valueToProperty(buffer);

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.