Closed araera111 closed 1 year ago
I use VSCode.
in my environment, after using the map function of type option, use the getWithDefault function of type option. Then the ts(2345) error is displayed.
const result = pipe( O.fromNullable(null), O.map((value) => `${value} world!`), //ā ts2345 error is displayed. O.getWithDefault("error") );
but
const temp = pipe( O.fromNullable(null), O.map((value) => `${value} world!`) ); const result = O.getWithDefault(temp, "test"); //ā ts2345 error is NOT displayed.
and
const temp = pipe( O.fromNullable(null), O.map((value) => `${value} world!`), O.getWithDefault("test" as string) //ā ts2345 error is NOT displayed. );
mytsconfig
{ "compilerOptions": { "strictNullChecks": true, "noUncheckedIndexedAccess": false, "target": "ESNext", "module": "commonjs", "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, "skipLibCheck": true } }
typescript: 4.8.4 node: 16.18.0
use tsc command -> ts2345 error is NOT displayed.
@araera111 please install @mobily/ts-belt@next and let me know if that solves your issue :)
@mobily/ts-belt@next
Solved! Very very very thank you .
I use VSCode.
in my environment, after using the map function of type option, use the getWithDefault function of type option. Then the ts(2345) error is displayed.
but
and
mytsconfig
typescript: 4.8.4 node: 16.18.0
use tsc command -> ts2345 error is NOT displayed.