mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-05 23:50:08 +00:00
Move json format functions to formatUtil (#834)
This commit is contained in:
@@ -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'
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -22,3 +22,14 @@ export function formatCamelCase(str: string): string {
|
||||
// Join the words with spaces
|
||||
return processedWords.join(' ')
|
||||
}
|
||||
|
||||
export function appendJsonExt(path: string) {
|
||||
if (!path.toLowerCase().endsWith('.json')) {
|
||||
path += '.json'
|
||||
}
|
||||
return path
|
||||
}
|
||||
|
||||
export function trimJsonExt(path: string) {
|
||||
return path.replace(/\.json$/, '')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user