Stores a field mask as a tree of named and wildcard paths.
Use Mask.parse for text such as metadata,spec.resources.*. A
wildcard matches one field at its current path level. Most modifying
methods return this instance so that calls can be chained.
Stores a field mask as a tree of named and wildcard paths.
Use Mask.parse for text such as metadata,spec.resources.*. A
wildcard matches one field at its current path level. Most modifying
methods return this instance so that calls can be chained.
Contains the branch for a * segment, or null when no wildcard exists.
Maps each named segment to the mask below that segment.
Returns a JSON-safe value for logs.
Adds a path to this mask and returns this instance.
Use the string '*' for a wildcard segment. An empty path makes no
change.
Returns an independent copy of this mask.
Returns whether the mask has no paths.
Returns whether this mask contains one linear path and no wildcard.
Returns a stable, sorted field-mask string.
The method groups shared path prefixes when this makes the output shorter. It throws if the tree is more than 1,000 levels deep.
Adds all paths from another mask and returns this instance.
New branches are copied. Later changes to other do not change this
mask.
Removes matching paths from this mask and returns this instance.
This variant only matches * with *. It does not expand wildcards.
Removes paths selected by a reset mask and returns this instance.
Wildcard branches in other also remove matching named branches.
Returns the same JSON-safe tree as Mask.toObject.
Keys that need quotes stay in marshaled form, including their quote characters. Such keys do not round-trip through Mask.parseJSON.
Converts the mask tree to a JSON-safe object.
Leaf paths have the value true. Wildcard branches use the * key.
Named keys are stored in their marshaled form. A key that needs JSON quotes
therefore includes those quote characters in the returned object.
Do not use Mask.fromObject or Mask.parseJSON to round-trip this output when a key needs quotes. Those functions treat the marshaled key as a new literal key.
Converts the value to string.
StaticfromCreates a mask from the leaf paths in a JavaScript value.
Object keys become named segments. Array elements add a wildcard segment. Empty objects and arrays become leaf paths.
StaticparseParses field-mask text, including grouped paths and wildcards.
StaticParseStaticparseCreates a mask from a JSON string or an already parsed JavaScript value.
Stores a field mask as a tree of named and wildcard paths.
Use Mask.parse for text such as
metadata,spec.resources.*. A wildcard matches one field at its current path level. Most modifying methods return this instance so that calls can be chained.Example