about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/util/js_helpers.js
blob: 2ebd5b6c55ea683aa5299c0a50136e6c05a77025 (plain) (blame)
1
2
3
4
5
//  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;
}