import { Meta } from '@storybook/addon-docs/blocks'

<Meta title='@dxtmisha/en/functional-basic/Functions/getObjectNoUndefined - Remove properties with an exception value'/>

# `getObjectNoUndefined`

Creates and returns a new object containing only the properties from the source object or array whose values are **not strictly equal** to the exception value. By default, the exception value is `undefined`.

This function is useful for cleaning up data before sending it to a server or for object normalization. When an array is passed, its indices will be converted into string keys in the resulting object.

**Parameters:**
- `data: T` — The source object or array (where `T extends Record<string | number, any>`).
- `exception: any` — The value used as criteria for removal. Defaults to `undefined`.

**Returns:**
`T` — A new object devoid of properties containing the specified exception value.

```typescript
import { getObjectNoUndefined } from '@dxtmisha/functional-basic'

const user = {
  name: 'John',
  age: 25,
  description: undefined, // Will be removed automatically (by default)
  status: 'guest'
}

console.log(getObjectNoUndefined(user)) 
// { name: 'John', age: 25, status: 'guest' }

// Remove all properties mapped to the value 'guest'
console.log(getObjectNoUndefined(user, 'guest'))
// { name: 'John', age: 25, description: undefined }
```
