MCPcopy
hub / github.com/guaguaguaxia/weekly_report / getCustomTemplates

Method getCustomTemplates

utils/templateStorage.ts:461–471  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

459
460 // 获取自定义模板
461 static getCustomTemplates(): Template[] {
462 if (typeof window === 'undefined') return [];
463
464 try {
465 const stored = localStorage.getItem(STORAGE_KEY);
466 return stored ? JSON.parse(stored) : [];
467 } catch (error) {
468 console.error('Error reading templates from localStorage:', error);
469 return [];
470 }
471 }
472
473 // 保存自定义模板
474 static saveCustomTemplate(template: Omit<Template, 'id' | 'category' | 'createdAt' | 'useCount'>): string {

Callers 3

getAllTemplatesMethod · 0.95
saveCustomTemplateMethod · 0.95
deleteCustomTemplateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected