UNPKG

@deno/kv

Version:

A Deno KV client library optimized for Node.js.

23 lines (22 loc) 704 B
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. // This module is browser compatible. import { BinarySearchNode } from "./_binary_search_node.js"; export class RedBlackNode extends BinarySearchNode { constructor(parent, value) { super(parent, value); Object.defineProperty(this, "red", { enumerable: true, configurable: true, writable: true, value: void 0 }); this.red = true; } static from(node) { const copy = new RedBlackNode(node.parent, node.value); copy.left = node.left; copy.right = node.right; copy.red = node.red; return copy; } }