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

buffer-codec

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buffer-codec - npm Package Compare versions

Comparing version 1.5.3 to 1.5.4

21

lib/abstract-codec.js

@@ -72,3 +72,2 @@ (function() {

if (!aCodecName) {
console.log(arguments.callee.name);
if (isInheritedFrom((aCodecName = arguments.callee.caller), Codec)) {

@@ -135,9 +134,12 @@ try {

Codec.prototype.encodeString = function(value) {
Codec.prototype.encodeString = function(value, bufferEncoding) {
var len;
if (bufferEncoding == null) {
bufferEncoding = 'utf8';
}
if (this._encodeString) {
return this._encodeString(value);
} else if (this._encodeBuffer) {
len = this._encodeBuffer(value, this.buffer);
return this.buffer.toString(this.bufferEncoding, 0, len);
len = this._encodeBuffer(value, this.buffer, 0);
return this.buffer.toString(bufferEncoding, 0, len);
} else {

@@ -148,4 +150,7 @@ throw new NotImplementedError();

Codec.prototype.decodeString = function(str) {
Codec.prototype.decodeString = function(str, bufferEncoding) {
var len;
if (bufferEncoding == null) {
bufferEncoding = 'utf8';
}
if (this._decodeString) {

@@ -155,3 +160,3 @@ return this._decodeString(str);

len = this.buffer.write(str);
return this.decodeBuffer(this.buffer, 0, len);
return this.decodeBuffer(this.buffer, 0, len, bufferEncoding);
} else {

@@ -235,3 +240,3 @@ throw new NotImplementedError();

} else {
result = this.encodeString(value);
result = this.encodeString(value, options.bufferEncoding);
}

@@ -249,3 +254,3 @@ delete this.options;

} else {
result = this.decodeString(value);
result = this.decodeString(value, options.bufferEncoding);
}

@@ -252,0 +257,0 @@ delete this.options;

{
"name": "buffer-codec",
"version": "1.5.3",
"version": "1.5.4",
"description": "add the codec ability to abstract-nosql database.",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/snowyu/node-buffer-codec",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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