@@ -24,7 +24,7 @@ const REPLACEMENTS: ReadonlyArray<[string, string]> = [
2424 ' call.reject("Must provide notifications array as notifications option")\n' ,
2525 " return\n" ,
2626 " }\n" ,
27- ' let notifications = call.getArray("notifications", []).compactMap({ $0 as? JSObject }) \n' ,
27+ ' let notifications = call.getArray("notifications", JSObject.self) ?? [] \n' ,
2828 ] . join ( "" ) ,
2929 ] ,
3030 [
@@ -39,7 +39,7 @@ const REPLACEMENTS: ReadonlyArray<[string, string]> = [
3939 ' call.reject("Must supply notifications to cancel")\n' ,
4040 " return\n" ,
4141 " }\n" ,
42- ' let notifications = call.getArray("notifications", []).compactMap({ $0 as? JSObject }) \n' ,
42+ ' let notifications = call.getArray("notifications", JSObject.self) ?? [] \n' ,
4343 " guard notifications.count > 0 else {\n" ,
4444 ' call.reject("Must supply notifications to cancel")\n' ,
4545 " return\n" ,
@@ -58,7 +58,7 @@ const REPLACEMENTS: ReadonlyArray<[string, string]> = [
5858 ' call.reject("Must supply notifications to remove")\n' ,
5959 " return\n" ,
6060 " }\n" ,
61- ' let notifications = call.getArray("notifications", []).compactMap({ $0 as? JSObject }) \n' ,
61+ ' let notifications = call.getArray("notifications", JSObject.self) ?? [] \n' ,
6262 " guard notifications.count > 0 else {\n" ,
6363 ' call.reject("Must supply notifications to remove")\n' ,
6464 " return\n" ,
@@ -75,7 +75,7 @@ const REPLACEMENTS: ReadonlyArray<[string, string]> = [
7575 ' guard call.getValue("types") != nil else {\n' ,
7676 " return\n" ,
7777 " }\n" ,
78- ' let types = call.getArray("types", []).compactMap({ $0 as? JSObject }) \n' ,
78+ ' let types = call.getArray("types", JSObject.self) ?? [] \n' ,
7979 ] . join ( "" ) ,
8080 ] ,
8181 [
0 commit comments