/**
 * Copyright (c) 2018-present, heineiuo.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */ import { varint } from "./DBHelper" ; import Slice from "./Slice" ; import { ValueType } from "./Format" ; import { Buffer } from "./Buffer" ; export default class LogRecord { static add ( key , value ) { return new Slice ( Buffer . concat ( [ Buffer . fromUnknown ( [ ValueType . kTypeValue ] ) , Buffer . fromUnknown ( varint . encode ( key . length ) ) , key . buffer , Buffer . fromUnknown ( varint . encode ( value . length ) ) , value . buffer , ] ) ) ; } static del ( key ) { return new Slice ( Buffer . concat ( [ Buffer . fromUnknown ( [ ValueType . kTypeDeletion ] ) , Buffer . fromUnknown ( varint . encode ( key . length ) ) , key . buffer , ] ) ) ; } }