ts-transform-classcat
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i ts-transform-classcat

Weekly Downloads

9

Version

1.0.0

License

MIT

Unpacked Size

20.1 MB

Total Files

4425

Last publish

Collaborators

  • deam