LEFT | RIGHT |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 url, RegExpFilter.typeMap.DOCUMENT, host, false, null, false); | 207 url, RegExpFilter.typeMap.DOCUMENT, host, false, null, false); |
208 } | 208 } |
209 catch (e) {} | 209 catch (e) {} |
210 return null; | 210 return null; |
211 } | 211 } |
212 | 212 |
213 function checkData(data, check) | 213 function checkData(data, check) |
214 { | 214 { |
215 if (!data) return false; | 215 if (!data) return false; |
216 const properties = [].concat(check || []); | 216 const properties = [].concat(check || []); |
217 return properties.every(function(item) { | 217 return properties.every(function(item) |
| 218 { |
218 return item in data; | 219 return item in data; |
219 }); | 220 }); |
220 } | 221 } |
221 | 222 |
222 function successData(value) | 223 function successData(value) |
223 { | 224 { |
224 const data = {}; | 225 const data = {}; |
225 data.success = true; | 226 data.success = true; |
226 if (value != null) data.value = value; | 227 if (value != null) data.value = value; |
227 return data; | 228 return data; |
228 } | 229 } |
229 | 230 |
230 function errorData(errorMsg) | 231 function errorData(errorMsg) |
231 { | 232 { |
232 const data = {}; | 233 const data = {}; |
233 if (errorMsg) data.error = errorMsg; | 234 if (errorMsg) data.error = errorMsg; |
234 return data; | 235 return data; |
235 } | 236 } |
236 | 237 |
237 init(); | 238 init(); |
LEFT | RIGHT |