mirror of
https://github.com/vale981/grapher
synced 2025-03-05 09:31:42 -05:00
_validateAndClean actually accepts param now
This commit is contained in:
parent
bc296b9dc5
commit
0913e08910
1 changed files with 12 additions and 13 deletions
|
@ -53,20 +53,19 @@ export default class Exposure {
|
|||
this.initCountMethod();
|
||||
}
|
||||
|
||||
_validateAndClean() {
|
||||
if (typeof(this.config) === 'function') {
|
||||
const firewall = this.config;
|
||||
this.config = {firewall};
|
||||
_validateAndClean(config) {
|
||||
if (typeof(config) === 'function') {
|
||||
const firewall = config;
|
||||
config = {firewall};
|
||||
}
|
||||
config = ExposureConfigSchema.clean(config);
|
||||
ExposureConfigSchema.validate(config);
|
||||
|
||||
if (config && config.body) {
|
||||
ExposureConfigSchema.validateBody(this.collection, config.body);
|
||||
}
|
||||
|
||||
this.config = ExposureConfigSchema.clean(this.config);
|
||||
ExposureConfigSchema.validate(this.config);
|
||||
|
||||
if (this.config && this.config.body) {
|
||||
ExposureConfigSchema.validateBody(this.collection, this.config.body);
|
||||
}
|
||||
|
||||
return _.extend({}, Exposure.getConfig(), this.config);
|
||||
return _.extend({}, Exposure.getConfig(), config);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue