ts-helpers
ts-helpers copied to clipboard
various typescript helper functions and utility types
``` node_modules/@detachhead/ts-helpers/dist/types/Array.d.ts:90:254 - error TS2344: Type 'IndexOfLongestString' does not satisfy the constraint 'Index'. Type 'number | undefined' is not assignable to type 'Index'. Type 'undefined' is not assignable to type...
https://api.github.com/DetachHead/ts-helpers/blob/bb1ecf7d44ac379a45cb1f9dbf1ebe2977ba3863/src/types/Array.ts#L280 ```typescript | T | (Dimension extends 0 ? never : DimensionArray) )[] /** * for some reason the ts toolbelt Tail causes a recursion error in the {@link EveryCombination}...
https://api.github.com/DetachHead/ts-helpers/blob/1adea6b977f6ea535b1e84e3a8d82cea3a13850f/src/types/String.ts#L389 ```typescript // need to narrow using a conditional type because the compiler fails to // see https://github.com/microsoft/TypeScript/issues/43736 // infer extends doesnt work here due to https://github.com/microsoft/TypeScript/issues/50721#issuecomment-1363554868 i think //...
currently it just returns either the type `true` or `false` if it knows the contents of the string at compiletime, but thats such an edge case and it would be...
https://github.com/geoffreytools/ts-spec it passes all the tests i had for `exactly` and im pretty sure it has a much cleaner solution for fixing inaccuracies than my `EqualsWrapped` shit (#128) tho i...
should probably be moved to types and then exported when its fixed https://api.github.com/DetachHead/ts-helpers/blob/6c4b860f5fda1f2e96a416e677cd60af2e216b97/src/functions/misc.ts#L333 ```typescript class_: T, ...args: ConstructorParameters ): HasTypedConstructor => new class_(...args) as HasTypedConstructor declare const replacedUndefined: unique symbol...
https://api.github.com/DetachHead/ts-helpers/blob/6c4b860f5fda1f2e96a416e677cd60af2e216b97/test/functions/misc.spec.ts#L619 ```typescript ) }) }) describe('optionalProperties', () => { describe('object', () => { test('top level', () => { exactly( // TODO: this seems wrong { a: 1 } as {...
fixes #163 blockers/outstanding tasks: - [X] https://github.com/oven-sh/bun/issues/948 - [ ] add a devcontainer - [ ] https://github.com/oven-sh/bun/pull/2593 (merged but not released yet)
```ts exactly() // error ```