@uirouter/core/common/predicates | @uirouter/react
Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @uirouter/core/common/predicates

Predicates

These predicates return true/false based on the input. Although these functions are exported, they are subject to change without notice.

Index

Variables

Const isArray

isArray: isArray = Array.isArray

Const isDate

isDate: (x: any) => x is Date = <any>((x: any) => toStr.call(x) === '[object Date]')

Type declaration

    • (x: any): x is Date
    • Parameters

      • x: any

      Returns x is Date

Const isDefined

isDefined: (x?: X) => boolean = not(isUndefined)

Type declaration

    • (x?: X): boolean
    • Parameters

      • Optional x: X

      Returns boolean

Const isFunction

isFunction: (x: any) => x is Function = <any>tis('function')

Type declaration

    • (x: any): x is Function
    • Parameters

      • x: any

      Returns x is Function

Const isNullOrUndefined

isNullOrUndefined: (x?: X) => boolean = or(isNull, isUndefined)

Type declaration

    • (x?: X): boolean
    • Parameters

      • Optional x: X

      Returns boolean

Const isNumber

isNumber: (x: any) => x is number = <any>tis('number')

Type declaration

    • (x: any): x is number
    • Parameters

      • x: any

      Returns x is number

Const isPromise

isPromise: (x: any) => x is Promise<any> = <(x: any) => x is Promise<any>>and(isObject, pipe(prop('then'), isFunction))

Predicate which checks if a value looks like a Promise

It is probably a Promise if it's an object, and it has a then property which is a Function

Type declaration

    • (x: any): x is Promise<any>
    • Parameters

      • x: any

      Returns x is Promise<any>

Const isRegExp

isRegExp: (x: any) => x is RegExp = <any>((x: any) => toStr.call(x) === '[object RegExp]')

Type declaration

    • (x: any): x is RegExp
    • Parameters

      • x: any

      Returns x is RegExp

Const isString

isString: (x: any) => x is string = <(x: any) => x is string>tis('string')

Type declaration

    • (x: any): x is string
    • Parameters

      • x: any

      Returns x is string

Const isUndefined

isUndefined: (Anonymous function) = tis('undefined')

Functions

isInjectable

  • isInjectable(val: any): boolean
  • Predicate which checks if a value is injectable

    A value is "injectable" if it is a function, or if it is an ng1 array-notation-style array where all the elements in the array are Strings, except the last one, which is a Function

    Parameters

    • val: any

    Returns boolean

Const isNull

  • isNull(o: any): boolean

Const isObject

  • isObject(x: any): boolean

Generated using TypeDoc