mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-18 04:43:24 +00:00
6 lines
242 B
JavaScript
6 lines
242 B
JavaScript
|
// This function returns the new value unless it is `null` or
|
||
|
// `undefined`, in which case it returns the old one.
|
||
|
export function overwrite (oldVal, newVal) {
|
||
|
return newVal === null || typeof newVal === 'undefined' ? oldVal : newVal;
|
||
|
}
|