feat: Add DB
This commit is contained in:
14
utils/db/separate-tables.js
Normal file
14
utils/db/separate-tables.js
Normal file
@@ -0,0 +1,14 @@
|
||||
module.exports = function ({ readme, indexListIndex }) {
|
||||
return readme
|
||||
.map((child, i) => {
|
||||
if (i <= indexListIndex) return
|
||||
|
||||
if (child.type === 'heading' && child.depth === 3) {
|
||||
const name = child.children[0].value
|
||||
const rows = readme[i + 1].children
|
||||
|
||||
return { name, rows }
|
||||
}
|
||||
})
|
||||
.filter(table => table)
|
||||
}
|
||||
Reference in New Issue
Block a user