Skip to content

Commit fd29179

Browse files
committed
fix(0.0.9): circular reference
1 parent cee3014 commit fd29179

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,5 @@
7070
},
7171
"type": "module",
7272
"types": "./dist/main.d.ts",
73-
"version": "0.0.8"
73+
"version": "0.0.9"
7474
}

src/core/odometer.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ class LightOdometer {
357357
const digit = this.renderDigit()
358358

359359
const valEl = digit.querySelector<HTMLElement>(".odometer-value")!
360+
360361
valEl.textContent = valueDigit
361362
// In static (non-animated) render, mark as both first and last for CSS hooks
362363
addClass(valEl, "odometer-first-value odometer-last-value")
@@ -572,11 +573,11 @@ class LightOdometer {
572573

573574
const digit = this.renderDigit()
574575

575-
const valEl = digit.querySelector<HTMLElement>(".odometer-value")!
576+
const valEl = digit.querySelector<HTMLElement>(".odometer-value")!
576577

577578
valEl.textContent = value
578579
// In static (non-animated) state, ensure value element has both markers
579-
addClass(valEl, "odometer-first-value odometer-last-value")
580+
addClass(valEl, "odometer-first-value odometer-last-value")
580581
this.digits.push(digit)
581582

582583
return this.insertDigit(digit)
@@ -1023,10 +1024,13 @@ class LightOdometer {
10231024
* @returns {string} A JSON-parseable string representation of the current odometer state.
10241025
*/
10251026
toString(): string {
1027+
const {
1028+
el, ...options
1029+
} = { ...this.getOptions() }
10261030
const snapshot = {
10271031
id: this.options.id,
10281032
value: this.value,
1029-
options: this.getOptions(),
1033+
options,
10301034
globalOptions: LightOdometer.getGlobalOptions(),
10311035
watchMutations: this.watchMutations,
10321036
transitionEndBound: this.transitionEndBound,

0 commit comments

Comments
 (0)