on master help sign in
fix: destructure lodash-es import
795e055Matt Condon (shrugs)
src/walletgen/lib/lib.js+4−4
@@ -1,7 +1,7 @@
1import * as ob from 'urbit-ob';
1import * as ob from 'urbit-ob';
2import * as kg from 'urbit-key-generation/dist/index';
2import * as kg from 'urbit-key-generation/dist/index';
3import * as more from 'more-entropy';
3import * as more from 'more-entropy';
4−import lodash from 'lodash-es';
4+import { chunk, flatMap, zipWith } from 'lodash-es';
5import {
5import {
6 MIN_STAR,
6 MIN_STAR,
7 MIN_PLANET,
7 MIN_PLANET,
@@ -30,10 +30,10 @@ const makeTicket = point => {
30
30
31 return new Promise((resolve, reject) => {
31 return new Promise((resolve, reject) => {
32 gen.generate(bits, result => {
32 gen.generate(bits, result => {
33− const chunked = lodash.chunk(result, 2);
33+ const chunked = chunk(result, 2);
34 const desired = chunked.slice(0, bytes); // only take required entropy
34 const desired = chunked.slice(0, bytes); // only take required entropy
35− const more = lodash.flatMap(desired, arr => arr[0] ^ arr[1]);
35+ const more = flatMap(desired, arr => arr[0] ^ arr[1]);
36− const entropy = lodash.zipWith(some, more, (x, y) => x ^ y);
36+ const entropy = zipWith(some, more, (x, y) => x ^ y);
37 const buf = Buffer.from(entropy);
37 const buf = Buffer.from(entropy);
38 const patq = ob.hex2patq(buf.toString('hex'));
38 const patq = ob.hex2patq(buf.toString('hex'));
39 resolve(patq);
39 resolve(patq);