refactor: remove deprecated and unused methods

This commit is contained in:
Michel Jonathan Schmitz
2019-02-22 11:09:35 +01:00
parent 4984f78d95
commit 1dbb59b9d7
5 changed files with 272 additions and 273 deletions

View File

@@ -20,7 +20,6 @@ import {basename, join, resolve} from 'path';
import {
ExpectableValidationErrors,
globPromisified,
isThingWithType,
logger,
readFilePromisified,
writeFilePromisified,
@@ -92,26 +91,6 @@ export class Validator {
return this.validator.validate(instance, this.schemas[schemaName]);
}
/**
* Validate an instance of a thing against the consumed schema files
*
* Only use this method for instances of the SC with a set type property
*
* @param instance Instance to validate
* @deprecated Use [[validate]] instead
*/
public validateThing<T>(instance: T): ValidatorResult {
if (!isThingWithType(instance)) {
throw new Error('Instance.type does not exist.');
}
const schemaName = 'SC' + instance.type.split(' ').map((part) => {
return part.substr(0, 1).toUpperCase() + part.substr(1);
}).join('');
return this.validate(instance, schemaName);
}
}
/**