This file contains 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
/** | |
* Get subtype from an existing type/interface by omitting one or more properties. | |
* | |
* **Usage:** | |
* ```ts | |
* type TSubType = Omit<IOriginalType, 'Prop1' | 'Prop2'> // IOriginalType without Prop1 and Prop2 | |
* ``` | |
*/ | |
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>> |
This file contains 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
var ReactDOMServer = require('react-dom/server'); | |
var cheerio = require('cheerio'); | |
module.exports = function( reactClass ) { | |
var staticMarkup = ReactDOMServer.renderToStaticMarkup(reactClass); | |
var $ = cheerio.load(staticMarkup); | |
return $.root().children().first(); | |
}; |