How to use the @graffy/common.descend function in @graffy/common

To help you get started, we’ve selected a few @graffy/common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github usegraffy / graffy / src / core / Graffy.js View on Github external
async read(...args) {
    const [path, porcelainQuery, options] = validateArgs(...args);
    const query = wrap(makeQuery(porcelainQuery), path);
    const result = await this.call('read', query, options || {});
    return descend(decorate(result), path);
  }
github usegraffy / graffy / src / core / Graffy.js View on Github external
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);
  }
}
github usegraffy / graffy / src / core / Graffy.js View on Github external
async *watch(...args) {
    const [path, porcelainQuery, options] = validateArgs(...args);
    const query = wrap(makeQuery(porcelainQuery), path);
    const stream = this.call('watch', query, options || {});
    for await (const value of stream) yield descend(decorate(value), path);
  }