MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / splitClasses

Function splitClasses

web/static/bower_components/angular/angular.js:4798–4814  ·  view source on GitHub ↗
(classes)

Source from the content-addressed store, hash-verified

4796}
4797
4798function splitClasses(classes) {
4799 if (isString(classes)) {
4800 classes = classes.split(' ');
4801 }
4802
4803 // Use createMap() to prevent class assumptions involving property names in
4804 // Object.prototype
4805 var obj = createMap();
4806 forEach(classes, function(klass) {
4807 // sometimes the split leaves empty string values
4808 // incase extra spaces were applied to the options
4809 if (klass.length) {
4810 obj[klass] = true;
4811 }
4812 });
4813 return obj;
4814}
4815
4816// if any other type of options value besides an Object value is
4817// passed into the $animate.method() animation then this helper code

Callers 1

handleCSSClassChangesFunction · 0.85

Calls 3

isStringFunction · 0.85
createMapFunction · 0.85
forEachFunction · 0.85

Tested by

no test coverage detected