No truly breaking changes; should have been a patch.
slugify()
no longer preserves hyphens and dashes; consequently,producer.slug()
andproduct.slug()
no longer ever includes hyphens or dashes
- remove
globallyUniqueString
(seefake.unique
as a substitute) - remove
factory
- remove
inventoryLot
- remove
warehouseLocation
- fix:
fake.sample
throws when passed array of length0
to fix possible type mismatch - fix:
fake.date
validates arguments (from
/to
) - fix:
fake.array
validates arguments (throws if upper exclusive bound is less than or equal to inclusive lower bound)
- feat: add
fake.unique
, which generates a function returning unique values given a generator function (or throws an error if it's unable to) - feat:
fake.tzid
accepts optional list of TZID strings - feat: use Chance.js to generate all fake data (now reproducible with a seed)
- chore: convert project from Flow to TypeScript
- chore: replace test runner (Mocha) with Jest
- chore: use
@goodeggs/toolkit
to lint project - chore: automatically publish versions from CI
- chore: upgrade all dependencies
- Add
word
andsentence
- Upgrade lodash to ^4.17.11 (fixes a critical security vulnerability discovered in <4.17.11).
- Add TypeScript type definitions
- Fix missing
optional
export
- Add
optional()
, which accepts a function with return valueT
and returnsT | void
.
- BREAKING:
maybe()
now takes a function that returns a value, instead of a value.
array()
generates an array of variable length.
inventoryLot.label()
generates an string like4B2A
.warehouseLocation.label()
generates a string likecD12-1
.warehouseLocation.zone()
generates a string likefrozen
.warehouseLocation.aisle()
,warehouseLocation.rack()
, andwarehouseLocation.shelf()
generate short strings.product.storageType()
generates a string likeflowers
.
- fix a bug in day calculation
- BREAKING:
integerInRange()
renamed tointeger()
.
- BREAKING: remove
foodhub()
,customer()
,employee()
,producer()
, andproduct()
functions in favor of embedded functions that return simple values. - BREAKING:
randomArrayElement()
renamed tosample()
. - BREAKING:
randomString()
renamed tostring()
. - BREAKING:
randomDigit()
renamed todigit()
. - BREAKING:
producer._name()
renamed toproducer.name()
. - BREAKING:
product._name()
renamed toproduct.name()
. - BREAKING: Now exporting default object.
import
pattern may change. maybe()
generatesundefined
,null
, or the passed-in value.number()
generates a random number.boolean()
generates a boolean value.