Move components from flat src/lib/components/ into recipes/, faith/, and cospend/ subdirectories. Replace ~144 relative imports across API routes and lib files with $models, $utils, $types, and $lib aliases. Add $types alias to svelte.config.js. Remove unused EditRecipe.svelte.
15 lines
257 B
JavaScript
15 lines
257 B
JavaScript
/**
|
|
* @param {KeyboardEvent} event
|
|
* @param {string} key
|
|
* @param {boolean} needsctrl
|
|
* @param {() => void} fn
|
|
*/
|
|
export function do_on_key(event, key, needsctrl, fn){
|
|
if(event.key == key){
|
|
if(needsctrl && !event.ctrlKey){
|
|
return
|
|
}
|
|
fn()
|
|
}
|
|
}
|