Liking cljdoc? Tell your friends :D

re-com.validate


alert-type?cljs

(alert-type? arg)
source

alert-typescljs

source

alert-types-listcljs

source

align-optionscljs

source

align-options-listcljs

source

align-style?cljs

(align-style? arg)
source

arg-names-known?cljs

(arg-names-known? defined-args passed-args problems)

returns problems conjed with a problem map for every passed-arg that is not in defined-args.

returns problems conjed with a problem map for every passed-arg that is not in defined-args.
sourceraw docstring

button-size?cljs

(button-size? arg)
source

button-sizescljs

source

button-sizes-listcljs

source

css-style?cljs

(css-style? arg)

Returns true if the passed argument is a valid CSS style. Otherwise returns a warning map

Returns true if the passed argument is a valid CSS style.
Otherwise returns a warning map
sourceraw docstring

css-stylescljs

source

date-like?cljs

(date-like? arg)

Returns true if arg satisfies cljs-time.core/DateTimeProtocol typically goog.date.UtcDateTime or goog.date.Date, otherwise false/error.

Returns true if arg satisfies cljs-time.core/DateTimeProtocol typically goog.date.UtcDateTime or goog.date.Date,
otherwise false/error.
sourceraw docstring

extension-attribute?cljs

(extension-attribute? attr)

Returns truthy if the attribute name is an extension attribute, that is data-* or aria-*, otherwise falsey.

Returns truthy if the attribute name is an extension attribute, that is data-* or aria-*, otherwise falsey.
sourceraw docstring

extension-attrscljs

source

extract-arg-datacljs

(extract-arg-data args-desc)

Package up all the relevant data for validation purposes from the xxx-args-desc map into a new map

Package up all the relevant data for validation purposes from the xxx-args-desc map into a new map
sourceraw docstring

hash-map-with-name-keyscljs

(hash-map-with-name-keys v)
source

html-attr?cljs

(html-attr? arg)

Returns true if the passed argument is a valid HTML, SVG or event attribute. Otherwise returns a warning map. Notes:

  • Prevents :class and :style attributes
Returns true if the passed argument is a valid HTML, SVG or event attribute.
Otherwise returns a warning map.
Notes:
 - Prevents :class and :style attributes
sourceraw docstring

html-attrscljs

source

ifn-or-nil?cljs

(ifn-or-nil? arg)

Returns true if the passed argument is a function, keyword or nil, otherwise false/error

Returns true if the passed argument is a function, keyword or nil, otherwise false/error
sourceraw docstring

input-status-type?cljs

(input-status-type? arg)
source

input-status-typescljs

source

input-status-types-listcljs

source

invalid-html-attrscljs

(invalid-html-attrs attrs)

Returns the subset of HTML attributes contained in the passed argument that are not valid HTML attributes.

Returns the subset of HTML attributes contained in the passed argument that are not valid HTML attributes.
sourceraw docstring

justify-optionscljs

source

justify-options-listcljs

source

justify-style?cljs

(justify-style? arg)
source

left-stringcljs

(left-string obj max-len)

Converts obj to a string and truncates it to max-len chars if necessary. When truncation is necessary, adds an elipsis to the end

Converts obj to a string and truncates it to max-len chars if necessary.
When truncation is necessary, adds an elipsis to the end
sourceraw docstring

log-warningcljs

(log-warning & args)

Sends a message to the DeV Tools console as an warning. Returns true to indicate 'not and error' condition

Sends a message to the DeV Tools console as an warning. Returns true to indicate 'not and error' condition
sourceraw docstring

make-code-listcljs

(make-code-list codes)

Given a vector or list of codes, create a [:span] hiccup vector containing a comma separated list of the codes

Given a vector or list of codes, create a [:span] hiccup vector containing a comma separated list of the codes
sourceraw docstring

map-atom?cljs

(map-atom? arg arg-is-atom?)

Returns true if the passed argument is an atom containing a map

Returns true if the passed argument is an atom containing a map
sourceraw docstring

map-or-atom?cljs

(map-or-atom? arg)

Returns true if the passed argument is a map (or a map within an atom), otherwise false/error

Returns true if the passed argument is a map (or a map within an atom), otherwise false/error
sourceraw docstring

nillable-string-or-atom?cljs

(nillable-string-or-atom? arg)

Returns true if the passed argument is a string/nil (or a string/nil within an atom), otherwise false/error

Returns true if the passed argument is a string/nil (or a string/nil within an atom), otherwise false/error
sourceraw docstring

number-or-string?cljs

(number-or-string? arg)

Returns true if the passed argument is a number or a string, otherwise false/error

Returns true if the passed argument is a number or a string, otherwise false/error
sourceraw docstring

parts?cljs

(parts? keys)

Returns a function that validates a value is a map that contains keys mapped to values that are maps containing class, :style and/or :attr.

Returns a function that validates a value is a map that contains `keys` mapped to values that are maps containing
`class`, `:style` and/or `:attr`.
sourceraw docstring

popover-status-type?cljs

(popover-status-type? arg)
source

popover-status-typescljs

source

popover-status-types-listcljs

source

position-optionscljs

source

position-options-listcljs

source

position?cljs

(position? arg)
source

regex?cljs

(regex? arg)

Returns true if the passed argument is a valid regular expression, otherwise false/error

