1.0.7 • Published 3 years ago

migrated v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

MIT license

Migrated - simple way to migrate objects.

Migrated is a simple TypeScript library that migrates objects from one version to another.

npm install migrated --save

Simply migrate the object using function:

import { migrated, MigratingData, MigratingFnsc } from 'migrated';

const migratedObject = migrated(
  dataOld as MigratingData, // object that we want to migrate
  migrationFncs as MigratingFnsc, // functions can mutate object, but NOT reassign a new value
  dataNew as MigratingData, // OPTIONAL new data version model, with default values set
);

You can also use helper functions:

import { hydrateData, mergeData } from 'migrated';

Please check the tests!

Inspired by: https://github.com/michi88/encrypted

1.0.7

3 years ago

1.0.6

3 years ago

1.0.2

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago