     }
   }
 
+  /// Get the value type of a number if possible.
+  ///
+  /// `NSNumber` does not provide an easy way for checking the internal value type. Therefore we first have to check if
+  /// it's a boolean, and if not try to match the CF type to something Swift-y.
+  ///
+  /// - Parameter number: The value to describe
+  /// - Returns: `ValueType` case (may be `any` if no match is found)
   private static func valueType(for number: NSNumber) -> String {
     if CFGetTypeID(number) == CFBooleanGetTypeID() {
       return ValueType.bool

      return [Key.type: ValueType.int]
    } else if dataType == Double.self {
      return [Key.type: ValueType.double]
    } else if dataType == Date.self {
      return [Key.type: ValueType.date]
    } else if dataType == Data.self {
      return [Key.type: ValueType.data]
    } else if let data = data as? NSNumber {
      return [Key.type: valueType(for: data)]

    }
  }

  /// Returns the element value type, if all elements have the same type.
  ///
  /// The problem with `NSNumber` arrays is that they can contain mixed content, such as `[0.1, 2, true]`. Therefore,
  /// we have to check the type of each element.
  ///
  /// - Parameter array: The value to describe
  /// - Returns: `ValueType` case if array is uniform (`nil` otherwise)
  private static func elementValueType(for array: [NSNumber]) -> String? {
    let valueTypes = Set(array.map(valueType(for:)))

