github.com/grafana/pyroscope@v1.18.0/public/app/util/fp.ts (about)

     1  import { Maybe, Result } from 'true-myth';
     2  import type { Unwrapped } from 'true-myth/maybe';
     3  
     4  // Should be used in situation where we are absolutely
     5  // want to throw an exception
     6  // eg in tests
     7  // DO NOT USE NORMALLY IN CODE
     8  const throwUnwrapErr = () => {
     9    throw new Error('Failed to unwrap');
    10  };
    11  
    12  export { Maybe, Result, throwUnwrapErr };
    13  export type { Unwrapped as UnwrapMaybe };