@nebius/js-sdk - v0.2.54
    Preparing search index...

    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.

    import { Mask } from '@nebius/js-sdk/runtime/fieldmask';

    const mask = Mask.parse('metadata,spec.(resources,cloud_init)');
    mask.subMask('spec')?.marshal(); // "cloud_init,resources"
    mask.addPath(['status']);
    mask.marshal(); // "metadata,spec.(cloud_init,resources),status"

    Indexable

    • [key: symbol]: () => string

      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.

        • (): string
        • 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.

          Returns string

    Index
    • Creates a mask from tree branches.

      The constructor keeps the supplied branch objects. Use copy when the caller and the mask must not share mutable state.

      Parameters

      • any: Mask | null = null
      • OptionalfieldParts: Map<string, Mask>

      Returns Mask

    any: Mask | null

    Contains the branch for a * segment, or null when no wildcard exists.

    fieldParts: Map<string, Mask>

    Maps each named segment to the mask below that segment.

    • Adds a path to this mask and returns this instance.

      Use the string '*' for a wildcard segment. An empty path makes no change.

      Parameters

      Returns this

    • Returns the mask below one key.

      A named branch has priority over the wildcard branch. The returned value is part of this mask, so changing it also changes this mask.

      Parameters

      Returns Mask | null

    • Returns paths that both masks contain at the same tree positions.

      This variant only matches * with *. It does not expand wildcards.

      Parameters

      • other: Mask | null | undefined

      Returns Mask | null

    • Returns paths that this mask and a reset mask share.

      Wildcard branches match named branches. This method does not change either input mask.

      Parameters

      • other: Mask | null | undefined

      Returns Mask | null

    • Returns whether this mask contains one linear path and no wildcard.

      Returns boolean

    • 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.

      Returns string

    • Adds all paths from another mask and returns this instance.

      New branches are copied. Later changes to other do not change this mask.

      Parameters

      • other: Mask | null | undefined

      Returns this

    • Removes matching paths from this mask and returns this instance.

      This variant only matches * with *. It does not expand wildcards.

      Parameters

      • other: Mask | null | undefined

      Returns this

    • Removes paths selected by a reset mask and returns this instance.

      Wildcard branches in other also remove matching named branches.

      Parameters

      • other: Mask | null | undefined

      Returns this

    • 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.

      Returns unknown

    • Creates 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.

      Parameters

      • obj: unknown

      Returns Mask

      import { Mask } from '@nebius/js-sdk/runtime/fieldmask';

      Mask.fromObject({ spec: { disks: [{ size: true }] } }).marshal();
      // "spec.disks.*.size"
    • Parses field-mask text, including grouped paths and wildcards.

      Parameters

      • source: string

      Returns Mask

      Error if the text does not follow field-mask syntax.

    • Creates a mask from a JSON string or an already parsed JavaScript value.

      Parameters

      • source: unknown

      Returns Mask

      SyntaxError if a string contains invalid JSON.