mobily / ts-belt

🔧 Fast, modern, and practical utility library for FP in TypeScript.
https://mobily.github.io/ts-belt
MIT License
1.08k stars 30 forks source link

fix: no BS_NESTED_SOME_NONE when literal none passed to AsyncResult #114

Open JUSTIVE opened 5 months ago

JUSTIVE commented 5 months ago

resolves #96

image

passes following code.

const toOptionTest = async () => {
  const option = await pipe(AR.resolve(undefined), AR.toOption);

  console.log('option is:', option);

  O.match(
    option,
    () => {
      console.log('option is `Some`');
    },
    () => {
      console.log('option is `None`');
    },
  );

  return option;
};

void toOptionTest();