1
0
Fork 1
mirror of https://github.com/mastodon/mastodon.git synced 2024-12-21 16:48:33 +00:00
mastodon/app/javascript/flavours/glitch/util/js_helpers.js
2018-01-05 21:16:43 -08:00

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;
}