UNPKG

656 BPlain TextView Raw
1import * as AWS from 'aws-sdk';
2import {IResponse, response} from './tools';
3
4AWS.config.update({region: 'us-east-1'}); // Virginia
5
6
7
8export class ToolsUtils {
9
10
11 constructor() {
12
13 }
14
15 public async removeEmptyStringElements(obj) {
16 try {
17 for (let prop in obj) {
18 if (typeof obj[prop] === 'object') {// dive deeper in
19 await this.removeEmptyStringElements(obj[prop]);
20 } else if (obj[prop] === '') {// delete elements that are empty strings
21 delete obj[prop];
22 }
23 }
24 return obj;
25 } catch (error) {
26
27 }
28 }
29}
\No newline at end of file