mirror of
https://gitlab.com/bramw/baserow.git
synced 2025-05-04 17:00:24 +00:00
11 lines
367 B
JavaScript
11 lines
367 B
JavaScript
export function getPrefills(query) {
|
|
return Object.keys(query).reduce((prefills, key) => {
|
|
if (key.startsWith('prefill_')) {
|
|
const keyFormatted = key
|
|
.replace('prefill_', '') // Remove the prefix
|
|
.replaceAll('+', ' ') // Replace + with spaces
|
|
prefills[keyFormatted] = query[key]
|
|
}
|
|
return prefills
|
|
}, Object.create(null))
|
|
}
|