scalemodel
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

🧍🏼‍♂️🚂🧍🏾‍♀️ Scale Model

Replicate a generator function’s code

minified and gzipped size minified size zero dependencies

Install

npm add scalemodel

Examples

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?

Readme

Keywords

none

Package Sidebar

Install

npm i scalemodel

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

15.7 kB

Total Files

15

Last publish

Collaborators

  • burntcaramel