/**
 *
 * @licstart  The following is the entire license notice for the JavaScript code in this file. 
 *
 * Melinda related modules for recordLoader
 *
 * Copyright (c) 2016 University Of Helsinki (The National Library Of Finland)
 *
 * This file is part of record-loader-melinda
 *
 * record-loader-melinda is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *  
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *  
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @licend  The above is the entire license notice
 * for the JavaScript code in this file.
 *
 **/

/* istanbul ignore next: umd wrapper */
(function (root, factory) {

    'use strict';

    if (typeof define === 'function' && define.amd) {
        define(['record-loader-marc/lib/result-formatters/marc'], factory);
    } else if (typeof module === 'object' && module.exports) {
        module.exports = factory(require('record-loader-marc/lib/result-formatters/marc'));
    }

}(this, factory));

function factory(protoFactory)
{
    
    'use strict';

    return function(parameters)
    {

	var proto = protoFactory(parameters),
	fn_proto_data = proto.data;

	proto.data = function(record)
	{
	    return fn_proto_data(record.record);
	};
	
	return proto;

    }

}
@@ -1219,16 +1219,45 @@
 define(%5B
+%0A%09    'marc-record-js',%0A%09    
 'record-
@@ -1295,16 +1295,18 @@
 rs/marc'
+%0A%09
 %5D, facto
@@ -1406,16 +1406,54 @@
 factory(
+%0A%09    require('marc-record-js'),%0A%09    
 require(
@@ -1500,16 +1500,18 @@
 s/marc')
+%0A%09
 );%0A    %7D
@@ -1549,16 +1549,28 @@
 factory(
+MarcRecord, 
 protoFac
@@ -1742,13 +1742,35 @@
 cord
+, results_level, type
 )%0A%09%7B%0A
+%0A
 %09   
@@ -1795,21 +1795,94 @@
 ata(
-record.record
+type === 'output' ? new MarcRecord(record.record) : record.record, results_level, type
 );%0A%09

Update result formatter to support new features.