export const inBrowser = typeof window !== 'undefined';
export const supportsPassive = true;
export const trim = (string: string) => (string || '').replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, '');
export const raf = (fn: FrameRequestCallback): number => (inBrowser ? requestAnimationFrame(fn) : -1);
export const cancelRaf = (id: number) => {
  if (inBrowser) {
    cancelAnimationFrame(id);
  }
};
