mastodon-docker-playground/app/javascript/flavours/glitch/util/js_helpers.js

6 lines
242 B
JavaScript
Raw Normal View History

2018-01-06 02:23:06 +00:00
// 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;
}