New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 0.9.1 to 1.0.0

lib/abstract-codec.js

2

index.js

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

module.exports = require("./lib/buffer-codec")
module.exports = require("./lib/codec")
{
"name": "buffer-codec",
"version": "0.9.1",
"version": "1.0.0",
"description": "add the codec ability to abstract-nosql database.",

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

"decode",
"serialization",
"serialize",
"deserialize",
"abstract",

@@ -55,0 +58,0 @@ "object",

@@ -61,4 +61,14 @@ # AbstractCodec

class TextCodec
register TextCodec
_encodeString: (data)->
if not data? or Buffer.isBuffer data
data
else
String(data)
_decodeString: (data)->data
class JsonCodec
register JsonCodec, Codec
register JsonCodec, TextCodec

@@ -73,3 +83,6 @@ constructor: -> return super

# get the JsonCodec Class
JsonCodec = Codec['Json']
# lowercase name only here:
JsonCodec = Codec['json']
# or
JsonCodec = TextCodec['json']

@@ -76,0 +89,0 @@ # get the global JsonCodec instance from the Codec

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