@dvxch/yandex-music
    Preparing search index...

    Function assign

    • Copy a set of scalar fields straight from a raw JSON object onto a model.

      The API already returns keys in camelCase, matching the library's field names, so plain pass-through copying is correct for primitive fields. Nested objects and arrays of models are handled explicitly by each model's deJson.

      Type Parameters

      • T extends object

        The model type being populated.

      Parameters

      • target: T

        The model instance to assign onto.

      • raw: JSONObject

        The raw JSON object from the API.

      • keys: readonly (keyof T & string)[]

        The field names to copy when present in raw.

      Returns void