Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.on('write', path, async function porcelainWrite(change, options) {
return makeGraph(await handle(decorate(change), options));
});
}
async write(...args) {
const [path, porcelainChange, options] = validateArgs(...args);
const change = wrap(makeGraph(porcelainChange), path);
const writtenChange = await this.call('write', change, options || {});
return descend(decorate(writtenChange), path);
}
}
this.on('watch', path, async function* porcelainWatch(query, options) {
const subscription = handle(decorateQuery(query), options);
let firstValue = (await subscription.next()).value;
yield firstValue && makeFinalGraph(firstValue, query);
for await (const value of subscription) {
yield value && makeGraph(value);
}
});
}