middleware/modelExport.js
function (exports) {

    var exp = undefined;

    // retrieve the export object
    exports.forEach(function (_export) {

        // Linz's default export function is called export
        if (_export.action && _export.action === 'export') {
            exp = _export;
        }

    });

    // if the export object could not be found, throw an error
    if (!exp) {
        throw new Error('The export was using Linz default export method, yet the model\'s list.export object could not be found.');
    }

    return exp;

}
function (exports) {

    var exp = undefined;

    // retrieve the export object
    exports.forEach(function (_export) {

        // Linz's default export function is called export
        if (_export.action && _export.action === 'export') {
            exp = _export;
        }

    });

    // if the export object could not be found, throw an error
    if (!exp) {
        throw new Error('The export was using Linz default export method, yet the model\'s list.export object could not be found.');
    }

    return exp;

}
function ( exports ) { var exp = undefined ; // retrieve the export object exports . forEach ( function ( _export ) { // Linz's default export function is called export if ( _export . action && _export . action === 'export' ) { exp = _export ; } } ) ; // if the export object could not be found, throw an error if ( ! exp ) { throw new Error ( 'The export was using Linz default export method, yet the model\'s list.export object could not be found.' ) ; } return exp ; }
this will retrieve the export object, using Linz's default export handler amongst custom export handlers this is based on the knowledge that only Linz's default export handler can have an `action` of `export` `exports` should be model.list.export
this will retrieve the export object using Linz s default export handler amongst custom export handlers this is based on the knowledge that only Linz s default export handler can have an action of export exports should be model . list . export