Skip to content

Commit

Permalink
chore!: Upgrade fictional 1.0.0 -> 2.0.0
Browse files Browse the repository at this point in the history
Fixes `someOf()` when range tuple (e.g. `copycat.someOf(seed, [1, 2], ['a','b','c'])`) is given for `range` parameter instead of number (e.g. `copycat.someOf(seed, 2, ['a','b','c'])`). Previously this case would have always (incorrectly) returned an empty array (`[]`).

BREAKING CHANGE
While this fixes a bug, it is still technically a breaking change: if `copycat.someOf()` is currently being given a range tuple (e.g. `copycat.someOf(seed, [1, 2], ['a','b','c'])`), results for the same input would change from (incorrectly) being an empty array (`[]`), to (correctly) being an array of items of a size within the given range.
  • Loading branch information
justinvdm committed Feb 22, 2024
1 parent a20e6bd commit 5b760c6
Show file tree
Hide file tree
Showing 5 changed files with 251 additions and 226 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Takes in an [`input`](#input) value and an array of `values`, repeatedly picks i

```js
copycat.someOf('foo', [1,2], ['paper', 'rock'])
// => []
// => [ 'rock' ]
```

### `copycat.int(input[, options])`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"types": "dist/index.d.ts",
"dependencies": {
"@faker-js/faker": "^8.0.2",
"fictional": "^1.0.0",
"fictional": "^2.0.0",
"string-argv": "^0.3.2",
"uuid": "^8.3.2"
},
Expand Down
Loading

0 comments on commit 5b760c6

Please sign in to comment.