Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

level-codec

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

level-codec - npm Package Compare versions

Comparing version 3.1.0 to 4.0.0

3

lib/decode-key.js

@@ -5,5 +5,6 @@ var encodings = require('./encodings');

module.exports = function decodeKey(key, optionObjects){
var encoding = walk(optionObjects, 'keyEncoding') || 'utf8';
var encoding = walk(optionObjects, 'keyEncoding');
if (typeof encoding == 'string') encoding = encodings[encoding];
if (!encoding) return key;
return encoding.decode(key);
};

@@ -5,6 +5,7 @@ var encodings = require('./encodings');

module.exports = function decodeValue(value, optionObjects){
var encoding = walk(optionObjects, 'valueEncoding') || 'utf8';
var encoding = walk(optionObjects, 'valueEncoding');
if (typeof encoding == 'string') encoding = encodings[encoding];
if (!encoding) return value;
return encoding.decode(value);
};

@@ -5,5 +5,6 @@ var encodings = require('./encodings');

module.exports = function encodeKey(key, optionObjects){
var encoding = walk(optionObjects, 'keyEncoding') || 'utf8';
var encoding = walk(optionObjects, 'keyEncoding');
if (typeof encoding == 'string') encoding = encodings[encoding];
if (!encoding) return key;
return encoding.encode(key);
};

@@ -5,6 +5,7 @@ var encodings = require('./encodings');

module.exports = function encodeValue(value, optionObjects){
var encoding = walk(optionObjects, 'valueEncoding') || 'utf8';
var encoding = walk(optionObjects, 'valueEncoding');
if (typeof encoding == 'string') encoding = encodings[encoding];
if (!encoding) return value;
return encoding.encode(value);
};

@@ -5,5 +5,6 @@ var encodings = require('./encodings');

module.exports = function keyAsBuffer(optionObjects){
var encoding = walk(optionObjects, 'keyEncoding') || 'utf8';
var encoding = walk(optionObjects, 'keyEncoding');
if (typeof encoding == 'string') encoding = encodings[encoding];
if (!encoding) return false;
return encoding.buffer;
};

@@ -5,5 +5,6 @@ var encodings = require('./encodings');

module.exports = function valueAsBuffer(optionObjects){
var encoding = walk(optionObjects, 'valueEncoding') || 'utf8';
var encoding = walk(optionObjects, 'valueEncoding');
if (typeof encoding == 'string') encoding = encodings[encoding];
if (!encoding) return false;
return encoding.buffer;
};
{
"name": "level-codec",
"repository": "Level/codec",
"version": "3.1.0",
"version": "4.0.0",
"description": "Levelup's encoding logic",

@@ -6,0 +6,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc