dataschema-array.js revision cfd2e48cfb9596c0698d16bec86559fe7cdcdab5
/**
* Provides a DataSchema implementation which can be used to work with data stored in arrays.
*
* @module dataschema
* @submodule dataschema-array
*/
/**
* Array subclass for the DataSchema Utility.
* @class DataSchema.Array
* @extends DataSchema.Base
* @static
*/
SchemaArray = {
/////////////////////////////////////////////////////////////////////////////
//
// DataSchema.Array static methods
//
/////////////////////////////////////////////////////////////////////////////
/**
* Applies a given schema to given Array data.
*
* @method apply
* @param schema {Object} Schema to apply.
* @param data {Object} Array data.
* @return {Object} Schema-parsed data.
* @static
*/
// Parse results data
}
else {
}
}
else {
Y.log("Array data could not be schema-parsed: " + Y.dump(data) + " " + Y.dump(data), "error", "dataschema-array");
}
return data_out;
},
/**
* Schema-parsed list of results from full data
*
* @method _parseResults
* @param fields {Array} Schema to parse against.
* @param array_in {Array} Array to parse.
* @param data_out {Object} In-progress parsed data to update.
* @return {Object} Parsed data object.
* @static
* @protected
*/
var results = [],
result = {};
type = (LANG.isObject(item) && !LANG.isFunction(item)) ? 2 : (LANG.isArray(item)) ? 1 : (LANG.isString(item)) ? 0 : -1;
if(type > 0) {
}
}
else if(type === 0) {
}
else {
//TODO: null or {}?
result = null;
}
}
return data_out;
}
};