Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function putValue(value, isChange) {
if (typeof value === 'undefined') return;
// console.log('Fill/subscribe: PutValue', value);
if (isChange) {
// console.log('Data before sieve', debug(data));
const sieved = sieve(data, value);
// console.log('Data after sieve', debug(data));
if (!sieved.length) return;
merge(payload, sieved);
} else {
merge(data, value);
// console.log('Payload before adding value', debug(payload));
if (raw) merge(payload, value);
// console.log('Payload after adding value');
}
let { known, unknown, extraneous } = slice(data, originalQuery);
data = known || [];
// console.log('After slice', debug(data), unknown && debug(unknown));
// console.log('Payload and value', debug(payload), value && debug(value));