Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
JSONWebToken.xcodeproj/xcuserdata

# User specific settings of XCode
xcuserdata/

# macOS specific
.DS_Store
7 changes: 7 additions & 0 deletions JSONWebToken/ClaimValidator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ public func ClaimTransformNumber(_ value : Any) throws -> NSNumber {
throw ClaimValidatorError(message: "\(value) is not a Number type value")
}
}
public func ClaimTransformBool(_ value : Any) throws -> Bool {
if let boolValue = value as? Bool {
return boolValue
} else {
throw ClaimValidatorError(message: "\(value) is not a Bool type value")
}
}
public func ClaimTransformArray<U>(_ elementTransform : (Any) throws -> U, value : Any) throws -> [U] {
if let array = value as? NSArray {
return try array.map(elementTransform)
Expand Down