Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(summary, att) => {
// TODO this only deals with a single entry claims map. It should handle multiples
const claim = get(att, 'claim')
const claimType = first(keys(claim))
return updateIn(summary, [claimType, get(claim, claimType)], inc)
},
sortedMap(),
(summary, att) => {
// TODO this only deals with a single entry claims map. It should handle multiples
const claim = get(att, 'claim')
const claimType = first(keys(claim))
return updateIn(summary, [claimType, get(claim, claimType)], inc)
},
sortedMap(),
function discard(oldState, card) {
var cardID = m.get(card, 'id');
console.log("discarding card", cardID);
var slotCardPair = m.nth(m.filter(function(slotCard) {
return m.nth(slotCard, 1) === cardID;
}, m.get(oldState, 'board')), 0);
var slotID = m.nth(slotCardPair, 0);
console.log("card was in slot", slotID);
return m.assocIn(oldState, ['board', slotID], null);
}
function discard(oldState, card) {
var cardID = m.get(card, 'id');
console.log("discarding card", cardID);
var slotCardPair = m.nth(m.filter(function(slotCard) {
return m.nth(slotCard, 1) === cardID;
}, m.get(oldState, 'board')), 0);
var slotID = m.nth(slotCardPair, 0);
console.log("card was in slot", slotID);
return m.assocIn(oldState, ['board', slotID], null);
}
function downsizeIfNeeded(oldState) {
var oldBoard = m.get(oldState, 'board');
console.log("board:", sortBoard(oldBoard));
if (needsDownsize(oldBoard)) {
console.log('needs downsize!');
return m.assoc(oldState, 'board', downsizeBoard(oldBoard));
} else {
console.log('no downsize needed');
return oldState;
}
}
(identity, subaccounts) =>
toJs(
concat(!get(identity, 'address') || get(identity, 'address').match(/^did:/) ? [] : vector(identity), subaccounts),
),
)
(selected, accounts) => filter(acct => get(acct, 'parent') === selected, accounts),
)
function deal(oldState, slotID) {
var oldBoard = m.get(oldState, 'board');
var oldToDeal = m.get(oldState, 'toDeal');
var newBoard = m.assoc(oldBoard, slotID, m.peek(oldToDeal));
var newToDeal = m.pop(oldToDeal);
return m.pipeline(oldState,
m.curry(m.assoc, 'board', newBoard),
m.curry(m.assoc, 'toDeal', newToDeal)
);
}
return mori.reduce(function(accum, key) {
accum[key] = mori.get(hashMap, key);
return accum;
}, {}, mori.keys(hashMap));
}