|
1 | | -import type { ResultItem } from '@/schemas/apiSchema' |
2 | | -import type { operations } from '@/types/comfyRegistryTypes' |
| 1 | +import type { operations } from '@comfyorg/registry-types' |
3 | 2 |
|
4 | 3 | export function formatCamelCase(str: string): string { |
5 | 4 | // Check if the string is camel case |
@@ -194,27 +193,6 @@ export function isValidUrl(url: string): boolean { |
194 | 193 | return false |
195 | 194 | } |
196 | 195 | } |
197 | | -const hasAnnotation = (filepath: string): boolean => |
198 | | - /\[(input|output|temp)\]/i.test(filepath) |
199 | | - |
200 | | -const createAnnotation = (filepath: string, rootFolder = 'input'): string => |
201 | | - !hasAnnotation(filepath) && rootFolder !== 'input' ? ` [${rootFolder}]` : '' |
202 | | - |
203 | | -const createPath = (filename: string, subfolder = ''): string => |
204 | | - subfolder ? `${subfolder}/${filename}` : filename |
205 | | - |
206 | | -/** Creates annotated filepath in format used by folder_paths.py */ |
207 | | -export function createAnnotatedPath( |
208 | | - item: string | ResultItem, |
209 | | - options: { rootFolder?: string; subfolder?: string } = {} |
210 | | -): string { |
211 | | - const { rootFolder = 'input', subfolder } = options |
212 | | - if (typeof item === 'string') |
213 | | - return `${createPath(item, subfolder)}${createAnnotation(item, rootFolder)}` |
214 | | - return `${createPath(item.filename ?? '', item.subfolder)}${ |
215 | | - item.type ? createAnnotation(item.type, rootFolder) : '' |
216 | | - }` |
217 | | -} |
218 | 196 |
|
219 | 197 | /** |
220 | 198 | * Parses a filepath into its filename and subfolder components. |
|
0 commit comments