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

bidar

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bidar - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

14

lib/serial.js

@@ -116,2 +116,3 @@ // Copyright 2012 The Obvious Corporation.

var holes = oid.createMap();
allowHoles = false;
holeSet.forEach(function (obj) {

@@ -167,2 +168,4 @@ var replacement = holeFilter(obj);

function visitFunction(x) {
holeCheck();
var count = allRefs.get(x, 0) + 1;

@@ -203,2 +206,3 @@

} else {
holeCheck();
addHole(x);

@@ -230,4 +234,12 @@ }

function addHole(x) {
holeSet.add(x);
}
/**
* Check to see if holes are currently being allowed. If not,
* complain appropriateley.
*/
function holeCheck() {
if (allowHoles) {
holeSet.add(x);
return;
} else if (type.isUndefined(holeFilter)) {

@@ -234,0 +246,0 @@ throw new Error("Hole-ful graph, but no hole filter.");

2

package.json
{
"name": "bidar",
"version": "0.1.6",
"version": "0.1.7",
"keywords":

@@ -5,0 +5,0 @@ ["object", "serialization", "data", "graph"],

@@ -318,2 +318,35 @@ // Copyright 2012 The Obvious Corporation.

function test_fail_hole() {
var obj = { a: hole };
function hole() {
return "holy!";
}
function f1() {
bidar.serialize(obj);
}
assert.throws(f1, /Hole-ful graph, but no hole filter/);
function f2() {
bidar.serialize(obj, filter);
function filter(x) {
// An arbitrary-but-different hole.
return filter;
}
}
assert.throws(f2, /Holes not allowed in holes/);
function f3() {
bidar.serialize(obj, filter);
function filter(x) {
// The same hole.
return x;
}
}
assert.throws(f3, /Holes not allowed in holes/);
}
function testLargeString() {

@@ -392,2 +425,3 @@ var string1 = "abcdefg1234567890---THIS IS YOUR CAPTAIN SPEAKING---" +

testInnerHole();
test_fail_hole();
testLargeString();

@@ -394,0 +428,0 @@

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