1import { compose, strSplice } from 'lib/lib';
3const TICKET_MAX_BYTE_LEN = 32; // tickets can be as large as 32 bytes
5export const buildFormatter = (formatters = []) =>
6 compose(...formatters.reverse());
9 * inserts a ~ or - every 7 characters
11export const ensurePatFormat = s => {
12 if (!s || s.length === 0) {
16 // ensure there's a dash every 6 + 1 characters
17 const dashAt = i => i * (6 + 1);
18 const maxBlocks = TICKET_MAX_BYTE_LEN / 2;
20 for (let i = 0; i !== maxBlocks; i++) {
21 const dashIndex = dashAt(i);
23 if (s.length - 1 < dashIndex) {
27 const sep = i === 0 ? '~' : '-';
29 if (s.charAt(dashIndex) !== sep) {
30 s = strSplice(s, dashIndex, sep);
37export const convertToNumber = s => {
39 return parseInt(s, 10);
45export const downcase = s => {
50 return s.toLowerCase();
53// const hideAllButLast = s => {
54// const ll = s[s.length -1];
55// const bs = fill(s.length - 1, '•')
59// const hideAll = s => fill(s.length, '•');
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list