src/domain/generalMetadata.js
/**
 * Convert a simple object into a `Map` instance.
 * 
 * Property values that are themselves objects will be converted into `Map`
 * instances as well.
 * 
 * @param {object} obj a simple object
 * @returns {Map<string, *>} a Map with string keys; nested Map objects are also handled
 * @see {@link module:domain~stringMapToObject} for the reverse conversion
 * @alias module:domain~objectToStringMap
 */
Convert a simple object into a `Map` instance.

Property values that are themselves objects will be converted into `Map`
instances as well.

@param {object} obj a simple object
@returns {Map} a Map with string keys; nested Map objects are also handled
@see  module:domain~stringMapToObject for the reverse conversion
@alias module:domain~objectToStringMap
Convert a simple object into a ` Map ` instance . Property values that are themselves objects will be converted into ` Map ` instances as well . @param { object } obj a simple object @returns { Map } a Map with string keys ; nested Map objects are also handled @see module : domain~stringMapToObject for the reverse conversion @alias module : domain~objectToStringMap
function objectToStringMap(obj) {
    const strMap = new Map();
    if ( obj ) {
        for (const k of Object.keys(obj)) {
            const v = obj[k];
            strMap.set(k, (typeof v === 'object' ? objectToStringMap(v) : v));
        }
    }
    return strMap;
}
function objectToStringMap ( obj ) { const strMap = new Map ( ) ; if ( obj ) { for ( const k of Object . keys ( obj ) ) { const v = obj [ k ] ; strMap . set ( k , ( typeof v === 'object' ? objectToStringMap ( v ) : v ) ) ; } } return strMap ; }
Convert a simple object into a `Map` instance.
Convert a simple object into a ` Map ` instance .