New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

js-xdr

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-xdr - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

2

lib/union.js

@@ -43,3 +43,3 @@ "use strict";

value: function set(aSwitch, value) {
if (typeof aSwtch === "string") {
if (isString(aSwitch)) {
aSwitch = this.constructor._switchOn.fromName(aSwitch);

@@ -46,0 +46,0 @@ }

{
"name": "js-xdr",
"version": "0.0.9",
"version": "0.0.10",
"description": "Read/write XDR encoded data structures (RFC 4506)",

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

@@ -13,6 +13,6 @@ import { each, isUndefined, isString } from "lodash";

set(aSwitch, value) {
if (typeof aSwtch === "string") {
if (isString(aSwitch)) {
aSwitch = this.constructor._switchOn.fromName(aSwitch);
}
this._switch = aSwitch;

@@ -19,0 +19,0 @@ this._arm = this.constructor.armForSwitch(this._switch);

@@ -48,8 +48,30 @@ import { Cursor } from "../../src/cursor";

describe('new Union', function() {
describe('Union: constructor', function() {
it('works for XDR.Int discrimnated unions', function() {
expect(() => new Ext(0)).to.not.throw();
});
it('works for Enum discrimnated unions', function() {
expect(() => new Result("ok")).to.not.throw();
expect(() => new Result(ResultType.ok())).to.not.throw();
});
});
describe('Union: set', function() {
it('works for XDR.Int discrimnated unions', function() {
let u = new Ext(0);
u.set(0);
});
it('works for Enum discrimnated unions', function() {
let u = Result.ok();
expect(() => u.set("ok")).to.not.throw();
expect(() => u.set("notok")).to.throw(/not a member/);
expect(() => u.set(ResultType.ok())).to.not.throw();
});
});
describe('Union.read', function() {

@@ -56,0 +78,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

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