Skip to content

deamme/ts-transform-classcat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Compile time classcat transformation for JSX.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published