A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/Level/supports/issues/1 below:

Decide on additionalMethods format · Issue #1 · Level/supports · GitHub

Initially we can do:

{
  additionalMethods: {
    approximateSize: true
  }
}

Which is enough to start using that in deferred-leveldown (Level/deferred-leveldown#35) and level-packagerlevelup. @ralphtheninja WDYT?

Later we can add function signature info. I propose to stick with boolean properties, so that we can describe multiple signatures (e.g. callbacks and promises):

{
  additionalMethods: {
    approximateSize: {
      sync: false,
      callback: true,
      promise: false
    }
  }
}

With that in place, a db wrapper could do things like:

wrapper.prototype.approximateSize = function (..) {
  if (this.db.supports.additionalMethods.approximateSize.promise) {
    return db.approximateSize(..)
  } else {
    // Wrap in promise
  }
}

Even later, we can add a return type to the manifest. Mainly for streams. Not sure what that should look like. Perhaps:

{
  additionalMethods: {
    createWriteStream: {
      sync: false,
      writable: true
    }
  }
}

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4