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:
kwingram25
2019-05-09 17:58:51 +02:00
committed by Jaco Greeff
parent 09bbd067b0
commit d8b3021776
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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]);
+2 -2
View File
@@ -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]);