mirror of
https://github.com/bellingcat/datasheet-server.git
synced 2026-06-11 12:58:32 +03:00
rename source to sheet
This commit is contained in:
@@ -55,27 +55,27 @@ export const idxSearcher = R.curry((attrName, searchValue, myArray) => {
|
||||
|
||||
/* more site specific functions. TODO: maybe move to another folder? */
|
||||
|
||||
export function fmtSourceTitle (name) {
|
||||
export function fmtSheetTitle (name) {
|
||||
return name.replaceAll(' ', '-').toLowerCase()
|
||||
}
|
||||
|
||||
export function fmtBlueprinterTitles (tabs) {
|
||||
const obj = {}
|
||||
Object.keys(tabs).forEach(tab => {
|
||||
const name = fmtSourceTitle(tab)
|
||||
const name = fmtSheetTitle(tab)
|
||||
obj[name] = tabs[tab]
|
||||
})
|
||||
return obj
|
||||
}
|
||||
|
||||
export function deriveFilename (source, tab) {
|
||||
return `${fmtSourceTitle(source)}-${fmtSourceTitle(tab)}.json`
|
||||
export function deriveFilename (sheet, tab) {
|
||||
return `${fmtSheetTitle(sheet)}-${fmtSheetTitle(tab)}.json`
|
||||
}
|
||||
|
||||
export function bp (full) {
|
||||
const blueprint = {
|
||||
name: R.clone(full.name),
|
||||
source: R.clone(full.source),
|
||||
sheet: R.clone(full.sheet),
|
||||
dialects: R.clone(full.dialects),
|
||||
routes: {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user