Ts-toolbelt: v3.0.0 testing

Created on 1 Jul 2019  路  9Comments  路  Source: millsp/ts-toolbelt

I've pushed a pre-release npm i ts-toolbelt@next --save with the following changes:

Breaking changes:

  • Removed N.Clamp
  • All types returning boolean now return 0 | 1 (still need to update the docs)
  • Boolean (B) now only accepts 0 | 1 as a boolean with possibility to transform to a real boolean with Fmt

Changes:

  • Increased computation speed
  • Removed excess extends
  • Integrated Boolean internally
  • Fixed buggy type distribution

I've removed a lot of <x> extends infer X so you might encounter "type instantiation is excessively deep..." when combining types together, but I haven't encountered any in the tests though. If necessary, I'll write more tests.

I would appreciate if you can install the next version and give me your feedback :smiley:

Thanks,

(@regevbr)

help needed

All 9 comments

@pirix-gh glad to - will keep you posted

@pirix-gh looks good for now! nothing breaks for my projects so far

@pirix-gh got a new too deep error:

import { Object, Any, Union } from 'ts-toolbelt';
export declare function getProp<O extends object, P extends string[]>(obj: Union.Nullable<O>, ...keys: Any.Cast<P, Object.PathValid<O, P>>): Object.Path<O, P> | undefined;

then when using it:

getProp(booking, 'props', 'personalInfo'); // Error:(290, 26) TS2589: Type instantiation is excessively deep and possibly infinite.

And it doesn't happen with 2.1.5

Thank you, I'm going to have a look, I invite you to switch back to the other version until further notice. This is from all the infers I've removed.

@regevbr can you post me the type of booking ? I don't get errors with my tests.

@pirix-gh it is very complicated and spread over a few files and also kind of sensitive :-)
Let me see if I can reproduce it with a different type.

The weired thing is it only happens on webstorm itself, but not when I run tsc... Can you explain it? They are both using the same typescript version

Strange now it disappeared... No clue what is going on

I use VSCode, I got tired of the slow IntelliJ... But anyway, this also happened to me. I suggest deleting your node_modules as TS stores it's cache in it. Just yesterday, I was working on the new update and everything seemed to work fine... till I removed the cache (of 150MB) then I realised 100 tests were not passing :anger:

Hope it solves your problem

I guess that what got it solved in the first place...
I'm planning on moving to VSCode for a long time now but my entire project management is based on YouTrack and the current plugin for VSCode just doesn't do the trick for me.

Was this page helpful?
0 / 5 - 0 ratings