gd-bs
Version:
Bootstrap JavaScript, TypeScript and Web Components library.
23 lines (22 loc) • 572 B
JavaScript
/**
* Class Names
*/
export class ClassNames {
// Constructor
constructor(items) {
this._items = null;
// Set the items
this._items = items || [];
}
// Gets a class name by type
// The enumerator value is equal to the index + 1
getByType(type) { return this._items[type - 1]; }
// Parse the class names
parse(callback) {
// Parse the items
for (let i = 0; i < this._items.length; i++) {
// Call the callback
callback(this._items[i]);
}
}
}