Skip to content
This repository was archived by the owner on Dec 2, 2024. It is now read-only.
/ level-js Public archive
This repository was archived by the owner on Dec 2, 2024. It is now read-only.

Support binary keys #58

@vweevers

Description

@vweevers
  • Have the abstract-leveldown test suite assume binary keys are supported (remove process.browser checks) (get rid of process.browser checks abstract-leveldown#121) Remove process.browser checks and move binary key tests to isolated test file(s) that can be skipped by implementations.
  • Or until then, add a custom test to level-js
  • Assume use of modern browserify (where Buffer is a subclass of Uint8Array)
  • Feature-detect binary key support
  • Update to latest abstract-leveldown and implement _serializeKey as (simplified):
var supportsBinaryKeys = true;

Level.prototype._serializeKey = function (key) {
  return !supportsBinaryKeys && this._isBuffer(key)
    ? String(key)
    : key
}

This means the test suite can pass in browsers that support binary keys as well as those that don't (IE, Edge, Chrome 49).

Metadata

Metadata

Assignees

No one assigned

    Labels

    upgrade guideImprovements or additions to upgrade guide(s)

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions