tests.go raw

   1  package objx
   2  
   3  // Has gets whether there is something at the specified selector
   4  // or not.
   5  //
   6  // If m is nil, Has will always return false.
   7  func (m Map) Has(selector string) bool {
   8  	if m == nil {
   9  		return false
  10  	}
  11  	return !m.Get(selector).IsNil()
  12  }
  13  
  14  // IsNil gets whether the data is nil or not.
  15  func (v *Value) IsNil() bool {
  16  	return v == nil || v.data == nil
  17  }
  18