Support index signature
Opened this issue · 0 comments
diontools commented
config:
interface IndexSigType {
[key: string]: number
}
json:
{
"a": 1,
"b": 2
}
check:
function check(v: any, r: string) {
for (const key of Object.keys(v)) {
if (typeof v[key] === "number") {}
else
throw new TypeError(r + "." + key + " is not Number.")
}
}