addon/utils/discover-page.js
function transformShareData(result) {
    const transformedResult = Ember.assign(result._source, {
        id: result._id,
        type: 'elastic-search-result',
        workType: result._source['@type'],
        abstract: result._source.description,
        subjects: result._source.subjects.map(each => ({ text: each })),
        subject_synonyms: result._source.subject_synonyms.map(each => ({ text: each })),
        providers: result._source.sources.map(item => ({
            name: item,
        })),
        hyperLinks: [ // Links that are hyperlinks from hit._source.lists.links
            {
                type: 'share',
                url: `${config.OSF.shareBaseUrl}${result._source.type.replace(/ /g, '')}/${result._id}`,
            },
        ],
        infoLinks: [], // Links that are not hyperlinks  hit._source.lists.links
        registrationType: result._source.registration_type, // for registries
    });

    result._source.identifiers.forEach(function(identifier) {
        if (identifier.startsWith('http://')) {
            transformedResult.hyperLinks.push({ url: identifier });
        } else {
            const spl = identifier.split('://');
            const [type, uri] = spl;
            transformedResult.infoLinks.push({ type, uri });
        }
    });

    transformedResult.contributors = transformedResult.lists.contributors ?
        sortContributors(transformedResult.lists.contributors) :
        [];

    // Temporary fix to handle half way migrated SHARE ES
    // Only false will result in a false here.
    transformedResult.contributors.map((contributor) => {
        const contrib = contributor;
        contrib.users.bibliographic = !(contributor.users.bibliographic === false);
        return contrib;
    });

    return transformedResult;
}
function transformShareData(result) {
    const transformedResult = Ember.assign(result._source, {
        id: result._id,
        type: 'elastic-search-result',
        workType: result._source['@type'],
        abstract: result._source.description,
        subjects: result._source.subjects.map(each => ({ text: each })),
        subject_synonyms: result._source.subject_synonyms.map(each => ({ text: each })),
        providers: result._source.sources.map(item => ({
            name: item,
        })),
        hyperLinks: [ // Links that are hyperlinks from hit._source.lists.links
            {
                type: 'share',
                url: `${config.OSF.shareBaseUrl}${result._source.type.replace(/ /g, '')}/${result._id}`,
            },
        ],
        infoLinks: [], // Links that are not hyperlinks  hit._source.lists.links
        registrationType: result._source.registration_type, // for registries
    });

    result._source.identifiers.forEach(function(identifier) {
        if (identifier.startsWith('http://')) {
            transformedResult.hyperLinks.push({ url: identifier });
        } else {
            const spl = identifier.split('://');
            const [type, uri] = spl;
            transformedResult.infoLinks.push({ type, uri });
        }
    });

    transformedResult.contributors = transformedResult.lists.contributors ?
        sortContributors(transformedResult.lists.contributors) :
        [];

    // Temporary fix to handle half way migrated SHARE ES
    // Only false will result in a false here.
    transformedResult.contributors.map((contributor) => {
        const contrib = contributor;
        contrib.users.bibliographic = !(contributor.users.bibliographic === false);
        return contrib;
    });

    return transformedResult;
}
function transformShareData ( result ) { const transformedResult = Ember . assign ( result . _source , { id : result . _id , type : 'elastic-search-result' , workType : result . _source [ '@type' ] , abstract : result . _source . description , subjects : result . _source . subjects . map ( each => ( { text : each } ) ) , subject_synonyms : result . _source . subject_synonyms . map ( each => ( { text : each } ) ) , providers : result . _source . sources . map ( item => ( { name : item , } ) ) , hyperLinks : [ // Links that are hyperlinks from hit._source.lists.links { type : 'share' , url : ` ${ config . OSF . shareBaseUrl } ${ result . _source . type . replace ( / / g , '' ) } ${ result . _id } ` , } , ] , infoLinks : [ ] , // Links that are not hyperlinks  hit._source.lists.links registrationType : result . _source . registration_type , // for registries } ) ; result . _source . identifiers . forEach ( function ( identifier ) { if ( identifier . startsWith ( 'http://' ) ) { transformedResult . hyperLinks . push ( { url : identifier } ) ; } else { const spl = identifier . split ( '://' ) ; const [ type , uri ] = spl ; transformedResult . infoLinks . push ( { type , uri } ) ; } } ) ; transformedResult . contributors = transformedResult . lists . contributors ? sortContributors ( transformedResult . lists . contributors ) : [ ] ; // Temporary fix to handle half way migrated SHARE ES // Only false will result in a false here. transformedResult . contributors . map ( ( contributor ) => { const contrib = contributor ; contrib . users . bibliographic = ! ( contributor . users . bibliographic === false ) ; return contrib ; } ) ; return transformedResult ; }
Make share data look like apiv2 preprints data and pull out identifiers

@private
@method transformShareData
@param {Object} result - hit from a SHARE ES
@return {Object}
Make share data look like apiv2 preprints data and pull out identifiers