~cytrogen/masto-fe

ref: 612a1ee697522e85acbcc0e30868b3aa4cbf110f masto-fe/app/javascript/flavours/glitch/utils/js_helpers.js -rw-r--r-- 242 bytes
612a1ee6 — Claire Fix `body_classes` test for glitch-soc 2 years ago
                                                                                
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;
}