@advjs/ai
Version:
AI module for AdvJS
17 lines (15 loc) • 308 B
text/typescript
import type { AdvAIConfig } from './types'
/**
* 遍历 chapters nodes
*/
export function walkChapterNodes({ json }: {
json: AdvAIConfig
}) {
const nodes: string[] = []
json.chapters.forEach((chapter) => {
chapter.nodes.forEach((node) => {
nodes.push(node.id)
})
})
return nodes
}