Liking cljdoc? Tell your friends :D

lambdaisland.faker

Create fake values that look "nice", i.e. real-world-ish, so it's quick and easy to populate UIs to get a feel for how they behave.

The single fake function is the main interface, it can do a bunch of things. You can pass it a "path" of something it knows about,

  • (fake [:address :city])
  • (fake [:vehicle :vin])

A partial path will return a map of all nested fakers,

  • (fake [:address]) ;;=> {:country "..", :street_address "...", ....}

A regex will generate values that match the regex

  • (fake #"[A-Z0-9]{3}")

A string is treated as a pattern, use #{} to nest faker paths, using dotted notation, or "#" to put a digit.

  • (fake "#{company.name} GmbH")
  • (fake "##-####-##")

Use a set to pick one of multiple choices

  • (fake #{[:name :first-name] [:name :last-name]})

A map will generate values for each map value. Fakers that are invoked multiple times are memoized. Since a lot of fakers are based on other fakers, this allows you to generate related values.

See the comment at the bottom of the namespace for examples.

Create fake values that look "nice", i.e. real-world-ish, so it's quick and
easy to populate UIs to get a feel for how they behave.

The single [[fake]] function is the main interface, it can do a bunch of
things. You can pass it a "path" of something it knows about,

- (fake [:address :city])
- (fake [:vehicle :vin])

A partial path will return a map of all nested fakers,

- (fake [:address]) ;;=> {:country "..", :street_address "...", ....}

A regex will generate values that match the regex

- (fake #"[A-Z0-9]{3}")

A string is treated as a pattern, use #{} to nest faker paths, using dotted
notation, or "#" to put a digit.

- (fake "#{company.name} GmbH")
- (fake "##-####-##")

Use a set to pick one of multiple choices

- (fake #{[:name :first-name] [:name :last-name]})

A map will generate values for each map value. Fakers that are invoked
multiple times are memoized. Since a lot of fakers are based on other fakers,
this allows you to generate related values.

- (fake {:name [:name :name] :email [:internet :email]})
  ;; => {:name "Freiherrin Marlena Daimer", :email "marlenadaimer@daimerohg.com"}

See the comment at the bottom of the namespace for examples.
raw docstring

*context*clj

source

*locale*clj

source

-fakecljmultimethod

source

alias-fakerclj

(alias-faker to from)
source

clamp-strclj

(clamp-str s len)
source

deep-mergeclj

(deep-merge a b)
source

fakeclj

(fake value)
(fake rng value)

Main faker interface, takes a path, regex, string pattern, or set.

Main faker interface, takes a path, regex, string pattern, or set.
sourceraw docstring

faker-dataclj

source

find-transitclj

(find-transit sections)
source

handle-resultclj

(handle-result rng path result)
source

ingest-transitclj

(ingest-transit f)
source

IRandomcljprotocol

rand-nextclj

(rand-next this)

rand-splitclj

(rand-split this)
source

lookupclj

(lookup path)
source

lookup*clj

(lookup* sections)
source

parse-patternclj

source

random-intclj

(random-int rng max)
source

random-nthclj

(random-nth rng coll)
source

random-spliteratorclj

(random-spliterator)
(random-spliterator seed)
source

slurp-transitclj

(slurp-transit f)
source

transit-pathclj

(transit-path sections)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close