0.0.1 • Published 6 years ago

@doc.ai/simple-normalizer v0.0.1

Weekly downloads
26
License
Apache-2.0
Repository
github
Last release
6 years ago

node-simple-normalizer

Node.js library that simplfies normalization of session data from importers into known targets.

Usage

import _ from 'lodash';
import Normalize from '@doc.ai/simple-normalizer';

const targets = Normalize({
    // Importer ID which can be retrieved from the package.json name of the importer 
    "ai.doc.neuron.app.selfie" : {
        // Target that can be fulfilled by this importer
        // This specific example will extract the latest result
        age: results => ({
            id: _.get(results, '0.id'),
            value: _.get(results, '0.result.age'),
            service_source: _.get(results, '0.app'),
            omics: _.get(results, '0.omics'),
            updatedAt: _.get(results, '0.updatedAt'),
        }),
    },
    "ai.doc.neuron.app.23andme": {
        riskOfCancer: results => (GetPredictionOfRiskFromModelService(results)),
    }
}, [{... result}])

Authors

See also the list of contributors who participated in this project.