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.4.0 to 1.5.0

26

lib/abstract-codec.js
(function() {
var AbstractError, Codec, Errors, InvalidArgumentError, InvalidFormatError, InvalidUtf8Error, NotImplementedError, createError, createObject, inherits, isBuffer, isInheritedFrom, isNumber, util,
var AbstractError, Codec, Errors, InvalidArgumentError, InvalidFormatError, InvalidUtf8Error, NotImplementedError, createError, createObject, inherits, isBuffer, isInheritedFrom, isNumber, isString, util,
__slice = [].slice;

@@ -13,2 +13,4 @@

isString = util.isString;
createObject = util.createObject;

@@ -35,4 +37,6 @@

module.exports = Codec = (function() {
var aliases, codecs;
var UNSAFE_CHARS, aliases, codecs, escapeString, unescapeString;
UNSAFE_CHARS = '%';
Codec.bufferSize = 1024;

@@ -325,3 +329,21 @@

Codec.escapeString = escapeString = function(aString, aUnSafeChars) {
var c, result, _i, _len;
if (!isString(aString) || aString.length === 0) {
return aString;
}
if (aUnSafeChars == null) {
aUnSafeChars = UNSAFE_CHARS;
}
result = "";
for (_i = 0, _len = aString.length; _i < _len; _i++) {
c = aString[_i];
result += aUnSafeChars.indexOf(c) >= 0 ? "%" + aString.charCodeAt(_i).toString(16) : c;
}
return result;
};
Codec.unescapeString = unescapeString = decodeURIComponent;
/*

@@ -328,0 +350,0 @@ * Count bytes in a string's UTF-8 representation.

2

package.json
{
"name": "buffer-codec",
"version": "1.4.0",
"version": "1.5.0",
"description": "add the codec ability to abstract-nosql database.",

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

@@ -1,2 +0,2 @@

# AbstractCodec [![Build Status](https://secure.travis-ci.org/snowyu/node-buffer-codec.png?branch=master)](http://travis-ci.org/snowyu/node-buffer-codec) [![npm](https://img.shields.io/npm/v/buffer-codec.svg)](https://npmjs.org/package/buffer-codec) [![downloads](https://img.shields.io/npm/dm/buffer-codec.svg)](https://npmjs.org/package/buffer-codec) [![license](https://img.shields.io/npm/l/buffer-codec.svg)](https://npmjs.org/package/buffer-codec)
# AbstractCodec [![Build Status](https://img.shields.io/travis/snowyu/node-buffer-codec/master.svg)](http://travis-ci.org/snowyu/node-buffer-codec) [![npm](https://img.shields.io/npm/v/buffer-codec.svg)](https://npmjs.org/package/buffer-codec) [![downloads](https://img.shields.io/npm/dm/buffer-codec.svg)](https://npmjs.org/package/buffer-codec) [![license](https://img.shields.io/npm/l/buffer-codec.svg)](https://npmjs.org/package/buffer-codec)

@@ -7,2 +7,3 @@ Add the String/Buffer codec to the [abstract-nosql](https://github.com/snowyu/abstract-nosql) database.

* name: the codec name.
* options: the options passed via the encode/decode.
* encode(value, options): encode the value.

@@ -138,4 +139,7 @@ * return the encoded string, or encoded buffer if options.buffer is true

* decodeString: return the same string.
* Bytewise Codec package: A binary string serialization which sorts bytewise for arbitrarily complex data structures, respecting [bytewise](https://github.com/deanlandolt/bytewise) structured sorting efficiently.
* [buffer-codec-bytewise](https://github.com/snowyu/node-buffer-codec-bytewise)
* npm install buffer-codec-bytewise

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

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