1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-01 14:22:49 +02:00
TableFilter/src/register.js
2019-02-10 00:27:55 +11:00

27 lines
668 B
JavaScript

import {defaultsStr} from './settings';
import {toCamelCase} from './string';
import {FEATURES} from './const';
export class Register {
constructor(tf, cls = {}) {
cls.meta = cls.meta || {};
/**
* TableFilter instance
* @type {TableFilter}
*/
this.tf = tf;
/**
* Feature name, retrieved from alternate class name if found or from
* camelised class name as per TableFilter convention
* @type {String}
*/
this.feature = defaultsStr(cls.meta.altName, toCamelCase(cls.name));
cls.meta.name = this.feature;
FEATURES[this.feature] = cls;
}
}