https://github.com/janmalch/ts-experiments
A collection of fun and/or useful things you can do with TypeScript.
https://github.com/janmalch/ts-experiments
snippets snippets-collection typescript
Last synced: about 1 month ago
JSON representation
A collection of fun and/or useful things you can do with TypeScript.
- Host: GitHub
- URL: https://github.com/janmalch/ts-experiments
- Owner: JanMalch
- Created: 2020-07-31T15:39:32.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-23T07:02:11.000Z (12 months ago)
- Last Synced: 2024-06-23T08:21:33.355Z (12 months ago)
- Topics: snippets, snippets-collection, typescript
- Language: TypeScript
- Homepage:
- Size: 1.62 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
_A collection of fun and/or useful things you can do with TypeScript._
Take everything you see here with a grain of salt. This is more or less a dump of code snippets with some tests and docs.
I do not claim that all these functions, types and classes have good and correct naming, well done tests or follow good practices, etc.
If no caveats are mentioned, then that doesn't neccessarly mean there aren't any.That being said: feel free to be inspired and copy any bit of code you can find in this repository. Credit is appreciated.
You are also welcome to make a PR for new additions and improvements.
Make sure to checkout [the list below](#notable-libraries-and-links) for actually battle-tested libraries and helpful links.[](https://github.com/JanMalch/ts-experiments/tree/master/src)


## Contents
### [collections](https://github.com/JanMalch/ts-experiments/tree/master/src/collections/)
Here you can find everything concerning collections:
Classes like `Queue` and `Stack`, but mostly operations to simplify your work with collections:
Create new collections based on other collections or reduce them to a certain value.
[Special type guards are in the "types" section.](https://github.com/JanMalch/ts-experiments/blob/master/src/types/guards.ts#L43-L72)[](https://github.com/JanMalch/ts-experiments/tree/master/src/collections/)
---
### [contracts](https://github.com/JanMalch/ts-experiments/tree/master/src/contracts/)
Functions that enable design by contract. A more sophisticated library of these is [ts-code-contracts](https://www.npmjs.com/package/ts-code-contracts).
[](https://github.com/JanMalch/ts-experiments/tree/master/src/contracts/)
---
### [decorators](https://github.com/JanMalch/ts-experiments/tree/master/src/decorators/)
Decorator stuff
[](https://github.com/JanMalch/ts-experiments/tree/master/src/decorators/)
---
### [patterns](https://github.com/JanMalch/ts-experiments/tree/master/src/patterns/)
Various utilties that simplify patterns.
[](https://github.com/JanMalch/ts-experiments/tree/master/src/patterns/)
---
### [problems](https://github.com/JanMalch/ts-experiments/tree/master/src/problems/)
[RFC 7807](https://tools.ietf.org/html/rfc7807) utilities. Documentation is in part copied from this very RFC.
[](https://github.com/JanMalch/ts-experiments/tree/master/src/problems/)
---
### [types](https://github.com/JanMalch/ts-experiments/tree/master/src/types/)
Here you can find common types, generic types and type guards.
[](https://github.com/JanMalch/ts-experiments/tree/master/src/types/)
---
### [utils](https://github.com/JanMalch/ts-experiments/tree/master/src/utils/)
This and that
[](https://github.com/JanMalch/ts-experiments/tree/master/src/utils/)
## Notable libraries and links
- [comparing](https://www.npmjs.com/package/comparing)
- [ts-code-contracts](https://www.npmjs.com/package/ts-code-contracts)
- [fp-ts](http://npmjs.com/package/fp-ts) and [io-ts](http://npmjs.com/package/io-ts)
- [type-fest](https://www.npmjs.com/package/type-fest)
- [lodash](https://www.npmjs.com/package/lodash)
- [Typescript Decorators Examples](https://github.com/arolson101/typescript-decorators#readme)