@irewind/web-utils 21.9.1 → 22.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ yarn lint-staged
package/.oxfmtrc.json CHANGED
@@ -1,4 +1,6 @@
1
1
  {
2
+ "ignorePatterns": ["qr/*/**"],
3
+
2
4
  "printWidth": 80,
3
5
  "arrowParens": "avoid",
4
6
  "bracketSpacing": true,
package/.oxlintrc.json CHANGED
@@ -1,4 +1,10 @@
1
1
  {
2
+ "options": {
3
+ "maxWarnings": 10
4
+ },
5
+
6
+ "ignorePatterns": ["qr/*/**"],
7
+
2
8
  "env": {
3
9
  "browser": true
4
10
  },
@@ -89,10 +95,6 @@
89
95
  "require-post-message-target-origin": "off",
90
96
  "no-unexpected-multiline": "error",
91
97
 
92
- // Following rule has a bug -> not accounting for options
93
- // "no-unassigned-import": ["error", { "allow": ["*.sass"] }],
94
- "no-unassigned-import": "off",
95
-
96
98
  /** Correctness rule overrides */
97
99
  "no-this-in-exported-function": "off",
98
100
  "no-unused-vars": [
@@ -153,6 +155,7 @@
153
155
  "import/export": "error",
154
156
  "import/named": "error",
155
157
  "oxc/branches-sharing-code": "error",
156
- "promise/no-return-in-finally": "error"
158
+ "promise/no-return-in-finally": "error",
159
+ "no-unassigned-import": ["error", { "allow": ["**/*.{sass,scss,css}"] }]
157
160
  }
158
161
  }
@@ -1,11 +1,20 @@
1
1
  {
2
- "oxc.fmt.experimental": true,
3
- "oxc.unusedDisableDirectives": "deny",
4
- "oxc.disableNestedConfig": true,
5
- "oxc.lint.run": "onType",
6
2
  "editor.bracketPairColorization.enabled": true,
7
3
  "editor.guides.bracketPairs": true,
4
+
8
5
  "editor.formatOnSave": true,
9
6
  "editor.defaultFormatter": "oxc.oxc-vscode",
10
- "editor.codeActionsOnSave": ["source.fixAll.oxc"]
7
+ "editor.codeActionsOnSave": ["source.fixAll.oxc"],
8
+
9
+ "[javascript]": {
10
+ "editor.defaultFormatter": "oxc.oxc-vscode",
11
+ "editor.formatOnSave": true
12
+ },
13
+ "[typescript]": {
14
+ "editor.defaultFormatter": "oxc.oxc-vscode",
15
+ "editor.formatOnSave": true
16
+ },
17
+
18
+ "oxc.unusedDisableDirectives": "deny",
19
+ "oxc.disableNestedConfig": true
11
20
  }
@@ -133,7 +133,7 @@ export default {
133
133
  {
134
134
  class: actionsClass.value
135
135
  },
136
- actionPropList.value.map(props => h(QBtn, props))
136
+ actionPropList.value.map(itemProps => h(QBtn, itemProps))
137
137
  )
138
138
  )
139
139
  }
