Skip to content

TypeScript API / laikacms/json-api / decodeAtomicOperation

Variable: decodeAtomicOperation ​

ts
const decodeAtomicOperation: (input, options?) => 
  | {
  data: {
     attributes?: {
      [key: string]: any;
     };
     id?: string;
     relationships?: {
      [key: string]: any;
     };
     type: string;
  };
  op: "add";
}
  | {
  data: {
     attributes?: {
      [key: string]: any;
     };
     id: string;
     relationships?: {
      [key: string]: any;
     };
     type: string;
  };
  op: "update";
}
  | {
  op: "remove";
  ref: {
     id: string;
     type: string;
  };
};

Parameters ​

ParameterType
inputunknown
options?ParseOptions

Returns ​

| { data: { attributes?: { [key: string]: any; }; id?: string; relationships?: { [key: string]: any; }; type: string; }; op: "add"; } | { data: { attributes?: { [key: string]: any; }; id: string; relationships?: { [key: string]: any; }; type: string; }; op: "update"; } | { op: "remove"; ref: { id: string; type: string; }; }

Released under the MIT License.