Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kddnewton/typescript-parse-math
Parse math expressions with TypeScript types
https://github.com/kddnewton/typescript-parse-math
Last synced: 14 days ago
JSON representation
Parse math expressions with TypeScript types
- Host: GitHub
- URL: https://github.com/kddnewton/typescript-parse-math
- Owner: kddnewton
- License: mit
- Created: 2020-11-25T14:05:00.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-10T15:36:25.000Z (over 3 years ago)
- Last Synced: 2024-11-13T08:36:40.908Z (2 months ago)
- Size: 4.88 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - typescript-parse-math
README
# `typescript-parse-math`
This is a math parser that handles various arithmetic operations using only TypeScript types. Absolutely monstrous. Definitely don't use it.
```ts
import type { ParseMath } from "typescript-parse-math";type Result1 = ParseMath<"5 - 3 * 2 + 3">;
// type Result1 = 2type Result2 = ParseMath<"1 + 2 * 3">;
// type Result2 = 7type Result3 = ParseMath<"10 + 2">;
// type Result3 = 12
```## Related
* [jamiebuilds/json-parser-in-typescript-very-bad-idea-please-dont-use](https://github.com/jamiebuilds/json-parser-in-typescript-very-bad-idea-please-dont-use).
* [romani/meta-typing](https://github.com/ronami/meta-typing)
* [microsoft/TypeScript#14833](https://github.com/microsoft/TypeScript/issues/14833)