Flattens the nested result, The error held by an outer one will be preceded.
The nested result.
The unwrapped nest.
expect(flatten(ok(ok("hello")))).toStrictEqual(ok("hello"));expect(flatten(err(ok("hello")))).toStrictEqual(err(ok("hello")));expect(flatten(ok(err(6)))).toStrictEqual(err(6));expect(flatten(err(err(6)))).toStrictEqual(err(err(6))); Copy
expect(flatten(ok(ok("hello")))).toStrictEqual(ok("hello"));expect(flatten(err(ok("hello")))).toStrictEqual(err(ok("hello")));expect(flatten(ok(err(6)))).toStrictEqual(err(6));expect(flatten(err(err(6)))).toStrictEqual(err(err(6)));
Flattens the nested result, The error held by an outer one will be preceded.