bytewise-core
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -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 = { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25866
13
734
99