Skip to content

Commit acc77cc

Browse files
committed
fix: error of Deploy to CocoaPods
1 parent d8815a2 commit acc77cc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Sources/ExtSwift/unstable/JSON.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ public extension Dictionary where Key == String, Value == Any {
1717
subscript<T>(key: Key, as type: T.Type) -> T? {
1818
let any = self[key]
1919
return if let value = any as? T { value }
20-
else if let value = any as? NSNumber { value.as(type) }
21-
else if let value = any as? NSString { value.as(type) }
20+
else if let value = any as? NSNumber { value.castTo(type) }
21+
else if let value = any as? NSString { value.castTo(type) }
2222
else { nil }
2323
}
2424
}
@@ -27,14 +27,14 @@ public extension Array where Element == Any {
2727
subscript<T>(index: Index, as type: T.Type) -> T? {
2828
let any = self[try: index]
2929
return if let value = any as? T { value }
30-
else if let value = any as? NSNumber { value.as(type) }
31-
else if let value = any as? NSString { value.as(type) }
30+
else if let value = any as? NSNumber { value.castTo(type) }
31+
else if let value = any as? NSString { value.castTo(type) }
3232
else { nil }
3333
}
3434
}
3535

36-
public extension NSNumber {
37-
func `as`<T>(_ type: T.Type) -> T? {
36+
fileprivate extension NSNumber {
37+
func castTo<T>(_ type: T.Type) -> T? {
3838
if let value = self as? T {
3939
return value
4040
}
@@ -61,7 +61,7 @@ public extension NSNumber {
6161
}
6262
}
6363
public extension NSString {
64-
func `as`<T>(_ type: T.Type) -> T? {
64+
func castTo<T>(_ type: T.Type) -> T? {
6565
if let value = self as? T {
6666
return value
6767
}

0 commit comments

Comments
 (0)