Skip to content

Commit

Permalink
Added one more arity to h/repeat, for a fixed number of repeat wher…
Browse files Browse the repository at this point in the history
…e min and max are the same.
  • Loading branch information
green-coder committed Dec 4, 2020
1 parent 1791422 commit f10ebbd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Versions prior to v0.1.0 are considered experimental, their API may change.

## [Unreleased]

### Added

- Added one more arity to `h/repeat`, for a fixed number of repeat where min and max are the same.

## [0.0.10] - 2020-12-05

### Added
Expand Down
12 changes: 7 additions & 5 deletions src/minimallist/helper.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,13 @@
(defn repeat
"Sequence model of a repetition of a model.
If elements-model is a sequence model, it is inlined by default."
[min max elements-model]
{:type :repeat
:min min
:max max
:elements-model elements-model})
([times elements-model]
(repeat times times elements-model))
([min max elements-model]
{:type :repeat
:min min
:max max
:elements-model elements-model}))

(defn ?
"Sequence model of a model being either absent or present."
Expand Down

0 comments on commit f10ebbd

Please sign in to comment.