Skip to content

fieldMaskHasPath

fieldMaskHasPath(fieldMask, path, strict?): boolean

Defined in: fieldmask.ts:176

Check if a field mask has a path that matches the given path. A path matches if it is equal to the passed path or if it starts with the passed path and a dot. For example, a field mask with a “foo.bar” path will return true if the passed path is “foo.bar” or “foo.bar.baz”.

The FieldMask spec does not allow for wildcards and repeated or map fields must be the last part of the path. The final argument for this function is strict, which defaults to true. If strict is true, the function will only allow field masks that are valid according to the spec. However, the AIP Guidelines allow for wildcards in field masks. So, if you want to allow wildcards, you can set strict to false. This will allow for field masks with standalone wildcards or wildcards in repeated or map fields (i.e. '*', 'foo.*', 'foo.*.bar', etc.).

FieldMask

string

boolean = true

boolean