Adjust ietartion argument check (#5156)

This commit is contained in:
Jaco
2022-08-13 10:03:25 +03:00
committed by GitHub
parent cc953efd58
commit 8ec5c2abc3
2 changed files with 4 additions and 2 deletions
@@ -219,8 +219,8 @@ function extendPrefixedMap (registry: Registry, itemFn: CreateItemFn, storageFn:
const { meta: { type }, method, section } = itemFn;
storageFn.iterKey = extendHeadMeta(registry, itemFn, storageFn, (...args: unknown[]): Raw => {
if (args.length && (type.isPlain || (args.length > type.asMap.hashers.length))) {
throw new Error(`Iteration ${stringCamelCase(section || 'unknown')}.${stringCamelCase(method || 'unknown')} needs arguments to be at least one less than the full arguments, found [${args.join(', ')}]`);
if (args.length && (type.isPlain || (args.length >= type.asMap.hashers.length))) {
throw new Error(`Iteration of ${stringCamelCase(section || 'unknown')}.${stringCamelCase(method || 'unknown')} needs arguments to be at least one less than the full arguments, found [${args.join(', ')}]`);
}
if (args.length) {