Returns true if the passed argument is a valid regular expression, otherwise false/error
sourceraw docstring

required-args?cljs

(required-args? required-args passed-args problems)

returns problems conjed with a problem map for every required-args that is not in passed-args.

returns problems conjed with a problem map for every required-args that is not in passed-args.
sourceraw docstring

scroll-optionscljs

source

scroll-options-listcljs

source

scroll-style?cljs

(scroll-style? arg)
source

set-or-atom?cljs

(set-or-atom? arg)

Returns true if the passed argument is a set (or a set within an atom), otherwise false/error

Returns true if the passed argument is a set (or a set within an atom), otherwise false/error
sourceraw docstring

string-or-atom?cljs

(string-or-atom? arg)

Returns true if the passed argument is a string (or a string within an atom), otherwise false/error

Returns true if the passed argument is a string (or a string within an atom), otherwise false/error
sourceraw docstring

string-or-hiccup?cljs

(string-or-hiccup? arg)

Returns true if the passed argument is either valid hiccup or a string, otherwise false/error

Returns true if the passed argument is either valid hiccup or a string, otherwise false/error
sourceraw docstring

throbber-size?cljs

(throbber-size? arg)
source

throbber-sizescljs

source

throbber-sizes-listcljs

source

title-level-type?cljs

(title-level-type? arg)
source

title-levelscljs

source

title-levels-listcljs

source

validate-arg-against-setcljs

(validate-arg-against-set arg arg-name valid-set)

Validates the passed argument against the expected set

Validates the passed argument against the expected set
sourceraw docstring

validate-argscljs

(validate-args arg-defs passed-args)

Calls three validation tests:

  • Are arg names valid?
  • Have all required args been passed?
  • Specific validation function calls to check arg values if specified

If they all pass, returns nil.

Normally used as the first function of an or at the beginning of a component render function, so that either the validation problem component will be rendered in place of the component or nil will skip to the component rendering normally.

Used to use {:pre... at the beginning of functions and return booleans. Stopped doing that as throws and causes long ugly stack traces. We rely on walking the dom for data-rc-src attributes in the debug/validate-args-problem component instead.

Calls three validation tests:
 - Are arg names valid?
 - Have all required args been passed?
 - Specific validation function calls to check arg values if specified

If they all pass, returns nil.

Normally used as the first function of an `or` at the beginning of a component render function, so that either the
validation problem component will be rendered in place of the component or nil will skip to the component rendering
normally.

Used to use {:pre... at the beginning of functions and return booleans. Stopped doing that as throws and causes
long ugly stack traces. We rely on walking the dom for data-rc-src attributes in the debug/validate-args-problem
component instead.
sourceraw docstring

validate-args-macroclj/smacro

(validate-args-macro args-desc args)

if goog.DEBUG is true then validate the args, otherwise replace the validation code with nil

if goog.DEBUG is true then validate the args, otherwise replace the validation code with nil
sourceraw docstring

validate-fns?cljs

(validate-fns? args-with-validators passed-args problems)

Gathers together a list of args that have a validator and... returns true if all argument values are valid OR are just warnings (log warning to the console). Otherwise log an error to the console and return false. Validation function args (2 arities supported): - Arg 1: The arg to be validated (note that this is stripped from it's enclosing atom if required, this is always a value) - Arg 2: (optional) true if the arg is wrapped in an atom, otherwise false Validation function return: - true: validation success - false: validation failed - use standard error message - map: validation failed - includes two keys: :status - :error: log to console as error :warning: log to console as warning :message - use this string in the message of the warning/error

Gathers together a list of args that have a validator and...
returns true if all argument values are valid OR are just warnings (log warning to the console).
Otherwise log an error to the console and return false.
Validation function args (2 arities supported):
      - Arg 1:  The arg to be validated (note that this is stripped from it's enclosing atom if required, this is always a value)
      - Arg 2:  (optional) true if the arg is wrapped in an atom, otherwise false
Validation function return:
      - true:   validation success
      - false:  validation failed - use standard error message
      - map:    validation failed - includes two keys:
                                      :status  - :error:   log to console as error
                                                 :warning: log to console as warning
                                      :message - use this string in the message of the warning/error
sourceraw docstring

vector-atom?cljs

(vector-atom? arg arg-is-atom?)

Returns true if the passed argument is an atom containing a vector

Returns true if the passed argument is an atom containing a vector
sourceraw docstring

vector-of-maps?cljs

(vector-of-maps? arg)

Returns true if the passed argument is a vector of maps (either directly or contained in an atom), otherwise false/error Notes:

  • actually it also accepts a list of maps (should we rename this? Potential long/ugly names: sequential-of-maps?, vector-or-list-of-maps?)
  • vector/list can be empty
  • only checks the first element in the vector/list
Returns true if the passed argument is a vector of maps (either directly or contained in an atom), otherwise false/error
Notes:
 - actually it also accepts a list of maps (should we rename this? Potential long/ugly names: sequential-of-maps?, vector-or-list-of-maps?)
 - vector/list can be empty
 - only checks the first element in the vector/list
sourceraw docstring

vector-or-atom?cljs

(vector-or-atom? arg)

Returns true if the passed argument is a vector (or a vector within an atom), otherwise false/error

Returns true if the passed argument is a vector (or a vector within an atom), otherwise false/error
sourceraw docstring

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

× close