## Introduction `@ibenvandeveire/utils` provides framework-agnostic JavaScript utilities that can be used alongside the Angular packages or in any other JavaScript/TypeScript project. ## Installation Install the package first: ```shell npm install @ibenvandeveire/utils ``` ## Versioning and build information This package will follow a semver-like format, `major.minor.patch`, in which: - `major`: Introduces new features and breaking changes - `minor`: Introduces new features and non-breaking changes - `patch`: Fixes bugs and other issues ## Contents ### merge The `merge` util merges all provided values into a single object, as long as the value is defined. It requires a start object to merge the remaining properties into. Each additional property is provided as a tuple of `[key, value]`. When the value is `undefined`, the property is omitted from the result. ```typescript import { merge } from '@ibenvandeveire/utils'; interface Example { id: string; books?: string[]; user?: { name: string }; metaData?: unknown; } const metaData = undefined; const books = ['Hello world', 'Java: How To Program']; const user = { name: 'Test' }; merge( { id: 'test', }, ['books', books], ['user', user], ['metaData', metaData] ); // => result: { id: 'test', books: ['Hello world', 'Java: How To Program'], user: { name: 'Test' } } ```