@@ -1,26 +1,26 @@
1import * as ob from 'urbit-ob';
1import * as ob from 'urbit-ob';
3−const compose = (...fs) =>
3+export const compose = (...fs) =>
4 fs.reduceRight((pF, nF) => (...args) => nF(pF(...args)), v => v);
4 fs.reduceRight((pF, nF) => (...args) => nF(pF(...args)), v => v);
6−const allFalse = (...args) => args.every(a => a === false);
6+export const allFalse = (...args) => args.every(a => a === false);
8−const isLast = (l, i) => i === l - 1;
8+export const isLast = (l, i) => i === l - 1;
10−const isUndefined = v => v === undefined;
10+export const isUndefined = v => v === undefined;
12−const defaultTo = (v, d) => (isUndefined(v) ? d : v);
12+export const defaultTo = (v, d) => (isUndefined(v) ? d : v);
14−const seq = n => Array.from(Array(n), (_, i) => i);
14+export const seq = n => Array.from(Array(n), (_, i) => i);
16−const fill = (n, v) => Array.from(Array(n), () => v);
16+export const fill = (n, v) => Array.from(Array(n), () => v);
18// Terse true/false checks
18// Terse true/false checks
19−const t = v => v === true;
19+export const t = v => v === true;
21−const f = v => v === false;
21+export const f = v => v === false;
23−const isValidGalaxy = name => {
23+export const isValidGalaxy = name => {
24 let point;
24 let point;
26 point = parseInt(ob.patp2dec(name), 10);
26 point = parseInt(ob.patp2dec(name), 10);
@@ -30,7 +30,7 @@ const isValidGalaxy = name => {
30 return point >= 0 && point < 256;
30 return point >= 0 && point < 256;
33−const randomPatq = len => {
33+export const randomPatq = len => {
34 let bytes = window.crypto.getRandomValues(new Uint8Array(len));
34 let bytes = window.crypto.getRandomValues(new Uint8Array(len));
35 let hex = bytes.reduce(
35 let hex = bytes.reduce(
36 (acc, byt) => acc + byt.toString(16).padStart(2, '0'),
36 (acc, byt) => acc + byt.toString(16).padStart(2, '0'),
@@ -38,17 +38,3 @@ const randomPatq = len => {
39 return ob.hex2patq(hex);
39 return ob.hex2patq(hex);