Skip to content

Commit

Permalink
fix: Remove unnecessary variadic arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
znck committed Feb 10, 2019
1 parent 1500c9d commit 5109471
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ export default class PropTypes {
return prop
}

static arrayOf(...expected) {
return this.collectionOf(Array, expected)
static arrayOf() {
return this.collectionOf(Array, Array.from(arguments))
}

static objectOf(...expected) {
return this.collectionOf(Object, expected)
static objectOf() {
return this.collectionOf(Object, Array.from(arguments))
}

/** @private */
Expand All @@ -151,7 +151,7 @@ export default class PropTypes {
const types = flat(expected).map(normalizeType)

prop.validator = value =>
Object.values(value).every(item =>
(type === Array ? value : Object.values(value)).every(item =>
types.some(type => runValidation(type, item))
)

Expand Down

0 comments on commit 5109471

Please sign in to comment.