Skip to content

TypeScript API / laikacms/json-api / toJsonApiNoId

Function: toJsonApiNoId() ​

ts
function toJsonApiNoId<T, O>(data, type): object;

Transforms a domain object to JSON:API resource format (without id)

Type Parameters ​

Type Parameter
T extends string
O extends Record<string, unknown>

Parameters ​

ParameterTypeDescription
dataOThe domain object
typeTJSON:API resource type

Returns ​

object

attributes ​

ts
attributes: O;

type ​

ts
type: T;

Released under the MIT License.