src/app/shared/support/object.utils.ts
Contains common Object/JSON related helper methods.
Methods |
|
Public convertJsonToMap | ||||||||
convertJsonToMap(json: any)
|
||||||||
Defined in src/app/shared/support/object.utils.ts:11
|
||||||||
Convert a JSON object notation to a Map.
Parameters :
Returns :
Map<stringstring>
|
export class ObjectUtils {
/**
* Convert a JSON object notation to a Map.
*/
public static convertJsonToMap(json: any): Map<string, string> {
if (!json) {
return undefined;
}
const map = new Map<string, string>();
Object.keys(json).forEach(key => {
map.set(key, json[key]);
});
return map;
}
}