archive/v1/util.js
function moRef(type, id) {
		
		if (type && id) {
			return {
				attributes: {
					type: type
				},
				"$value": id
			};
		}
		else if (typeof(type) === 'object') {
			return {
				id: _.get(type, '$value'),
				type: _.get(type, 'attributes.type') || _.get(type, 'attributes.xsi:type')
			};
		}
		return null;
	}
function moRef(type, id) {
		
		if (type && id) {
			return {
				attributes: {
					type: type
				},
				"$value": id
			};
		}
		else if (typeof(type) === 'object') {
			return {
				id: _.get(type, '$value'),
				type: _.get(type, 'attributes.type') || _.get(type, 'attributes.xsi:type')
			};
		}
		return null;
	}
function moRef ( type , id ) { if ( type && id ) { return { attributes : { type : type } , "$value" : id } ; } else if ( typeof ( type ) === 'object' ) { return { id : _ . get ( type , '$value' ) , type : _ . get ( type , 'attributes.type' ) || _ . get ( type , 'attributes.xsi:type' ) } ; } return null ; }
compose or decompose a moRef
compose or decompose a moRef