Skip to content

Instantly share code, notes, and snippets.

@bobsilverberg
Created October 30, 2018 18:44
Show Gist options
  • Save bobsilverberg/eac126f78556c63b0aeab30feef52c0f to your computer and use it in GitHub Desktop.
Save bobsilverberg/eac126f78556c63b0aeab30feef52c0f to your computer and use it in GitHub Desktop.
Error ------------------------------------------------------------------------------- src/core/reducers/addons.js:236:22
Cannot assign object literal to addon because:
- property license is missing in PartialExternalAddonVersionType [1] but exists in ExternalAddonVersionType [2] in
property current_version.
- property release_notes is missing in PartialExternalAddonVersionType [1] but exists in ExternalAddonVersionType [2]
in property current_version.
src/core/reducers/addons.js
227| export function createInternalAddon(
228| apiAddon: ExternalAddonType | PartialExternalAddonType,
229| ): AddonType {
230| let addon: AddonType = {
231| authors: apiAddon.authors,
232| average_daily_users: apiAddon.average_daily_users,
233| categories: apiAddon.categories,
234| contributions_url: apiAddon.contributions_url,
235| created: apiAddon.created,
236| current_version: apiAddon.current_version,
237| default_locale: apiAddon.default_locale,
238| description: apiAddon.description,
239| edit_url: apiAddon.edit_url,
240| guid: getGuid(apiAddon),
241| has_eula: apiAddon.has_eula,
242| has_privacy_policy: apiAddon.has_privacy_policy,
243| homepage: apiAddon.homepage,
244| icon_url: apiAddon.icon_url,
:
265| target_locale: apiAddon.target_locale,
266| type: apiAddon.type,
267| url: apiAddon.url,
268| weekly_downloads: apiAddon.weekly_downloads,
269|
270| // These are custom properties not in the API response.
271| currentVersionId: apiAddon.current_version
272| ? apiAddon.current_version.id
273| : null,
274| isRestartRequired: false,
275| isWebExtension: false,
276| isMozillaSignedExtension: false,
277| platformFiles: createPlatformFiles(apiAddon.current_version),
278| themeData: createInternalThemeData(apiAddon),
279| };
280|
281| const currentVersion = apiAddon.current_version;
282|
src/core/types/addons.js
[2] 120| current_version?: ExternalAddonVersionType,
:
[1] 163| current_version?: PartialExternalAddonVersionType,
Found 2 errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment