github.com/pyroscope-io/pyroscope@v0.37.3-0.20230725203016-5f6947968bd0/webapp/javascript/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 };