1.0.7 • Published 4 years ago

ts-trim-object v1.0.7

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

ts-trim-object

Small library which removes empty data from the object.

Usage

1. Install the package

npm i ts-trim-object --save

2. Import module

import 'ts-trim-object';

3. Define yor object

const myObject1 = { property: 'MyProperty', blankProperty:'', array: [] };
const myObject2 = { property: '      ' };
const myObject3 = { property: 'MyProperty',  array: [{ prop: 'PropText', prop2: ''}] };

// remove empty properties
const result1 = myObject1.trimProps();
const result2 = myObject2.trimProps();
const result3 = myObject3.trimProps();

result1 will be

{ property: 'MyProperty' }

result2 will be

{ }

result3 will be

{ property: 'MyProperty', array: [{ prop: 'PropText' }] }

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago