Fix min max w 1 argument error (#405)
* Add BN min/max * fixes * array 2+ type * assert * rv hardcoding * remove list type * rv import * fix error w 1 arg
This commit is contained in:
@@ -23,8 +23,8 @@ export default function max (
|
||||
...items: BN[]
|
||||
): BN {
|
||||
assert(
|
||||
items && items.length >= 2,
|
||||
'Must provide two or more BN arguments'
|
||||
items && items.length >= 1,
|
||||
'Must provide one or more BN arguments'
|
||||
);
|
||||
|
||||
return items.reduce((acc: BN, val: BN) => BN.max(acc, val), items[0]);
|
||||
|
||||
@@ -23,8 +23,8 @@ export default function min (
|
||||
...items: BN[]
|
||||
): BN {
|
||||
assert(
|
||||
items && items.length >= 2,
|
||||
'Must provide two or more BN arguments'
|
||||
items && items.length >= 1,
|
||||
'Must provide one or more BN arguments'
|
||||
);
|
||||
|
||||
return items.reduce((acc: BN, val: BN) => BN.min(acc, val), items[0]);
|
||||
|
||||
Reference in New Issue
Block a user