Sha256: f9ec1506ec66181227905fc44896de0b33b2ff152fb873620164e3853d0e1d6b
Contents?: true
Size: 871 Bytes
Versions: 11
Compression:
Stored size: 871 Bytes
Contents
app.factory('normalizeAttributes', function() { function normalize(type, attributes, parent) { _.forEach(attributes, function(attribute, name) { var path = parent.concat([name]); if (!attribute.options) attribute.options = {}; if (attribute.values != null) attribute.options.values = attribute.values; if (attribute.default != null) attribute.options.default = attribute.default; if (attribute.example != null) attribute.options.example = attribute.example; if ( attribute.type.attributes ) { normalize(attribute.type, attribute.type.attributes, path); }else if( attribute.type.member_attribute ){ normalize(attribute.type.member_attribute.type, attribute.type.member_attribute.type.attributes, path); } }); } return function(type, attributes) { normalize(type, attributes, []); }; });
Version data entries
11 entries across 11 versions & 1 rubygems