import flatten from 'lodash/flatten' import find from 'lodash/find' function GraphQLIcon () { return ( ) } export const categorizedRoutes = [ { category: 'React', iconName: 'icon-reactjs', content: [ { label: 'JSON to React PropTypes', path: '/', title: 'Transform | All important transforms at one place.', desc: 'An online utility to convert a JSON object to prop-types, Typescript Interface, Rust serde or flow types. It also converts your CSS into JS and HTML into JSX.' }, { label: 'HTML/SVG to JSX', path: '/html-to-jsx', desc: 'An online REPL for converting HTML to JSX with proper support for SVG.' }, { label: 'SVG to React Native', path: '/svg-to-react-native', desc: 'An online REPL for converting SVG to React Native compatible equivalent.' }, { label: 'CSS to JS Objects', path: '/css-to-js', desc: 'An online REPL for converting CSS to JS object. It also gives style optimized for React Native.', packageName: 'transform-css-to-js', packageUrl: 'https://github.com/transform-it/transform-css-to-js' }, { label: 'CSS to Emotion', path: '/css-to-emotion', desc: 'An online REPL for converting CSS to Emotion compatible code.', packageName: 'css-in-js-generator', packageUrl: 'https://github.com/brikou/CSS-in-JS-generator', beta: true } ] }, { category: 'JavaScript', iconName: 'icon-javascript', content: [ { label: 'JSON to Flow Types', path: '/json-to-flow-types', desc: 'An online REPL for converting JSON to generate Flow Types.' }, { label: 'JSON to Typescript Interface', path: '/json-to-ts-interface', desc: 'An online REPL for converting JSON to generate TypeScript Interface.' }, { label: 'JSON to MobX-State-Tree Model', path: '/json-to-mobx-state-tree', desc: 'An online REPL for converting JSON to generate Mobx State Tree.' }, { label: 'JS Object to JSON', path: '/js-object-to-json', desc: 'An online REPL for converting JS Object to JSON.' }, { label: 'JSON Schema to TypeScript', path: '/json-schema-to-ts', desc: 'An online REPL for converting JSON Schema to TypeScript Interface.', packageName: 'json-schema-to-typescript', packageUrl: 'https://github.com/bcherny/json-schema-to-typescript' } ] }, { category: 'Rust', iconName: 'icon-rust', content: [ { label: 'JSON to Rust Serde', path: '/json-to-rust-serde', desc: 'An online REPL for converting JSON to Rust Serde Structs.' }, { label: 'JSON Schema to Rust Serde', path: '/json-schema-to-rust-serde', desc: 'An online REPL for converting JSON Schema to Rust Serde Structs.' } ] }, { category: 'Databases', iconName: 'icon-database', content: [ { label: 'JSON to Mongoose Schema', path: '/json-to-mongoose', desc: 'An online REPL to generate Mongoose Schema from JSON.', packageName: 'generate-schema', packageUrl: 'https://github.com/nijikokun/generate-schema' }, { label: 'JSON to Big Query Schema', path: '/json-to-big-query', desc: 'An online REPL to generate Big Query Schema from JSON.', packageName: 'generate-schema', packageUrl: 'https://github.com/nijikokun/generate-schema' }, { label: 'JSON to MySQL', path: '/json-to-mysql', desc: 'An online REPL to generate MySQL table generation code from JSON.', packageName: 'generate-schema', packageUrl: 'https://github.com/nijikokun/generate-schema' } ] }, { category: 'Scala', iconName: 'icon-scala', content: [ { label: 'JSON to Scala Case Class', path: '/json-to-scala-case-class', desc: 'An online REPL to generate Scala Case Class from JSON.' } ] }, { category: 'GraphQL', icon: , content: [ { label: 'GraphQL to TypeScript', path: '/graphql-to-typescript', desc: 'An online REPL to generate TypeScript type annotations based on a GraphQL schema and query documents.' }, { label: 'GraphQL to Flow', path: '/graphql-to-flow', desc: 'An online REPL to generate Flow type annotations based on a GraphQL schema and query documents.' } ] }, { category: 'Go', iconName: 'icon-go', content: [ { label: 'JSON to Go Struct', path: '/json-to-go', desc: 'An online REPL to generate Go Struct from JSON.', packageName: 'json-to-go', packageUrl: 'https://github.com/mholt/json-to-go' } ] }, { category: 'XML', iconName: 'icon-html', content: [ { label: 'XML to JSON', path: '/xml-to-json', desc: 'An online REPL to generate basic JSON from a XML.', packageName: 'xml-js', packageUrl: 'https://github.com/nashwaan/xml-js' } ] } ] export const routes = flatten(categorizedRoutes.map(a => a.content)) export function activeRouteData (pathname) { return find(routes, o => o.path === pathname) }