Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

some unexpected unknowns in O.Assign and O.MergeAll #270

Open
mesqueeb opened this issue Nov 11, 2021 · 0 comments
Open

some unexpected unknowns in O.Assign and O.MergeAll #270

mesqueeb opened this issue Nov 11, 2021 · 0 comments

Comments

@mesqueeb
Copy link
Contributor

mesqueeb commented Nov 11, 2021

馃悶 Bug Report

"ts-toolbelt": "^9.6.0"
"typescript": "^4.4.4"

and my tsconfig

{
  "compilerOptions": {
    "baseUrl": ".",
    "lib": ["ES2015", "ES2016", "ES2017", "ES2018", "ES2019", "ES2020"],
    "strictNullChecks": true,
    "strict": true,
    "isolatedModules": true,
    "esModuleInterop": true,
    "moduleResolution": "node",
    "declaration": true,
    "declarationDir": "./types/"
  }
}

Describe the bug

I see some types that I'd not expect from reading the docs on the utils:

Reproduce the bug

export type MyType = {
  strArr: string[]
}

type t1 = O.Assign<MyType, [Partial<MyType>, { a?: number }, { b: number }], 'deep'>
// expect
// {
//   b: number;
//   a?: number;
//   strArr: string[];
// }
// get
// {
//   b: number;
//   a?: unknown;
//   strArr: unknown;
// }

type t2 = O.MergeAll<MyType, [Partial<MyType>, { a?: number }, { b: number }], 'deep'>
// expect
// {
//   strArr: string[];
//   a?: number;
//   b: number;
// }
// get
// {
//   strArr: string[];
//   a?: unknown;
//   b: number;
// }

edit: fixed some typos in the expected/gotten types

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant