Skip to content

Releases: supabase-community/copycat

v5.1.0

10 Oct 18:51
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v5.0.0...v5.1.0

v5.0.0

22 Feb 13:45
Compare
Choose a tag to compare

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

08 Feb 16:37
Compare
Choose a tag to compare

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 the values are strings, the picked value will be constrained to be less than limit's amount of characters
  • fallback: string | (input) => string: When limit is specified but no values match the given limit, fallback is called with the given input value.

v4.0.0

07 Feb 16:12
Compare
Choose a tag to compare

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 and max options have been removed in favour of length: number | { min: number, max: number }

v2.0.0

23 Jan 10:31
Compare
Choose a tag to compare

⚠ 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

04 Jan 12:37
Compare
Choose a tag to compare
v2.0.0-rc.1 Pre-release
Pre-release

⚠ 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

31 Dec 19:04
Compare
Choose a tag to compare

Adds copycat.url(input)

Takes in an input and returns a string value resembling a URL.

copycat.url('foo')
// => 'https://noisy-shoe.biz'

v1.1.0

12 Dec 09:17
b05f19b
Compare
Choose a tag to compare

What's Changed

Full Changelog: v0.18.0...v1.1.0

v1.1.0-rc.1

27 Nov 12:49
Compare
Choose a tag to compare
v1.1.0-rc.1 Pre-release
Pre-release

What's Changed

Full Changelog: v1.0.0-rc.1...v1.1.0-rc.1

v1.0.0-rc.1

14 Nov 09:30
Compare
Choose a tag to compare
v1.0.0-rc.1 Pre-release
Pre-release

⚠ 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.