This commit is contained in:
Jaco Greeff
2019-12-04 12:27:02 +01:00
committed by GitHub
parent f78bf9dde1
commit 64a4bb2e17
12 changed files with 37 additions and 25 deletions
@@ -57,9 +57,12 @@ function initType<T extends Codec = Codec, K extends string = string> (registry:
// An unsafe version of the `createType` below. It's unsafe because the `type`
// argument here can be any string, which, if not parseable, will yield a
// runtime error.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function createTypeUnsafe<T extends Codec = Codec, K extends string = string> (registry: Registry, type: K, params: any[] = [], isPedantic?: boolean): T {
try {
return initType(registry, createClass<T, K>(registry, type), params, isPedantic);
// Circle back to isPedenatic when it handles all cases 100% - as of now,
// it provides false wraning which is more hinderance than help
return initType(registry, createClass<T, K>(registry, type), params); // , isPedantic);
} catch (error) {
throw new Error(`createType(${type}):: ${error.message}`);
}