refractor: change var name

This commit is contained in:
Sped0n
2023-08-13 22:33:47 +08:00
parent c2f9627717
commit b1415b7f17
8 changed files with 34 additions and 34 deletions

View File

@@ -1,9 +1,9 @@
import { type ImageData } from './utils'
// fetch images info from JSON
const imageArrayElement = document.getElementById('images_array') as HTMLScriptElement
const rawImageArray = imageArrayElement.textContent as string
export const imagesArray: ImageData[] = JSON.parse(rawImageArray).sort(
const imageArrayElement = document.getElementById('images_info') as HTMLScriptElement
const rawImagesInfo = imageArrayElement.textContent as string
export const imagesInfo: ImageData[] = JSON.parse(rawImagesInfo).sort(
(a: ImageData, b: ImageData) => {
if (a.index < b.index) {
return -1
@@ -11,4 +11,4 @@ export const imagesArray: ImageData[] = JSON.parse(rawImageArray).sort(
return 1
}
)
export const imagesArrayLen: number = imagesArray.length
export const imagesLen: number = imagesInfo.length