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(),
socket.on('start game', function() {
console.log('START GAME');
gameState = game.startBoard(gameState);
console.log('gameState.board:', m.get(gameState, 'board'));
io.emit('start game', m.toJs(gameState));
// io.emit('start game', gameState);
});
attestations => toJs(attestations)
)
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;
}
}
export const snapshot = (state) => ({
uport: toJs(state.uport),
hdwallet: toJs(state.hdwallet)
})
export const snapshot = (state) => ({
uport: toJs(state.uport),
hdwallet: toJs(state.hdwallet)
})
identities => toJs(identities),
)