buffer-codec
Advanced tools
Comparing version 0.9.1 to 1.0.0
@@ -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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
12
0
107
38769
362
1