This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const parsed = { type: "File", program: parse(unsorted) }; | |
// Find all imports | |
let imports = [] | |
traverse(parsed, { | |
ImportDeclaration(node, parent) { | |
imports.push({node, text: unsorted.substring(node.start, node.end)}); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { Flex } from 'jsxstyle'; | |
class Column extends React.Component { | |
render () { | |
return <Flex {...this.props} direction="column"/>; | |
} | |
} | |
export default Column; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getValues () { | |
return { | |
a: 1, | |
b: 2 | |
}; | |
} | |
let {a, b} = getValues(); | |
console.log(a, b); |