@oada/change
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

@oada/change

An implementation of OADA Change

What is OADA Change?

OADA Change is a format that represents an idempotent change to an OADA document.

Usage

Applying a change

import * as oadaChange from '@oada/change';
const document = { a: 1, b: 2, c: 3 };
const change = { b: 4, c: { _delete: true } };
const result = oadaChange.applyChange(document, change);
console.log(result) // { a: 1, b: 4 }

Generating a change

import * as oadaChange from '@oada/change';
const document1 = { a: 1, b: 2, c: 3 };
const document2 = { a: 1, b: 4 };
const change = oadaChange.generateChange(document1, document2);
console.log(change) // { b: 4, c: { _delete: true } }

Readme

Keywords

none

Package Sidebar

Install

npm i @oada/change

Weekly Downloads

0

Version

0.2.2

License

Apache-2.0

Unpacked Size

9.21 kB

Total Files

14

Last publish

Collaborators

  • sanoel
  • serviopalacios
  • aultac
  • awlayton
  • oadao
  • tarakawa
  • cyrusbowman
  • abalmos