mirror of
https://github.com/fawazahmed0/exchange-api.git
synced 2025-08-23 02:48:37 +00:00
don't generate /currencies/{currencyCode}/{currencyCode}
This commit is contained in:
parent
1a0ab54de0
commit
802e9e7fd4
@ -189,19 +189,10 @@ async function generateFiles(googBingCurrJSON) {
|
|||||||
const tempObj = {}
|
const tempObj = {}
|
||||||
tempObj['date'] = dateToday;
|
tempObj['date'] = dateToday;
|
||||||
tempObj[fromKey] = {}
|
tempObj[fromKey] = {}
|
||||||
const fromKeyDir = path.join(rootDir, 'currencies', fromKey)
|
|
||||||
fs.mkdirSync(fromKeyDir, {
|
|
||||||
recursive: true
|
|
||||||
})
|
|
||||||
|
|
||||||
for (const [toKey, toValue] of Object.entries(googBingCurrJSON)) {
|
for (const [toKey, toValue] of Object.entries(googBingCurrJSON))
|
||||||
const tempSingleObj = {}
|
|
||||||
tempObj[fromKey][toKey] = currencyValue(fromValue, toValue)
|
tempObj[fromKey][toKey] = currencyValue(fromValue, toValue)
|
||||||
tempSingleObj['date'] = dateToday;
|
|
||||||
tempSingleObj[toKey] = tempObj[fromKey][toKey]
|
|
||||||
fs.writeFileSync(path.join(fromKeyDir, toKey + '.min.json'), JSON.stringify(tempSingleObj))
|
|
||||||
fs.writeFileSync(path.join(fromKeyDir, toKey + '.json'), JSON.stringify(tempSingleObj, null, indent))
|
|
||||||
}
|
|
||||||
fs.writeFileSync(path.join(currenciesDir, fromKey + '.min.json'), JSON.stringify(tempObj))
|
fs.writeFileSync(path.join(currenciesDir, fromKey + '.min.json'), JSON.stringify(tempObj))
|
||||||
fs.writeFileSync(path.join(currenciesDir, fromKey + '.json'), JSON.stringify(tempObj, null, indent))
|
fs.writeFileSync(path.join(currenciesDir, fromKey + '.json'), JSON.stringify(tempObj, null, indent))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user