     }
     
     func decode(_ type: Double.Type, forKey key: K) throws -> Double {
-        return try self.document.assertPrimitive(typeOf: type, forKey: key.stringValue)
+        return try self.decoder.settings.doubleDecodingStrategy.decode(from: decoder, atKey: key)
     }
     
     func decode(_ type: Float.Type, forKey key: K) throws -> Float {

    
    public enum DoubleDecodingStrategy {
        case double
        case stringAndDouble
        case custom(DecodingStrategy<Double>)
    }
    
    public var decodeNullAsNil: Bool = true

    
    func decode(_ type: String.Type) throws -> String {
        if self.decoder.settings.lossyDecodeIntoString {
            return try self.decoder.lossyDecodeString(path: self.path)
        } else {
            return try self.decoder.wrapped.decode(asType: String.self, path: self.path)
        }
    }
    
    func decode(_ type: Double.Type) throws -> Double {
        return try self.decoder.settings.doubleDecodingStrategy.decode(from: decoder)
    }
    
    func decode(_ type: Float.Type) throws -> Float {
