feat: Add DB
This commit is contained in:
22
utils/db/format-resources.js
Normal file
22
utils/db/format-resources.js
Normal file
@@ -0,0 +1,22 @@
|
||||
module.exports = function (tables) {
|
||||
return tables
|
||||
.map(({ name: categoryName, rows }) => {
|
||||
return rows.map(({ link, name: entryName, description: rawDescription }) => {
|
||||
const [description, auth, https, cors] = rawDescription
|
||||
.split('|')
|
||||
.map(item => item.trim())
|
||||
.filter(item => item)
|
||||
|
||||
return {
|
||||
API: entryName,
|
||||
Description: description,
|
||||
Auth: auth?.toLowerCase() === 'no' ? '' : auth,
|
||||
HTTPS: https?.toLowerCase() === 'yes' ? true : false,
|
||||
Cors: cors?.toLowerCase(),
|
||||
Link: link,
|
||||
Category: categoryName,
|
||||
}
|
||||
})
|
||||
})
|
||||
.flat()
|
||||
}
|
||||
Reference in New Issue
Block a user