DataSchema.Array

DataSchema.Array normalizes arbitrary JavaScript array data against a given schema into an object with known properties.

Array of objects

Data
[
    {make:"Chevrolet", model:"Bel Air", year:1957},
    {make:"Dodge", model:"Dart", year:1964},
    {make:"Ford", model:"Mustang", year:1968}
]
    
Schema
{
    resultFields: [{key:"make"}, {key:"model"}, {key:"year"}]
}
    
Normalized data

Array of arrays

Data
[
    ["Chevrolet", "Bel Air", 1957],
    ["Dodge", "Dart", 1964],
    ["Ford", "Mustang", 1968]
]
    
Schema
{
    resultFields: [{key:"make"}, {key:"model"}, {key:"year"}]
}
    
Normalized data

Simple array of primitives

Data
[
    "1957 Chevrolet Bel Air", "1964 Dodge Dart", "1968 Ford Mustang"
]
    
Schema
{
    resultFields: [{key:"make"}, {key:"model"}, {key:"year"}]
}
    
Normalized data