1.0.0 • Published 4 years ago

ts-transform-classcat v1.0.0

Weekly downloads
26
License
MIT
Repository
github
Last release
4 years ago

ts-transform-classcat

travis npm version

Compile time classcat transformation for JSX.

Transpiles:

<div class={{
  circle: true,
  off: !isOn,
  on: isOn,
  textOff: !isOn
}} />

Into:

var _cc = require("classcat")
<div class={_cc({
    circle: true,
    off: !isOn,
    on: isOn,
    textOff: !isOn
})}/>

Install

yarn add -D ts-transform-classcat typescript yarn add classcat

General usage

const transformClasscat = require('ts-transform-classcat').default;

transformClasscat()

Usage examples

Look here.

Testing

You can run the following command to test: npm test

Adding test cases

Write your test in a .tsx file and add it to tests/cases.

Compile with npm test and look into the tests/temp and verify.

Overwrite references by running the following command: npm run overwrite-references

Run npm test again to verify that all tests are passing.

Credits

1.0.0

4 years ago

2.0.0

4 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago