func equals(v1, v2 interface{}) bool {
	v1Type := jsonType(v1)
	if v1Type != jsonType(v2) {
		return false
	}

	if om, ok := v1.(*OrderedMap); ok {
		v1 = om.RawValues()
	}

	if om, ok := v2.(*OrderedMap); ok {
		v2 = om.RawValues()
	}

	switch v1Type {
	case "array":
		arr1, arr2 := v1.([]interface{}), v2.([]interface{})
		if len(arr1) != len(arr2) {
			return false
		}
		for i := range arr1 {
			if !equals(arr1[i], arr2[i]) {
				return false
			}
		}
		return true
	case "object":
		obj1, obj2 := v1.(map[string]interface{}), v2.(map[string]interface{})
		if len(obj1) != len(obj2) {
			return false
		}
		for k, v1 := range obj1 {
			if v2, ok := obj2[k]; ok {
				if !equals(v1, v2) {
					return false
				}
			} else {
				return false
			}
		}
		return true
	case "number":
		num1, _ := new(big.Rat).SetString(fmt.Sprint(v1))
		num2, _ := new(big.Rat).SetString(fmt.Sprint(v2))
		return num1.Cmp(num2) == 0
	default:
		return v1 == v2
	}
}
// equals tells if given two json values are equal or not.
equals tells if given two json values are equal or not.
// equals tells if given two json values are equal or not .
func equals(v1, v2 interface{}) bool {
	v1Type := jsonType(v1)
	if v1Type != jsonType(v2) {
		return false
	}
	if om, ok := v1.(*OrderedMap); ok {
		v1 = om.RawValues()
	}
	if om, ok := v2.(*OrderedMap); ok {
		v2 = om.RawValues()
	}
	switch v1Type {
	case "array":
		arr1, arr2 := v1.([]interface{}), v2.([]interface{})
		if len(arr1) != len(arr2) {
			return false
		}
		for i := range arr1 {
			if !equals(arr1[i], arr2[i]) {
				return false
			}
		}
		return true
	case "object":
		obj1, obj2 := v1.(map[string]interface{}), v2.(map[string]interface{})
		if len(obj1) != len(obj2) {
			return false
		}
		for k, v1 := range obj1 {
			if v2, ok := obj2[k]; ok {
				if !equals(v1, v2) {
					return false
				}
			} else {
				return false
			}
		}
		return true
	case "number":
		num1, _ := new(big.Rat).SetString(fmt.Sprint(v1))
		num2, _ := new(big.Rat).SetString(fmt.Sprint(v2))
		return num1.Cmp(num2) == 0
	default:
		return v1 == v2
	}
}
func equals ( v1 , v2 interface { } ) bool { v1Type := jsonType ( v1 ) if v1Type != jsonType ( v2 ) { return false } if om , ok := v1 . ( * OrderedMap ) ; ok { v1 = om . RawValues ( ) } if om , ok := v2 . ( * OrderedMap ) ; ok { v2 = om . RawValues ( ) } switch v1Type { case " " : arr1 , arr2 := v1 . ( [ ] interface { } ) , v2 . ( [ ] interface { } ) if len ( arr1 ) != len ( arr2 ) { return false } for i := range arr1 { if ! equals ( arr1 [ i ] , arr2 [ i ] ) { return false } } return true case " " : obj1 , obj2 := v1 . ( map [ string ] interface { } ) , v2 . ( map [ string ] interface { } ) if len ( obj1 ) != len ( obj2 ) { return false } for k , v1 := range obj1 { if v2 , ok := obj2 [ k ] ; ok { if ! equals ( v1 , v2 ) { return false } } else { return false } } return true case " " : num1 , _ := new ( big . Rat ) . SetString ( fmt . Sprint ( v1 ) ) num2 , _ := new ( big . Rat ) . SetString ( fmt . Sprint ( v2 ) ) return num1 . Cmp ( num2 ) == 0 default : return v1 == v2 } }
equals tells if given two json values are equal or not.
equals tells if given two json values are equal or not .