@@ -441,7 +441,7 @@ $root.vector_tile = (function() {
441441 * @param {Object.<string,*> } [options] Conversion options
442442 * @returns {vector_tile.Tile.Value|Object } Converted message
443443 */
444- Value . convert = ( function ( ) { return function convert ( src , impl , options ) {
444+ Value . convert = ( function ( util ) { return function convert ( src , impl , options ) {
445445 if ( ! options ) {
446446 options = { } ;
447447 }
@@ -456,21 +456,21 @@ $root.vector_tile = (function() {
456456 if ( dst . doubleValue === undefined && options . defaults ) {
457457 dst . doubleValue = 0 ;
458458 }
459- if ( src . intValue !== undefined && src . intValue !== null || options . defaults ) {
459+ if ( options . defaults || src . intValue !== undefined && src . intValue !== null && util . longNe ( src . intValue , 0 , 0 ) ) {
460460 dst . intValue = impl . longs ( src . intValue , 0 , 0 , false , options ) ;
461461 }
462- if ( src . uintValue !== undefined && src . uintValue !== null || options . defaults ) {
462+ if ( options . defaults || src . uintValue !== undefined && src . uintValue !== null && util . longNe ( src . uintValue , 0 , 0 ) ) {
463463 dst . uintValue = impl . longs ( src . uintValue , 0 , 0 , true , options ) ;
464464 }
465- if ( src . sintValue !== undefined && src . sintValue !== null || options . defaults ) {
465+ if ( options . defaults || src . sintValue !== undefined && src . sintValue !== null && util . longNe ( src . sintValue , 0 , 0 ) ) {
466466 dst . sintValue = impl . longs ( src . sintValue , 0 , 0 , false , options ) ;
467467 }
468468 if ( dst . boolValue === undefined && options . defaults ) {
469469 dst . boolValue = false ;
470470 }
471471 }
472472 return dst ;
473- } ; } ) ( ) ;
473+ } ; } ) ( $protobuf . util ) ;
474474
475475 /**
476476 * Creates a Value message from JSON.
@@ -717,13 +717,13 @@ $root.vector_tile = (function() {
717717 * @param {Object.<string,*> } [options] Conversion options
718718 * @returns {vector_tile.Tile.Feature|Object } Converted message
719719 */
720- Feature . convert = ( function ( types ) { return function convert ( src , impl , options ) {
720+ Feature . convert = ( function ( util , types ) { return function convert ( src , impl , options ) {
721721 if ( ! options ) {
722722 options = { } ;
723723 }
724724 var dst = impl . create ( src , this , options ) ;
725725 if ( dst ) {
726- if ( src . id !== undefined && src . id !== null || options . defaults ) {
726+ if ( options . defaults || src . id !== undefined && src . id !== null && util . longNe ( src . id , 0 , 0 ) ) {
727727 dst . id = impl . longs ( src . id , 0 , 0 , true , options ) ;
728728 }
729729 if ( src . tags && src . tags . length ) {
@@ -736,7 +736,7 @@ $root.vector_tile = (function() {
736736 dst . tags = [ ] ;
737737 }
738738 }
739- if ( src . type !== undefined || options . defaults ) {
739+ if ( options . defaults || src . type !== undefined && src . type !== undefined ) {
740740 dst . type = impl . enums ( src . type , undefined , types [ 2 ] , options ) ;
741741 }
742742 if ( src . geometry && src . geometry . length ) {
@@ -751,7 +751,7 @@ $root.vector_tile = (function() {
751751 }
752752 }
753753 return dst ;
754- } ; } ) ( $types ) ;
754+ } ; } ) ( $protobuf . util , $ types) ;
755755
756756 /**
757757 * Creates a Feature message from JSON.
0 commit comments