Releases: supabase-community/copycat
v5.1.0
What's Changed
- fix: API docs typo by @jamescd18 in #62
- fix: patch fictional package by @HamishBuckmaster in #64
- chore: Upgrade fictional in 6a3230c
New Contributors
- @jamescd18 made their first contribution in #62
- @HamishBuckmaster made their first contribution in #64
Full Changelog: v5.0.0...v5.1.0
v5.0.0
chore!: Upgrade fictional 1.0.0 -> 2.0.0
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.
Full Changelog: v4.1.0...v5.0.0
v4.1.0
feat: Support oneOfString()
copycat.oneOfString(input, values[, options])
Like oneOf()
, takes in an input
value and an array of values
, and returns an item in values
that corresponds to that input
. However, values
needs to be an array of string values, and only values within the character limit set by the limit
option will be picked.
copycat.oneOfString('foo', ['short', 'loooooooong'], { limit: 6 })
// => 'short'
options
limit
: If thevalues
are strings, the picked value will be constrained to be less thanlimit
's amount of charactersfallback: string | (input) => string
: Whenlimit
is specified but no values match the givenlimit
, fallback is called with the given input value.
v4.0.0
What's Changed
- feat!: Replace phoneNumber {min,max} options with {min,max}Length by @justinvdm in #58
// before
copycat.phoneNumber(input, { min: 100000, max: 999999999 })
copycat.phoneNumber(input, { min: 100000000, max: 999999999 })
// after
copycat.phoneNumber(input, { length: { min: 6, max: 9 } })
copycat.phoneNumber(input, { length: 9 })
BREAKING CHANGES
- In the cases where the
prefixes
option is provided, copycat will now return a different output for the same input - The
min
andmax
options have been removed in favour oflength: number | { min: number, max: number }
v2.0.0
⚠ BREAKING CHANGES
copycat.float()
method has been rewritten: previously, output values would stay close to the min
value give. With this release, output values will distribute more evenly across the (min, max) range of values.
This means that inputs for copycat.float()
will now map to a different output. It is still deterministic - the same input will always map to the same output. It is just that after the upgrade the corresponding output for each input will have changed.
v2.0.0-rc.1
⚠ BREAKING CHANGES
copycat.float()
method has been rewritten: previously, output values would stay close to the min
value give. With this release, output values will distribute more evenly across the (min, max) range of values.
This means that inputs for copycat.float()
will now map to a different output. It is still deterministic - the same input will always map to the same output. It is just that after the upgrade the corresponding output for each input will have changed.
Migration notice:
We will release this change onto the main branch as v2.0.0 on 23 January 2024 at 12:00pm (noon) UTC. In the meantime, you can try out the new behaviour by using:
import { copycat } from '@snaplet/copycat/next'
v1.2.0
v1.1.0
v1.1.0-rc.1
What's Changed
- feat: add options to phone number by @avallete in #51
- feat: add unique and uniqueByInput methods by @avallete in #52
Full Changelog: v1.0.0-rc.1...v1.1.0-rc.1
v1.0.0-rc.1
⚠ BREAKING CHANGES
- The
phoneNumber
method has been rewriten to reduce the chances of colisions for it. Their value will change between the v0.18.1 and v1.0.0
Migration notice:
We will release this change onto the main branch in 4 weeks (12 December 2023). In the meantime you can try out the new behaviour by using:
import { copycat } from '@snaplet/copycat/next'
and adapt your usage accordingly.