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

    Function ensureResetMaskInMetadata

    • Adds a reset-mask header for an update message when one is not already set.

      The function uses the supplied Metadata object, or creates one when metadata is absent. It does not replace an existing x-resetmask value. It omits the header when msg is null or undefined.

      The SDK normally calls this function for update requests. Call it directly only when you build gRPC metadata outside the standard request API.

      Parameters

      • msg: any
      • Optionalmetadata: Metadata

      Returns Metadata

      The supplied metadata object, or a new metadata object.

      import { Metadata } from '@grpc/grpc-js';
      import {
      ensureResetMaskInMetadata,
      RESET_MASK_HEADER,
      } from '@nebius/js-sdk/runtime/resetmask';

      const metadata = ensureResetMaskInMetadata(
      { displayName: '', enabled: false },
      new Metadata(),
      );
      metadata.get(RESET_MASK_HEADER); // ["displayName,enabled"]

      ErrRecursionTooDeep if the message is too deeply nested.