Created
February 1, 2021 12:27
-
-
Save percybolmer/111d983d049cdcfc9eaaff4d9a6f6b52 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Static version of the {@see toObject} method. | |
* @param {boolean|undefined} includeInstance Deprecated. Whether to include | |
* the JSPB instance for transitional soy proto support: | |
* http://goto/soy-param-migration | |
* @param {!proto.main.HardwareStats} msg The msg instance to transform. | |
* @return {!Object} | |
* @suppress {unusedLocalVariables} f is only used for nested messages | |
*/ | |
proto.main.HardwareStats.toObject = function(includeInstance, msg) { | |
var f, obj = { | |
cpu: jspb.Message.getFieldWithDefault(msg, 1, 0), | |
memoryFree: jspb.Message.getFieldWithDefault(msg, 2, 0), | |
memoryUsed: jspb.Message.getFieldWithDefault(msg, 3, 0) | |
}; | |
if (includeInstance) { | |
obj.$jspbMessageInstance = msg; | |
} | |
return obj; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment