@minso_minso/utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Utils

About

This is a package with utilitary functions and other stuff that's commonly used in a bunch of services. This will be added on continously and splitted up in to several smaller packages if needed in the future.

Modules

Diff

Returns the difference between two objects.

Example:

const obj1 = { a: 'existing data', b: 'to be removed', c: ['to', 'be', 'updated'] }
const obj2 = { a: 'existing data', c: ['updated'], d: { data: 'added' } }
const difference = diff(obj1, obj2)

/*
Output:
{
	added: { d: { data: 'added' } },
	removed: { b: 'to be removed' },
	unchanged: { a: 'existing data' },
	updated: { 
		c: { 
			newValue: ['updated'], 
			oldValue: ['to', 'be', 'updated'] 
		} 
	},
}
*/

Readme

Keywords

Package Sidebar

Install

npm i @minso_minso/utils

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

12.4 kB

Total Files

16

Last publish

Collaborators

  • minso_minso