 //  Copyright (c) 2014 Fuji Goro. All rights reserved.
 //
 
+public enum TypeEnforcing {
+    case strict
+    case fuzzy
+    
+    public var isStrict: Bool {
+        return self == .strict
+    }
+    
+    public var isFuzzy: Bool {
+        return self == .fuzzy
+    }
+}
+
+public var TypeEnforcingLevel: TypeEnforcing = .strict
+
 public enum Node {
     case NullValue
     case BooleanValue(Bool)

        return Int(double)
    }
    
    public var uintValue: UInt? {
        guard let intValue = intValue where intValue >= 0 else { return nil }
        return UInt(intValue)
    }
    
    public var stringValue: String? {
        guard case let .StringValue(string) = self else {
            return nil
        }

        }
    }
    
    public var fuzzyBoolValue: Bool? {
        if let strict = strictBoolValue {
            return strict
        } else if let n = strictNumberValue {
            return n > 0
        } else if let s = strictStringValue {
            return Bool(s)
        } else {
            return nil
        }
    }
}

extension Node {
    public var numberValue: Double? {
        switch TypeEnforcingLevel {
        case .strict:
            return strictNumberValue
        case .fuzzy:
            return fuzzyNumberValue
        }
    }
    
    public var strictNumberValue: Double? {
        guard case let .NumberValue(number) = self else {
            return nil
        }
