https://github.com/royalicing/scalemodel
Replicate a generator function’s code
https://github.com/royalicing/scalemodel
Last synced: 4 months ago
JSON representation
Replicate a generator function’s code
- Host: GitHub
- URL: https://github.com/royalicing/scalemodel
- Owner: RoyalIcing
- License: mit
- Created: 2021-02-18T01:43:46.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-02-22T06:49:55.000Z (over 5 years ago)
- Last Synced: 2025-01-18T23:43:02.081Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://regenerated.dev/
- Size: 90.8 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
## Install
```console
npm add scalemodel
```
## Examples
```javascript
import { toCode } from "scalemodel";
function* Outer() {
yield Inner;
}
function* Inner() {
yield ["first", 1];
yield [2, "second"];
yield [3, "third", 3];
}
const jsCode = toCode(Outer);
/*
"function* Outer() {
\tyield Inner;
}
function* Inner() {
\tyield ["first",1];
\tyield [2,"second"];
\tyield [3,"third",3];
}"
*/
```
## TODO
- Regular expressions?
- Sets?
- Maps?
- Symbols?
- Minify?
- Web worker support!