jccp_a/vuepress/node_modules/@algolia/autocomplete-shared/dist/esm/getItemsCount.js
hellcat ac91e1fbe4 1
2025-11-12 17:57:30 +08:00

8 lines
212 B
JavaScript

export function getItemsCount(state) {
if (state.collections.length === 0) {
return 0;
}
return state.collections.reduce(function (sum, collection) {
return sum + collection.items.length;
}, 0);
}