diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-10-11 22:58:40 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-10-11 22:58:59 +0200 |
commit | e35455435e4df79c3e566efd68b2b0628caeb2eb (patch) | |
tree | d43a3d0e0ad41ed4184782a92f33e815b6590516 | |
parent | 2d7a3853a9962700490441ddde0f2fbc9be18e29 (diff) |
formatting
-rw-r--r-- | lib/wallet/checkable.ts | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/lib/wallet/checkable.ts b/lib/wallet/checkable.ts index 9fd816578..89d0c7150 100644 --- a/lib/wallet/checkable.ts +++ b/lib/wallet/checkable.ts @@ -26,7 +26,7 @@ export namespace Checkable { - type Path = (number|string)[]; + type Path = (number | string)[]; interface SchemaErrorConstructor { new (err: string): SchemaError; @@ -101,8 +101,8 @@ export namespace Checkable { function checkOptional(target: any, prop: Prop, path: Path): any { console.assert(prop.propertyKey); prop.elementChecker(target, - prop.elementProp, - path.concat([prop.propertyKey])); + prop.elementProp, + path.concat([prop.propertyKey])); return target; } @@ -132,13 +132,13 @@ export namespace Checkable { } let propVal = v[prop.propertyKey]; obj[prop.propertyKey] = prop.checker(propVal, - prop, - path.concat([prop.propertyKey])); + prop, + path.concat([prop.propertyKey])); } if (remainingPropNames.size != 0) { throw new SchemaError("superfluous properties " + JSON.stringify(Array.from( - remainingPropNames.values()))); + remainingPropNames.values()))); } return obj; } @@ -163,10 +163,10 @@ export namespace Checkable { function deco(target: Object, propertyKey: string | symbol): void { let chk = mkChk(target); chk.props.push({ - propertyKey: propertyKey, - checker: checkValue, - type: type - }); + propertyKey: propertyKey, + checker: checkValue, + type: type + }); } return deco; @@ -184,11 +184,11 @@ export namespace Checkable { function deco(target: Object, propertyKey: string | symbol): void { let chk = mkChk(target); chk.props.push({ - elementChecker, - elementProp, - propertyKey: propertyKey, - checker: checkList, - }); + elementChecker, + elementProp, + propertyKey: propertyKey, + checker: checkList, + }); } return deco; @@ -206,12 +206,12 @@ export namespace Checkable { function deco(target: Object, propertyKey: string | symbol): void { let chk = mkChk(target); chk.props.push({ - elementChecker, - elementProp, - propertyKey: propertyKey, - checker: checkOptional, - optional: true, - }); + elementChecker, + elementProp, + propertyKey: propertyKey, + checker: checkOptional, + optional: true, + }); } return deco; @@ -220,41 +220,41 @@ export namespace Checkable { export function Number(target: Object, propertyKey: string | symbol): void { let chk = mkChk(target); - chk.props.push({propertyKey: propertyKey, checker: checkNumber}); + chk.props.push({ propertyKey: propertyKey, checker: checkNumber }); } export function AnyObject(target: Object, - propertyKey: string | symbol): void { + propertyKey: string | symbol): void { let chk = mkChk(target); chk.props.push({ - propertyKey: propertyKey, - checker: checkAnyObject - }); + propertyKey: propertyKey, + checker: checkAnyObject + }); } export function Any(target: Object, - propertyKey: string | symbol): void { + propertyKey: string | symbol): void { let chk = mkChk(target); chk.props.push({ - propertyKey: propertyKey, - checker: checkAny, - optional: true - }); + propertyKey: propertyKey, + checker: checkAny, + optional: true + }); } export function String(target: Object, propertyKey: string | symbol): void { let chk = mkChk(target); - chk.props.push({propertyKey: propertyKey, checker: checkString}); + chk.props.push({ propertyKey: propertyKey, checker: checkString }); } function mkChk(target: any) { let chk = target[chkSym]; if (!chk) { - chk = {props: []}; + chk = { props: [] }; target[chkSym] = chk; } return chk; |