mirror of
https://github.com/olehomelchenko/astrolabe-nvc.git
synced 2025-12-21 21:22:23 +00:00
feat: add snippet sorting by size and update help section with sorting instructions
This commit is contained in:
@@ -225,6 +225,12 @@ const SnippetStorage = {
|
||||
case 'created':
|
||||
comparison = new Date(a.created) - new Date(b.created);
|
||||
break;
|
||||
case 'size':
|
||||
// Calculate size for both snippets
|
||||
const sizeA = new Blob([JSON.stringify(a)]).size;
|
||||
const sizeB = new Blob([JSON.stringify(b)]).size;
|
||||
comparison = sizeA - sizeB;
|
||||
break;
|
||||
case 'modified':
|
||||
default:
|
||||
comparison = new Date(a.modified) - new Date(b.modified);
|
||||
|
||||
Reference in New Issue
Block a user