lib/misc/factories_schema_helpers.js
/**
 * extract a list of all possible fields for a schema
 * (by walking up the inheritance chain)
 * @method extract_all_fields
 *
 */
extract a list of all possible fields for a schema
(by walking up the inheritance chain)
@method extract_all_fields
extract a list of all possible fields for a schema ( by walking up the inheritance chain ) @method extract_all_fields
function extract_all_fields(schema) {
    if (schema._possible_fields) {
        return schema._possible_fields;
    }
    var possible_fields = schema.fields.map(function (field) {
        return field.name;
    });
    var base_schema = get_base_schema(schema);
    if (base_schema) {
        var fields = extract_all_fields(base_schema);
        possible_fields = fields.concat(possible_fields);
    }
    schema._possible_fields = possible_fields;
    return possible_fields;
}
function extract_all_fields ( schema ) { if ( schema . _possible_fields ) { return schema . _possible_fields ; } var possible_fields = schema . fields . map ( function ( field ) { return field . name ; } ) ; var base_schema = get_base_schema ( schema ) ; if ( base_schema ) { var fields = extract_all_fields ( base_schema ) ; possible_fields = fields . concat ( possible_fields ) ; } schema . _possible_fields = possible_fields ; return possible_fields ; }
extract a list of all possible fields for a schema
 (by walking up the inheritance chain)
 @method extract_all_fields
extract a list of all possible fields for a schema ( by walking up the inheritance chain ) @method extract_all_fields
// returns cached result if any // istanbul ignore next // extract the possible fields from the schema. // istanbul ignore next // put in cache to speed up