UNPKG

@ankimcp/anki-mcp-server

Version:

Model Context Protocol server for Anki - enables AI assistants to interact with your Anki flashcards

21 lines • 720 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isDescendantOf = isDescendantOf; exports.getRootDeckNames = getRootDeckNames; exports.rollupDeckTotal = rollupDeckTotal; function isDescendantOf(deckName, ancestor) { return deckName.startsWith(`${ancestor}::`); } function getRootDeckNames(allDeckNames) { return allDeckNames.filter((name) => !name.includes("::")); } function rollupDeckTotal(deckName, perDeckOwnTotal) { let sum = perDeckOwnTotal.get(deckName) ?? 0; for (const [name, total] of perDeckOwnTotal) { if (isDescendantOf(name, deckName)) { sum += total; } } return sum; } //# sourceMappingURL=deck-hierarchy.utils.js.map