Home Manual Reference Source Test

Function

Static Public Summary
public

array(array1: Array, array2: Array): Number

This method returns a number indicating whether array1 comes before or after or is the same as the array2 in sort order (ascending order) 1 array1 comes after array2 -1 array1 comes before array2 0 array1 same as array2

public

compare(obj1: Object, obj2: Object): Number

This method returns a number indicating whether obj1 comes before or after or is the same as the obj2 in sort order (ascending order) 1 obj1 comes after obj2 -1 obj1 comes before obj2 0 obj1 same as obj2

public

date(date1: Date, date2: Date): Number

This method returns a number indicating whether date1 comes before or after or is the same as the date2 in sort order (ascending order) 1 date1 comes after date2 -1 date1 comes before date2 0 date1 same as date2

public

diff(oldValue: Object, newValue: Object): Object

This method returns compares to find both are same if not returns the new value

public

is(obj: Object, Type: Object): Boolean

This method is to check the type if obj is null or undefined will always return false if Type is Object will always return true as Object is the super set

public

number(num1: Number, num2: Number): Number

This method returns a number indicating whether num1 comes before or after or is the same as the num2 in sort order (ascending order) 1 num1 comes after num2 -1 num1 comes before num2 0 num1 same as mum2

public

object(obj1: Object, obj2: Object): Number

This method returns a number indicating whether obj1 comes before or after or is the same as the obj2 in sort order (ascending order) 1 obj1 comes after obj2 -1 obj1 comes before obj2 0 obj1 same as obj2

public

string(str1: Object, str2: Object, isCaseSensitive: Boolean): Number

This method returns a number indicating whether str1 comes before or after or is the same as the obj2 in sort order (ascending order) 1 str1 comes after str2 -1 str1 comes before str2 0 str1 same as str2 Its a wrapper to localeCompare function (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare)

Static Public

public array(array1: Array, array2: Array): Number source

This method returns a number indicating whether array1 comes before or after or is the same as the array2 in sort order (ascending order) 1 array1 comes after array2 -1 array1 comes before array2 0 array1 same as array2

Params:

NameTypeAttributeDescription
array1 Array
array2 Array

Return:

Number

public compare(obj1: Object, obj2: Object): Number source

This method returns a number indicating whether obj1 comes before or after or is the same as the obj2 in sort order (ascending order) 1 obj1 comes after obj2 -1 obj1 comes before obj2 0 obj1 same as obj2

Params:

NameTypeAttributeDescription
obj1 Object
obj2 Object

Return:

Number

public date(date1: Date, date2: Date): Number source

This method returns a number indicating whether date1 comes before or after or is the same as the date2 in sort order (ascending order) 1 date1 comes after date2 -1 date1 comes before date2 0 date1 same as date2

Params:

NameTypeAttributeDescription
date1 Date
date2 Date

Return:

Number

public diff(oldValue: Object, newValue: Object): Object source

import diff from '@statetree/diff'

This method returns compares to find both are same if not returns the new value

Params:

NameTypeAttributeDescription
oldValue Object
newValue Object

Return:

Object

public is(obj: Object, Type: Object): Boolean source

import is from '@statetree/diff/lib/is.js'

This method is to check the type if obj is null or undefined will always return false if Type is Object will always return true as Object is the super set

Params:

NameTypeAttributeDescription
obj Object
Type Object

Return:

Boolean

public number(num1: Number, num2: Number): Number source

This method returns a number indicating whether num1 comes before or after or is the same as the num2 in sort order (ascending order) 1 num1 comes after num2 -1 num1 comes before num2 0 num1 same as mum2

Params:

NameTypeAttributeDescription
num1 Number
num2 Number

Return:

Number

public object(obj1: Object, obj2: Object): Number source

This method returns a number indicating whether obj1 comes before or after or is the same as the obj2 in sort order (ascending order) 1 obj1 comes after obj2 -1 obj1 comes before obj2 0 obj1 same as obj2

Params:

NameTypeAttributeDescription
obj1 Object
obj2 Object

Return:

Number

public string(str1: Object, str2: Object, isCaseSensitive: Boolean): Number source

This method returns a number indicating whether str1 comes before or after or is the same as the obj2 in sort order (ascending order) 1 str1 comes after str2 -1 str1 comes before str2 0 str1 same as str2 Its a wrapper to localeCompare function (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare)

Params:

NameTypeAttributeDescription
str1 Object
str2 Object
isCaseSensitive Boolean

Return:

Number