Socket
Socket
Sign inDemoInstall

compress-brotli

Package Overview
Dependencies
0
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.3

5

CHANGELOG.md

@@ -5,2 +5,7 @@ # Change Log

<a name="1.0.3"></a>
## [1.0.3](https://github.com/Kikobeats/compress-brotli/compare/v1.0.2...v1.0.3) (2019-04-11)
<a name="1.0.2"></a>

@@ -7,0 +12,0 @@ ## [1.0.2](https://github.com/Kikobeats/compress-brotli/compare/v1.0.1...v1.0.2) (2019-04-06)

3

index.js

@@ -15,3 +15,3 @@ 'use strict'

enable = true,
serialize = JSON.stringify,
serialize = val => Buffer.from(JSON.stringify(val)),
deserialize = JSON.parse

@@ -29,3 +29,2 @@ } = {}) => {

let serializedData = serialize(data)
if (!hasNativeAPI) serializedData = Buffer.from(serializedData)
return compress(serializedData)

@@ -32,0 +31,0 @@ },

@@ -5,3 +5,3 @@ {

"homepage": "https://nicedoc.io/Kikobeats/compress-brotli",
"version": "1.0.2",
"version": "1.0.3",
"main": "index.js",

@@ -8,0 +8,0 @@ "author": {

@@ -5,2 +5,3 @@ 'use strict'

const createCompress = require('..')
const v8 = require('v8')

@@ -21,1 +22,12 @@ ;[

})
test('custom serializer/deserializer', async t => {
const { compress, decompress } = createCompress({
serialize: v8.serialize,
deserialize: v8.deserialize
})
const value = { foo: 'bar', fooz: { foo: 'bar' }, arr: [1, 2, 3, 4] }
const compressedData = await compress(value)
const decompressedData = await decompress(compressedData)
t.deepEqual(decompressedData, value)
})
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc