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 getLineStart = (content, fromWord) => | |
| content.substring( | |
| content.lastIndexOf('\n', content.indexOf(fromWord)), | |
| content.indexOf(fromWord) | |
| ) |
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, { useState } from "react"; | |
| import AnimateHeight from "react-animate-height"; | |
| export const Collapse = ({ children, minHeight = 0 }) => { | |
| const [height, setHeight] = useState<any>(minHeight); | |
| const isClosed = height === minHeight; | |
| const toggle = () => setHeight(isClosed ? "auto" : minHeight); | |
| return ( | |
| <div> |
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 path = require("path"); | |
| function fromEntries(iterable) { | |
| return [...iterable].reduce((obj, [key, val]) => { | |
| obj[key] = val; | |
| return obj; | |
| }, {}); | |
| } | |
| /** |
NewerOlder