|
|
@ -6,8 +6,11 @@
|
|
|
|
* @param property - The property you want make sure is not undefined
|
|
|
|
* @param property - The property you want make sure is not undefined
|
|
|
|
* @returns true if the property is defined or false if undefined or using a type-specific default value
|
|
|
|
* @returns true if the property is defined or false if undefined or using a type-specific default value
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function hasDefinedProperty<A extends {}, B extends PropertyKey & keyof A>(object: A, property: B) {
|
|
|
|
function hasDefinedProperty<A extends object, B extends PropertyKey & keyof A>(
|
|
|
|
return object.hasOwnProperty(property) !== false;
|
|
|
|
object: A,
|
|
|
|
|
|
|
|
property: B
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
return Object.prototype.hasOwnProperty.call(object, property) !== false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export const ProtobufUtils = {
|
|
|
|
export const ProtobufUtils = {
|
|
|
|