package/auth.js CHANGED
@@ -607,7 +607,7 @@ export function impersonateAsUser(email) {
607
607
  * Debugging methods
608
608
  */
609
609
 
610
- if (process.env.DEBUGGING === true) {
610
+ if (import.meta.env.QUASAR_DEV) {
611
611
  window.scrambleToken = () => {
612
612
  token.value = 'bogus'
613
613
  }
package/config/publish.js CHANGED
@@ -314,12 +314,10 @@ export const channelIframeConfigDefaults = mergeProps(
314
314
  default_lang: 'en',
315
315
  title: {},
316
316
  subtitle1: {
317
- // eslint-disable-next-line no-template-curly-in-string
318
317
  '*': '${concurrent_name}'
319
318
  },
320
319
  subtitle1Mobile: false,
321
320
  subtitle2: {
322
- // eslint-disable-next-line no-template-curly-in-string
323
321
  '*': '<span>${race_name_translated}</span>${race_group_translated}'
324
322
  },
325
323
  subtitle2Mobile: false,
@@ -1,4 +1,4 @@
1
- /* eslint-disable */
1
+ /* oxlint-disable */
2
2
  /*! FORKED!!!!! asmCrypto v0.0.11, (c) 2013 Artem S Vybornov, opensource.org/licenses/MIT */
3
3
  let result = {}
4
4
 
@@ -13,7 +13,7 @@ let engine
13
13
  typeof requestAnimationFrame === 'function' &&
14
14
  typeof cancelAnimationFrame === 'function'
15
15
  ) {
16
- frame = function frame(cb) {
16
+ frame = function frameFn(cb) {
17
17
  const id = Math.random()
18
18
 
19
19
  frames[id] = requestAnimationFrame(function onFrame(time) {
@@ -29,16 +29,16 @@ let engine
29
29
 
30
30
  return id
31
31
  }
32
- cancel = function cancel(id) {
32
+ cancel = function cancelFn(id) {
33
33
  if (frames[id]) {
34
34
  cancelAnimationFrame(frames[id])
35
35
  }
36
36
  }
37
37
  } else {
38
- frame = function frame(cb) {
38
+ frame = function frameFn(cb) {
39
39
  return setTimeout(cb, TIME)
40
40
  }
41
- cancel = function cancel(timer) {
41
+ cancel = function cancelFn(timer) {
42
42
  return clearTimeout(timer)
43
43
  }
44
44
  }
@@ -51,16 +51,16 @@ let engine
51
51
  let prom
52
52
  const resolves = {}
53
53
 
54
- function decorate(worker) {
54
+ function decorate(localWorker) {
55
55
  function execute(options, callback) {
56
- worker.postMessage({ options: options || {}, callback })
56
+ localWorker.postMessage({ options: options || {}, callback })
57
57
  }
58
- worker.init = function initWorker(canvas) {
58
+ localWorker.init = function initWorker(canvas) {
59
59
  const offscreen = canvas.transferControlToOffscreen()
60
- worker.postMessage({ canvas: offscreen }, [offscreen])
60
+ localWorker.postMessage({ canvas: offscreen }, [offscreen])
61
61
  }
62
62
 
63
- worker.fire = function fireWorker(options, size, done) {
63
+ localWorker.fire = function fireWorker(options, size, done) {
64
64
  if (prom) {
65
65
  execute(options, null)
66
66
  return prom
@@ -75,14 +75,14 @@ let engine
75
75
  }
76
76
 
77
77
  delete resolves[id]
78
- worker.removeEventListener('message', workerDone)
78
+ localWorker.removeEventListener('message', workerDone)
79
79
 
80
80
  prom = null
81
81
  done()
82
82
  resolve()
83
83
  }
84
84
 
85
- worker.addEventListener('message', workerDone)
85
+ localWorker.addEventListener('message', workerDone)
86
86
  execute(options, id)
87
87
 
88
88
  resolves[id] = workerDone.bind(null, { data: { callback: id } })
@@ -91,8 +91,8 @@ let engine
91
91
  return prom
92
92
  }
93
93
 
94
- worker.reset = function resetWorker() {
95
- worker.postMessage({ reset: true })
94
+ localWorker.reset = function resetWorker() {
95
+ localWorker.postMessage({ reset: true })
96
96
 
97
97
  for (const id in resolves) {
98
98
  resolves[id]()
@@ -101,7 +101,7 @@ let engine
101
101
  }
102
102
  }
103
103
 
104
- return function getWorker() {
104
+ return function getWorkerFn() {
105
105
  if (worker) {
106
106
  return worker
107
107
  }
@@ -423,10 +423,8 @@ let engine
423
423
 
424
424
  context.clearRect(0, 0, size.width, size.height)
425
425
 
426
- animatingFettis = animatingFettis.filter(
427
- function animatingFettis(fetti) {
428
- return updateFetti(context, fetti)
429
- }
426
+ animatingFettis = animatingFettis.filter(fetti =>
427
+ updateFetti(context, fetti)
430
428
  )
431
429
 
432
430
  if (animatingFettis.length) {
@@ -441,9 +439,8 @@ let engine
441
439
  })
442
440
 
443
441
  return {
444
- addFettis: function addFettis(fettis) {
445
- animatingFettis = animatingFettis.concat(fettis)
446
-
442
+ addFettis(fettisToAdd) {
443
+ animatingFettis = animatingFettis.concat(fettisToAdd)
447
444
  return prom
448
445
  },
449
446
  canvas,
package/howTo/auth.js CHANGED
@@ -2,7 +2,7 @@
2
2
  * Example of Quasar boot file to activate the auth service
3
3
  */
4
4
 
5
- import { defineBoot } from '#q-app/wrappers'
5
+ import { defineBoot } from '#q-app'
6
6
  import {
7
7
  registerAuth0Options,
8
8
  registerLoginFn,
@@ -40,7 +40,7 @@ export default defineBoot(async opts => {
40
40
 
41
41
  const locationStore = useLocationStore()
42
42
 
43
- opts.router.beforeEach((to, _from, next) => {
43
+ opts.router.beforeEach(to => {
44
44
  if (
45
45
  (to.name !== 'home' && isAuthenticated.value === false) ||
46
46
  (to.params.locationId !== void 0 &&
@@ -48,9 +48,7 @@ export default defineBoot(async opts => {
48
48
  Number(to.params.locationId)
49
49
  ) === false)
50
50
  ) {
51
- next({ name: 'home' })
52
- } else {
53
- next()
51
+ return { name: 'home' }
54
52
  }
55
53
  })
56
54
  })
@@ -223,7 +223,8 @@ function onCopyContentClick() {
223
223
 
224
224
  function getValidFilename(str) {
225
225
  // characters forbidden on Windows and reserved everywhere
226
- const invalidChars = /[<>:"/\\|?*\u0000-\u001F]/g // eslint-disable-line no-control-regex
226
+ // oxlint-disable-next-line no-control-regex
227
+ const invalidChars = /[<>:"/\\|?*\u0000-\u001F]/g
227
228
 
228
229
  return (
229
230
  str
@@ -118,8 +118,8 @@ watch(currentSegment, (newSegment, oldSegment) => {
118
118
  }
119
119
  })
120
120
 
121
- function getPlayer(segmentIndex) {
122
- return elementsRef.value.children[segmentIndex]
121
+ function getPlayer(segIndex) {
122
+ return elementsRef.value.children[segIndex]
123
123
  }
124
124
 
125
125
  function pollCurrentTime() {
@@ -102,8 +102,8 @@ export function useMediaPlayer({
102
102
  }
103
103
  })
104
104
 
105
- function getPlayer(segmentIndex) {
106
- return elementsRef.value.children[segmentIndex]
105
+ function getPlayer(segIndex) {
106
+ return elementsRef.value.children[segIndex]
107
107
  }
108
108
 
109
109
  function seekPosition() {
@@ -186,8 +186,8 @@ export default function useJsonVideo(props, emit) {
186
186
  const { skipMetadata } = props
187
187
 
188
188
  const segmentList = await Promise.all(
189
- urlList.map(url =>
190
- getRemoteFileCacheUrl(url).then(url => {
189
+ urlList.map(urlEntry =>
190
+ getRemoteFileCacheUrl(urlEntry).then(url => {
191
191
  if (url === null || signal.aborted) return null
192
192
  const promise =
193
193
  skipMetadata === true
@@ -473,8 +473,8 @@ export default function useJsonVideo(props, emit) {
473
473
  }
474
474
 
475
475
  if (isPlaying.value === true) {
476
- const fn = newState === true ? pause : play
477
- fn()
476
+ const mediaFn = newState === true ? pause : play
477
+ mediaFn()
478
478
 
479
479
  if (hasAnalytics === true) {
480
480
  if (newState === true) {
@@ -936,8 +936,8 @@ export async function parseCompositionPlan({
936
936
  if (entry.start !== void 0) {
937
937
  acc.start = getSlotPosition(entry.start)
938
938
  acc.end = entry.end === -1 ? slotEnd : getSlotPosition(entry.end)
939
- }
940
- else { // legacy
939
+ } else {
940
+ // legacy
941
941
  acc.start = getSlotPosition(entry.delay)
942
942
  acc.end = Math.min(slotEnd, acc.start + entry.cut_duration)
943
943
  }
@@ -973,11 +973,9 @@ export async function parseCompositionPlan({
973
973
  if (slot.job_details === void 0) {
974
974
  chapters.segmentList.push(slotChapter)
975
975
  } else {
976
- const compositionPlan = getCompositionPlan(slot.job_details)
977
-
978
976
  const parseCompositionPlanResponse = await parseCompositionPlan({
979
977
  videoSize,
980
- compositionPlan,
978
+ compositionPlan: getCompositionPlan(slot.job_details),
981
979
  globalSoundTrackSrc: null,
982
980
  elementsOverlayIdMap: {},
983
981
  cropOverlayIdMap: {},
@@ -1005,13 +1003,13 @@ export async function parseCompositionPlan({
1005
1003
  const start = normalize(chapter.start)
1006
1004
  const end = normalize(chapter.end)
1007
1005
  const duration = end - start
1008
- const isCameraSlot =
1006
+ const isCamSlot =
1009
1007
  String(Number(chapter.cameraId)) === chapter.cameraId
1010
1008
 
1011
1009
  return {
1012
1010
  cameraId: `${slotChapter.cameraId}|${chapter.cameraId}`,
1013
1011
  label:
1014
- isCameraSlot === true
1012
+ isCamSlot === true
1015
1013
  ? `Cam ${chapter.cameraId} (${duration.toString().replace(numberSeparatorRE, '_')})`
1016
1014
  : `${capitalize(chapter.cameraId)}`,
1017
1015
  start: slotChapter.start + start,
package/loggly.js CHANGED
@@ -4,7 +4,7 @@ import createGA from './ga.js'
4
4
 
5
5
  let isEnabled = false
6
6
 
7
- const ENABLE = process.env.PROD === true
7
+ const ENABLE = !import.meta.env.QUASAR_DEV
8
8
  // const ENABLE = true
9
9
 
10
10
  const originalError = console.error
@@ -42,9 +42,9 @@ const send = ENABLE
42
42
  xmlHttp.open('POST', TARGET_URL, true) // true for asynchronous request
43
43
  xmlHttp.setRequestHeader('Content-Type', 'application/json')
44
44
  xmlHttp.send(JSON.stringify(data))
45
- } catch (err) {
45
+ } catch (xhrErr) {
46
46
  console.log(
47
- 'Failed to log to loggly because of this exception:\n' + err
47
+ 'Failed to log to loggly because of this exception:\n' + xhrErr
48
48
  )
49
49
  console.log('Failed log data:', data)
50
50
  }
@@ -40,8 +40,8 @@ export function getMediaType(componentProps) {
40
40
 
41
41
  if (componentProps.filename !== void 0) {
42
42
  const lowerCaseFilename = componentProps.filename.toLowerCase()
43
- const match = lowerCaseFilename.match(mediaRegex)
44
- if (match !== null) return mediaMap[match[1]]
43
+ const lowercaseMatch = lowerCaseFilename.match(mediaRegex)
44
+ if (lowercaseMatch !== null) return mediaMap[lowercaseMatch[1]]
45
45
  }
46
46
  }
47
47
 
@@ -88,8 +88,8 @@ export function getFirstEventTimestamp(trackList, ocrFilter = {}) {
88
88
  const { searchByPropName, boxPropName } = ocrFilterPropMap[by]
89
89
 
90
90
  const track = trackList.find(
91
- track =>
92
- track[searchByPropName] === searchTerm && track[boxPropName]?.length > 0
91
+ item =>
92
+ item[searchByPropName] === searchTerm && item[boxPropName]?.length > 0
93
93
  )
94
94
 
95
95
  if (track !== void 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@irewind/web-utils",
3
- "version": "21.9.1",
3
+ "version": "22.0.0",
4
4
  "license": "MIT",
5
5
  "author": "Razvan Stoenescu",
6
6
  "repository": "https://github.com/irewind/irewind-web-utils",
@@ -9,7 +9,9 @@
9
9
  "access": "public"
10
10
  },
11
11
  "scripts": {
12
- "lint": "oxfmt --no-error-on-unmatched-pattern && oxlint --fix"
12
+ "lint": "oxfmt && oxlint --fix",
13
+ "lint:check": "oxfmt --check && oxlint",
14
+ "prepare": "husky"
13
15
  },
14
16
  "dependencies": {
15
17
  "@auth0/auth0-spa-js": "=1.14.0",
@@ -23,11 +25,20 @@
23
25
  "quill": "^1.3.7"
24
26
  },
25
27
  "devDependencies": {
26
- "oxfmt": "^0.28.0",
27
- "oxlint": "^1.43.0"
28
+ "husky": "^9.1.7",
29
+ "lint-staged": "^16.4.0",
30
+ "oxfmt": "^0.42.0",
31
+ "oxlint": "^1.57.0"
28
32
  },
29
33
  "peerDependencies": {
30
- "quasar": "^2.16.4",
34
+ "@quasar/app-vite": "^3.0.0-beta.3",
35
+ "quasar": "^2.19.3",
31
36
  "vue": "^3.0.0"
37
+ },
38
+ "lint-staged": {
39
+ "*.{js,ts,vue,json,css,sass,md}": [
40
+ "oxfmt --no-error-on-unmatched-pattern",
41
+ "oxlint --deny-warnings --fix"
42
+ ]
32
43
  }
33
44
  }
package/qr/scan.js CHANGED
@@ -30,9 +30,9 @@ export async function getCameraList() {
30
30
 
31
31
  function decode(worker, payload) {
32
32
  return new Promise(resolve => {
33
- function onMessage(payload) {
33
+ function onMessage(messagePayload) {
34
34
  worker.removeEventListener('message', onMessage)
35
- resolve(payload.data || null)
35
+ resolve(messagePayload.data || null)
36
36
  }
37
37
 
38
38
  worker.addEventListener('message', onMessage)
@@ -40,13 +40,11 @@ const model = computed({
40
40
  set: val => emit('update:modelValue', val)
41
41
  })
42
42
 
43
- function decode(model) {
44
- if (model === '') {
45
- return null
46
- }
43
+ function decode(str) {
44
+ if (str === '') return null
47
45
 
48
46
  try {
49
- return JSON.parse(model)
47
+ return JSON.parse(str)
50
48
  } catch (e) {
51
49
  return null
52
50
  }
package/table/filters.js CHANGED
@@ -8,9 +8,9 @@ export function getFnCondition(filter) {
8
8
 
9
9
  const operationFn =
10
10
  filter.exact === true
11
- ? content => ` ${filter.exclude === true ? '!' : '='}== '${content}'`
12
- : content =>
13
- `.indexOf('${content}') ${filter.exclude === true ? '===' : '!=='} -1`
11
+ ? val => ` ${filter.exclude === true ? '!' : '='}== '${val}'`
12
+ : val =>
13
+ `.indexOf('${val}') ${filter.exclude === true ? '===' : '!=='} -1`
14
14
 
15
15
  const values = content
16
16
  .split(filter.contentSeparator)
@@ -53,8 +53,8 @@ export function getFnCondition(filter) {
53
53
 
54
54
  const castLimit =
55
55
  filter.compare.type === 'number'
56
- ? val => parseInt(val, 10)
57
- : val => `'${val.replace("'", "\\'")}'`
56
+ ? valToParse => parseInt(valToParse, 10)
57
+ : valToParse => `'${valToParse.replace("'", "\\'")}'`
58
58
 
59
59
  if (filter.compare.lt.length !== 0) {
60
60
  cond.push(`(${rowVal} <${include} ${castLimit(filter.compare.lt)})`)
@@ -165,7 +165,6 @@ export function getFilterFnProps(filter) {
165
165
  }
166
166
 
167
167
  export function getFn(conditionString) {
168
- // eslint-disable-next-line
169
168
  return new Function(`row`, `return ${conditionString}`)
170
169
  }
171
170
 
@@ -21,12 +21,12 @@ export function validateTimingContent(rawContent, source) {
21
21
  new URL('./helpers/worker.validate-top-table.js', import.meta.url)
22
22
  )
23
23
 
24
- function onMessage(payload) {
24
+ function onMessage(messagePayload) {
25
25
  worker.removeEventListener('message', onMessage)
26
26
  worker.terminate()
27
27
 
28
28
  Loading.hide()
29
- resolve(payload.data)
29
+ resolve(messagePayload.data)
30
30
  }
31
31
 
32
32
  worker.addEventListener('message', onMessage)
@@ -1,4 +1,5 @@
1
- const latinRE = /[^A-Za-z0-9\[\]\-\. ]/g // eslint-disable-line no-useless-escape
1
+ // oxlint-disable-next-line no-useless-escape
2
+ const latinRE = /[^A-Za-z0-9\[\]\-\. ]/g
2
3
 
3
4
  const latinMap = {
4
5
  Á: 'A',
@@ -1,4 +1,4 @@
1
- import { defineBoot } from '#q-app/wrappers'
1
+ import { defineBoot } from '#q-app'
2
2
  import { Notify } from 'quasar'
3
3
 
4
4
  import currentVersion from 'app/public/version.json'
@@ -717,12 +717,12 @@ function moveRightwards(amount = 1) {
717
717
  move({ x: amount, y: 0 })
718
718
  }
719
719
 
720
- function zoom(zoomIn = true, acceleration = 1) {
720
+ function zoom(isZoomIn = true, acceleration = 1) {
721
721
  if (props.passive) return
722
722
  const realSpeed = props.zoomSpeed * acceleration
723
723
  const speed = outputWidthComputed.value * PCT_PER_ZOOM * realSpeed
724
724
  let x = 1
725
- if (zoomIn) {
725
+ if (isZoomIn) {
726
726
  x = 1 + speed
727
727
  } else if (thisData.imgData.width > MIN_WIDTH) {
728
728
  x = 1 - speed
@@ -1106,7 +1106,7 @@ function _onVideoLoad(video, initial) {
1106
1106
  canvas.height = videoHeight
1107
1107
  const ctx = canvas.getContext('2d')
1108
1108
  thisData.loading = false
1109
- const drawFrame = initial => {
1109
+ const drawFrame = isInitial => {
1110
1110
  if (!thisData.video) return
1111
1111
  ctx.drawImage(thisData.video, 0, 0, videoWidth, videoHeight)
1112
1112
  const frame = new Image()
@@ -1114,7 +1114,7 @@ function _onVideoLoad(video, initial) {
1114
1114
  frame.onload = () => {
1115
1115
  thisData.img = frame
1116
1116
  // _placeImage()
1117
- if (initial) {
1117
+ if (isInitial) {
1118
1118
  _placeImage()
1119
1119
  } else {
1120
1120
  _draw()
@@ -1125,8 +1125,9 @@ function _onVideoLoad(video, initial) {
1125
1125
  const keepDrawing = () => {
1126
1126
  nextTick(() => {
1127
1127
  drawFrame()
1128
- if (!thisData.video || thisData.video.ended || thisData.video.paused)
1129
- {return}
1128
+ if (!thisData.video || thisData.video.ended || thisData.video.paused) {
1129
+ return
1130
+ }
1130
1131
  requestAnimationFrame(keepDrawing)
1131
1132
  })
1132
1133
  }
@@ -1248,8 +1249,11 @@ function _fileTypeIsValid(file) {
1248
1249
  const type = types[i]
1249
1250
  const t = type.trim()
1250
1251
  if (t.charAt(0) === '.') {
1251
- if (file.name.toLowerCase().split('.').pop() === t.toLowerCase().slice(1))
1252
- {return true}
1252
+ if (
1253
+ file.name.toLowerCase().split('.').pop() === t.toLowerCase().slice(1)
1254
+ ) {
1255
+ return true
1256
+ }
1253
1257
  } else if (t.endsWith('/*')) {
1254
1258
  const fileBaseType = file.type.replace(/\/.*$/, '')
1255
1259
  if (fileBaseType === baseMimetype) {
@@ -1263,7 +1267,7 @@ function _fileTypeIsValid(file) {
1263
1267
  return false
1264
1268
  }
1265
1269
 
1266
- function _placeImage(applyMetadata) {
1270
+ function _placeImage(shouldApplyMetadata) {
1267
1271
  if (!thisData.img) return
1268
1272
  const imgData = thisData.imgData
1269
1273
 
@@ -1310,9 +1314,9 @@ function _placeImage(applyMetadata) {
1310
1314
  }
1311
1315
  }
1312
1316
 
1313
- if (applyMetadata) _applyMetadata()
1317
+ if (shouldApplyMetadata) _applyMetadata()
1314
1318
 
1315
- if (applyMetadata && props.preventWhiteSpace) {
1319
+ if (shouldApplyMetadata && props.preventWhiteSpace) {
1316
1320
  zoom(false, 0)
1317
1321
  } else {
1318
1322
  move({ x: 0, y: 0 })
@@ -1607,8 +1611,8 @@ function _preventZoomingToWhiteSpace() {
1607
1611
  }
1608
1612
  }
1609
1613
 
1610
- function _setOrientation(orientation, applyMetadata) {
1611
- const useOriginal = applyMetadata
1614
+ function _setOrientation(orientation, shouldApplyMetadata) {
1615
+ const useOriginal = shouldApplyMetadata
1612
1616
  if (orientation > 1 || useOriginal) {
1613
1617
  if (!thisData.img) return
1614
1618
  thisData.rotating = true
@@ -1619,10 +1623,10 @@ function _setOrientation(orientation, applyMetadata) {
1619
1623
  )
1620
1624
  _img.onload = () => {
1621
1625
  thisData.img = _img
1622
- _placeImage(applyMetadata)
1626
+ _placeImage(shouldApplyMetadata)
1623
1627
  }
1624
1628
  } else {
1625
- _placeImage(applyMetadata)
1629
+ _placeImage(shouldApplyMetadata)
1626
1630
  }
1627
1631
 
1628
1632
  if (orientation === 2) {