Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
najs_binding_1.register(driver);
}
this.drivers[name] = {
driverClassName: najs_binding_1.getClassName(driver),
isDefault: isDefault
};
return this;
}
bind(model, driver) {
this.binding[model] = driver;
return this;
}
}
DriverProvider.className = constants_1.NajsEloquent.Provider.DriverProvider;
exports.DriverProvider = DriverProvider;
najs_binding_1.register(DriverProvider, constants_1.NajsEloquent.Provider.DriverProvider);
if (typeof driver === 'function') {
register(driver)
}
this.drivers[name] = {
driverClassName: getClassName(driver),
isDefault: isDefault
}
return this
}
bind(model: string, driver: string): this {
this.binding[model] = driver
return this
}
}
register(DriverProvider, NajsEloquent.Provider.DriverProvider)
index: count
};
return this;
}
bind(model, component) {
if (typeof this.binding[model] === 'undefined') {
this.binding[model] = [];
}
this.binding[model].push(component);
this.binding[model] = functions_1.array_unique(this.binding[model]);
return this;
}
}
ComponentProvider.className = constants_1.NajsEloquent.Provider.ComponentProvider;
exports.ComponentProvider = ComponentProvider;
najs_binding_1.register(ComponentProvider);
isDefault: isDefault,
index: count
}
return this
}
bind(model: string, component: string): this {
if (typeof this.binding[model] === 'undefined') {
this.binding[model] = []
}
this.binding[model].push(component)
this.binding[model] = array_unique(this.binding[model])
return this
}
}
register(ComponentProvider)
static defineRelationProperty: NajsEloquent.Model.ModelMethod = function(name: string) {
if (this['__sample']) {
this['relationName'] = name
return new RelationFactory(this, name, true)
}
if (typeof this['relations'][name] === 'undefined') {
define_relation_property_if_needed(this, name)
this['relations'][name] = {
factory: new RelationFactory(this, name, false)
}
}
return this['relations'][name].factory
}
}
register(ModelRelation)
registerIfNeeded() {
if (!najs_binding_1.ClassRegistry.has(this.getClassName())) {
najs_binding_1.register(Object.getPrototypeOf(this).constructor, this.getClassName(), false);
}
}
newInstance(data) {
register(component, name, isDefault = false) {
if (typeof component === 'function') {
najs_binding_1.register(component);
}
const count = Object.keys(this.components).length;
this.components[name] = {
className: najs_binding_1.getClassName(component),
isDefault: isDefault,
index: count
};
return this;
}
bind(model, component) {
register(component: string | Function, name: string, isDefault: boolean = false): this {
if (typeof component === 'function') {
register(component)
}
const count = Object.keys(this.components).length
this.components[name] = {
className: getClassName(component),
isDefault: isDefault,
index: count
}
return this
}
register(driver, name, isDefault = false) {
if (typeof driver === 'function') {
najs_binding_1.register(driver);
}
this.drivers[name] = {
driverClassName: najs_binding_1.getClassName(driver),
isDefault: isDefault
};
return this;
}
bind(model, driver) {