Skip to content

Commit 7d560ea

Browse files
committed
update local notifs
1 parent b85e256 commit 7d560ea

File tree

1 file changed

+4
-64
lines changed

1 file changed

+4
-64
lines changed

scripts/patch-capacitor-local-notifications.ts

Lines changed: 4 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -13,72 +13,12 @@ const HANDLER_FILE = resolve(
1313

1414
const REPLACEMENTS: ReadonlyArray<[string, string]> = [
1515
[
16-
[
17-
' guard let notifications = call.getArray("notifications", JSObject.self) else {\n',
18-
' call.reject("Must provide notifications array as notifications option")\n',
19-
" return\n",
20-
" }\n",
21-
].join(""),
22-
[
23-
' guard let notifications = call.getArray("notifications")?.compactMap({ $0 as? JSObject }) else {\n',
24-
' call.reject("Must provide notifications array as notifications option")\n',
25-
" return\n",
26-
" }\n",
27-
].join(""),
28-
],
29-
[
30-
[
31-
' guard let notifications = call.getArray("notifications", JSObject.self), notifications.count > 0 else {\n',
32-
' call.reject("Must supply notifications to cancel")\n',
33-
" return\n",
34-
" }\n",
35-
].join(""),
36-
[
37-
' guard let notifications = call.getArray("notifications")?.compactMap({ $0 as? JSObject }), notifications.count > 0 else {\n',
38-
' call.reject("Must supply notifications to cancel")\n',
39-
" return\n",
40-
" }\n",
41-
].join(""),
42-
],
43-
[
44-
[
45-
' guard let types = call.getArray("types", JSObject.self) else {\n',
46-
" return\n",
47-
" }\n",
48-
].join(""),
49-
[
50-
' guard let types = call.getArray("types")?.compactMap({ $0 as? JSObject }) else {\n',
51-
" return\n",
52-
" }\n",
53-
].join(""),
54-
],
55-
[
56-
[
57-
' guard let notifications = call.getArray("notifications", JSObject.self) else {\n',
58-
' call.reject("Must supply notifications to remove")\n',
59-
" return\n",
60-
" }\n",
61-
].join(""),
62-
[
63-
' guard let notifications = call.getArray("notifications")?.compactMap({ $0 as? JSObject }) else {\n',
64-
' call.reject("Must supply notifications to remove")\n',
65-
" return\n",
66-
" }\n",
67-
].join(""),
16+
'call.getArray("notifications", JSObject.self)',
17+
'call.getArray("notifications")?.compactMap({ $0 as? JSObject })',
6818
],
6919
[
70-
[
71-
' guard let notifications = call.getArray("notifications", JSObject.self), notifications.count > 0 else {\n',
72-
' call.reject("Must supply notifications to remove")\n',
73-
" return\n",
74-
" }\n",
75-
].join(""),
76-
[
77-
' guard let notifications = call.getArray("notifications")?.compactMap({ $0 as? JSObject }), notifications.count > 0 else {\n',
78-
' call.reject("Must supply notifications to remove")\n',
79-
" return\n",
80-
" }\n",
81-
].join(""),
20+
'call.getArray("types", JSObject.self)',
21+
'call.getArray("types")?.compactMap({ $0 as? JSObject })',
8222
],
8323
[
8424
"return bridge?.localURL(fromWebURL: webURL)",

0 commit comments

Comments
 (0)