Skip to content

Commit

Permalink
fix: Remove redundant code from builds (#481)
Browse files Browse the repository at this point in the history
This removes calls to Object.freeze() and Object.assign() from the built
code. The code could not be tree-shook (?) and needed to be flagged as
free of side effects.
  • Loading branch information
matatk authored Aug 28, 2022
1 parent 9ebb1d7 commit 35aeebe
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/code/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@
// User preferences
//

export const defaultBorderSettings = Object.freeze({
export const defaultBorderSettings = /* #__PURE__ */Object.freeze({
borderType: 'momentary',
borderColour: '#ff2f92',
borderFontSize: '16'
})

export const defaultInterfaceSettings =
(BROWSER === 'firefox' || BROWSER === 'opera')
? Object.freeze({ interface: 'popup' })
? /* #__PURE__ */Object.freeze({ interface: 'popup' })
: null

export const defaultFunctionalSettings = Object.freeze({
export const defaultFunctionalSettings = /* #__PURE__ */Object.freeze({
guessLandmarks: true,
closePopupOnActivate: false
})

export const defaultSettings =
(BROWSER === 'firefox' || BROWSER === 'opera')
? Object.freeze(Object.assign({},
? /* #__PURE__ */Object.freeze(/* #__PURE__ */Object.assign({},
defaultBorderSettings,
defaultInterfaceSettings,
defaultFunctionalSettings))
: Object.freeze(Object.assign({},
: /* #__PURE__ */Object.freeze(/* #__PURE__ */Object.assign({},
defaultBorderSettings,
defaultFunctionalSettings))

Expand All @@ -33,15 +33,15 @@ export const defaultSettings =
// Dismissal state of user interface messages
//

export const defaultDismissedSidebarNotAlone = Object.freeze(
export const defaultDismissedSidebarNotAlone = /* #__PURE__ */Object.freeze(
{ dismissedSidebarNotAlone: false })

export const defaultDismissedUpdate = Object.freeze(
export const defaultDismissedUpdate = /* #__PURE__ */Object.freeze(
{ dismissedUpdate: false })

export const defaultDismissalStates =
(BROWSER === 'firefox' || BROWSER === 'opera')
? Object.freeze(Object.assign({},
? /* #__PURE__ */Object.freeze(/* #__PURE__ */Object.assign({},
defaultDismissedSidebarNotAlone,
defaultDismissedUpdate))
: defaultDismissedUpdate

0 comments on commit 35aeebe

Please sign in to comment.