Move json format functions to formatUtil (#834)

This commit is contained in:
Chenlei Hu
2024-09-15 09:46:34 +09:00
committed by GitHub
parent 9bdb3c0332
commit 347563adf9
3 changed files with 14 additions and 12 deletions

View File

@@ -4,8 +4,9 @@ import { $el } from '../../ui'
import { api } from '../../api'
import { ComfyPopup } from '../components/popup'
import { createSpinner } from '../spinner'
import { ComfyWorkflow, trimJsonExt } from '../../workflows'
import { ComfyWorkflow } from '../../workflows'
import { ComfyAsyncDialog } from '../components/asyncDialog'
import { trimJsonExt } from '@/utils/formatUtil'
import type { ComfyApp } from '@/scripts/app'
import type { ComfyComponent } from '../components'

View File

@@ -4,17 +4,7 @@ import { ChangeTracker } from './changeTracker'
import { ComfyAsyncDialog } from './ui/components/asyncDialog'
import { getStorageValue, setStorageValue } from './utils'
import { LGraphCanvas, LGraph } from '@comfyorg/litegraph'
function appendJsonExt(path: string) {
if (!path.toLowerCase().endsWith('.json')) {
path += '.json'
}
return path
}
export function trimJsonExt(path: string) {
return path?.replace(/\.json$/, '')
}
import { appendJsonExt, trimJsonExt } from '@/utils/formatUtil'
export class ComfyWorkflowManager extends EventTarget {
executionStore: any = null