feat: add CountEntries to skip decryption for list --detail (#562)

* feat: add CountEntries to skip decryption for list --detail (#549)
* test: add CountEntries and countCategory tests at browser level
* fix: address review feedback on CountRows and countLocalStorage
* test: add CountRows unit tests
This commit is contained in:
Roger
2026-04-07 22:28:39 +08:00
committed by GitHub
parent 5f42d4fe5f
commit b3bbc0dadf
40 changed files with 1009 additions and 101 deletions
+15
View File
@@ -34,3 +34,18 @@ func extractExtensions(path string) ([]types.ExtensionEntry, error) {
return extensions, nil
}
func countExtensions(path string) (int, error) {
data, err := os.ReadFile(path)
if err != nil {
return 0, err
}
var count int
for _, v := range gjson.GetBytes(data, "addons").Array() {
if v.Get("location").String() == "app-profile" {
count++
}
}
return count, nil
}