Skip to content

Functions

Returns true if two data types passed in parameters are compatible - so it’s safe to copy the values between two expressions with these two types

▸ areCompatibleDataTypes(type1: DataType,type2: DataType): boolean

Returns boolean


Copy the content of all objests passed in args parameters into target and returns the result NB: This function copies only the first level properties. For a deep copy please use assignDeep

▸ assign(target: any,args: any[]): any

  • target: any - the target object
  • args: any[] - an array of the source objects

Returns any


Copy the content of all objests passed in args parameters into target and returns the result NB: This function make a deep copy - so assignDeep will be called recursively for all object properties on the first level.

▸ assignDeep(target: any,args: any[]): any

  • target: any - the target object
  • args: any[] - an array of the source objects

Returns any


Adds two paths and returns the result Correctly processes leading and trailing slashes

▸ combinePath(path1: string,path2: string): string

  • path1: string
  • path2: string -

Returns string


Searches an array of the objects which implement ItemWithId by ID Returs the found object or null.

▸ findItemById(array: Array<T>,id: any): T

  • array: Array<T>
  • id: any -

Returns T


Generates an unique ID

▸ generateId(): string

Returns string


Searches an array of the objects which implement ItemWithId by ID Returs the index of the found element, or -1 if nothing was found.

▸ indexOfArrayItem(arr: Array<T>,item: T): number

  • arr: Array<T>
  • item: T

Returns number


Returns true if the DataType value passed in the parameter represents some numeric type

▸ isIntType(dtype: DataType): boolean

Returns boolean


Returns true if the value passed in the parameter is an a numeric value

▸ isNumeric(val: any): boolean

  • val: any -

Returns boolean


Returns true if the DataType value passed in the parameter represents some numeric type

▸ isNumericType(dtype: DataType): boolean

Returns boolean


Returns true if the value passed in the parameter is an object

▸ isObject(val: any): boolean

  • val: any -

Returns boolean


Returns true if the property with named propName in the object obj has some value

▸ isPropSet(obj: any,propName: any): any

  • obj: any
  • propName: any -

Returns any


Converts a LinkType value to a string

▸ linkTypeToStr(type: LinkType): string

Returns string


Moves an item in some array to a new position

▸ moveArrayItem(arr: Array<T>,old_index: number,new_index: number): void

  • arr: Array<T>
  • old_index: number
  • new_index: number -

Returns void


Parses the operator’s format string and returns a list of tokens

▸ parseOperatorFormat(operator: any): FormatToken[]

  • operator: any -

Returns FormatToken[]


Searches for a particular item in the array are removes that item if found.

▸ removeArrayItem(arr: Array<T>,value: T): T

  • arr: Array<T>
  • value: T -

Returns T


Calculates the shift on which we need to move our element horizontally to find current window

▸ shiftToFitWindow(absLeft: number,width: number): number

  • absLeft: number
  • width: number -

Returns number


Converts a string to a LinkType value

▸ strToLinkType(str: string): LinkType

  • str: string -

Returns LinkType