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

bytewise-core

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bytewise-core - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

test/basic.js

11

codecs.js

@@ -107,3 +107,5 @@ var util = require('./util')

//
// base encoding for complex structures
//
codecs.LIST = {

@@ -116,8 +118,11 @@ encode: util.encodeList,

// member order is preserved and accounted for in collation (like in couchdb)
//
// member order is preserved and accounted for in sort (except for number keys)
//
codecs.HASH = {
encode: util.encodeHash,
decode: util.decodeHash
// TODO
// encode: util.encodeHash,
// decode: util.decodeHash
}
codecs.RECORD = shortlex(codecs.HASH)

@@ -100,3 +100,3 @@ var assert = require('assert')

var byte = buffer[0];
var byte = buffer[0]
var type = bytewise.getType(byte)

@@ -103,0 +103,0 @@

{
"name": "bytewise-core",
"version": "1.1.1",
"version": "1.1.2",
"description": "Binary serialization of arbitrarily complex structures that sort element-wise",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -26,6 +26,5 @@ bytewise-core

* `Array` (element-wise)
* `Object` (element-wise, key/value pairs)
* `undefined`
Structured types like `Array` and `Object` may contain any supported structures, including nested `Array` or `Object` values.
Structured types like `Array` may recursively contain any other supported structures.

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

@@ -0,3 +1,6 @@

var tape = module.exports = require('tape')
require('./basic')
require('./order')
require('./serialization')
require('./ranges')
var bytewise = require('../');
var typewise = require('typewise-core');
var util = require('typewise-core/test/util');
var test = require('tape');
var tape = module.exports = require('tape');

@@ -36,3 +36,3 @@ var expected = [

test('sorts in expected order', function (t) {
tape('sorts in expected order', function (t) {
t.equal(

@@ -45,3 +45,3 @@ bytewise.encode(shuffled.sort(typewise.compare)).toString('hex'),

test('sorts with same order when encoded', function (t) {
tape('sorts with same order when encoded', function (t) {
var decoded = shuffled

@@ -48,0 +48,0 @@ .map(bytewise.encode)

var bytewise = require('../')
var util = require('typewise-core/test/util')
var tape = require('tape')
var tape = module.exports = require('tape')

@@ -39,3 +39,2 @@ function eqHex(t, data, hex) {

var range = [ 'foo', bytewise.bound.upper ]
console.warn(bytewise.encode(range))
decodeThrows(t, range)

@@ -42,0 +41,0 @@ t.end()

@@ -5,3 +5,3 @@ var bytewise = require('../')

var sample, shuffled;
var sample, shuffled

@@ -21,3 +21,3 @@ function eq(t, a, b) {

}
});
})
}

@@ -36,3 +36,3 @@

sample = util.getArraySample(2);
sample = util.getArraySample(2)
shuffled = util.shuffle(sample.slice())

@@ -44,3 +44,3 @@ eq(t, sample,

t.end()
});
})

@@ -47,0 +47,0 @@ var hash = {

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