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
/** | |
* Calculates a fixed-length array of pagination display elements, | |
* Example return value: [1, "...", 4, 5, 6, "...", 20] | |
* | |
* Inspired by https://gist.github.com/kottenator/9d936eb3e4e3c3e02598, but re-worked to ensure | |
* that the number of display elements stays constant regardless of the current page. Thus, the | |
* algorithm mimics the behavior of https://material-ui.com/components/pagination/ | |
* | |
* @param {number} currentPage | |
* The current page. The rest of the display is oriented around this page. |
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
/* | |
You will need to configure the global path variables to point to the directories | |
in your project, as well as to replace any execSync() commands with the build | |
commands that you are using. | |
To enable this hook, create .git/hooks/prepare-commit-msg (you may need to unhide | |
the .git/* folder), make it executable using chmod +x .git/hooks/prepare-commit-msg, | |
and add the following code in that file to point the hook to this source: | |
#!/usr/bin/env node |