mirror of
https://github.com/array-in-a-matrix/public-apis.git
synced 2025-04-02 11:11:50 -04:00
22 lines
821 B
JavaScript
22 lines
821 B
JavaScript
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()
|
|
}
|