0.8.1 • Published 3 years ago

kind2string v0.8.1

Weekly downloads
3,535
License
MIT
Repository
github
Last release
3 years ago

Kind 2 String - a parser for extract-react-types

Kind 2 String is designed to take the data structures output by extract-react-types and convert them to a (useful) string, as well as performing safe traversal through the output of extract-react-types so that trying to display information in your docs does not throw errors.

It exposes a convert method which allows you to ensure the data structure resolves to a string. It also exposes its converter object, allowing you to overwrite converters of your choice, if you wish to perform some other action other than the default string converter.

Default use-case:

import generatedData from './extract-react-type-write-location';
import convert from 'kind2string';

export default () => <div>convert(generatedData)</div>;

Also, if you are handling the kinds in a custom way, it is good to pass the final kind to kind2string, to ensure that you always pass a string to your react components.

For examples of how to use this, the @atlaskit/docs uses this package. A good pattern on how to implement kind2string can be found in the prettyproptypes file.

0.8.1

3 years ago

0.8.0

4 years ago

0.7.3

4 years ago

0.7.2

4 years ago

0.7.1

5 years ago

0.7.0

5 years ago

0.6.3

5 years ago

0.6.2

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.6

5 years ago

0.5.5

5 years ago

0.5.4

5 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago