import { resetMaskFromMessage } from '@nebius/js-sdk/runtime/resetmask';
const mask = resetMaskFromMessage({
displayName: '',
enabled: false,
description: 'keep this value',
});
mask?.marshal(); // "displayName,enabled"
ErrRecursionTooDeep if the message is more than 1,000 object levels deep.
Finds fields whose values ask the API to reset stored data.
A reset value is the protobuf default for its field type. Examples include an empty string,
false, numeric zero, empty bytes, an empty repeated field, and an absent message field. The result uses protobuf field names, such asdisplay_name, when generated descriptor data is available.The function walks generated message descriptors when they exist. This keeps oneof, map, repeated-message, and well-known type handling consistent with protobuf semantics. For a plain object without descriptors, it uses conservative JavaScript object rules.
This function does not change the input. It returns an empty mask when the message has no reset values. It returns
nullonly whenupdateisnullorundefined.