cidgoh / DataHarmonizer

A standardized browser-based spreadsheet editor and validator that can be run offline and locally, and which includes templates for SARS-CoV-2 and Monkeypox sampling data. This project, created by the Centre for Infectious Disease Genomics and One Health (CIDGOH), at Simon Fraser University, is now an open-source collaboration with contributions from the National Microbiome Data Collaborative (NMDC), the LinkML development team, and others.
MIT License
91 stars 23 forks source link

Add method for loading data as array of objects #353

Closed pkalita-lbl closed 1 year ago

pkalita-lbl commented 1 year ago

These changes add a DataHarmonizer.loadDataObjects method to compliment DataHarmonizer.getDataObjects. The array of data objects are unpacked into an array of arrays of strings by a new utility function (dataObjectToArray). That function handles joining values of multivalued columns. Most of the conversion of values to strings is done by the native String constructor, except for dates which are string-ified according to the same format used elsewhere. This happens in the new stringifyDatatype utility function in datatypes.js.

Fixes #351