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

thriftrw

Package Overview
Dependencies
Maintainers
4
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

thriftrw - npm Package Compare versions

Comparing version 2.1.1 to 2.2.0

test/union.js

2

package.json
{
"name": "thriftrw",
"version": "2.1.1",
"version": "2.2.0",
"description": "thrift encoding/decoding using bufrw",

@@ -5,0 +5,0 @@ "keywords": [],

@@ -23,2 +23,3 @@ // Copyright (c) 2015 Uber Technologies, Inc.

/* eslint max-statements:[0, 99] */
/* eslint complexity:[0, 16] */
'use strict';

@@ -81,5 +82,6 @@

self.isArgument = null;
self.isResult = null;
self.Constructor = null;
self.surface = null;
self.rw = new StructRW(self);
self.rw = new self.RW(self);
self.linked = false;

@@ -90,2 +92,4 @@ }

ThriftStruct.prototype.typeid = TYPE.STRUCT;
ThriftStruct.prototype.RW = StructRW;
ThriftStruct.prototype.isUnion = false;

@@ -156,3 +160,3 @@ ThriftStruct.prototype.toBuffer = function toBuffer(struct) {

field.defaultValue !== null && field.defaultValue !== undefined ||
self.isArgument || self.isResult,
self.isArgument || self.isResult || self.isUnion,
'every field must be marked optional, required, or have a default value on ' +

@@ -380,2 +384,3 @@ self.name + ' including "' + field.name + '" in strict mode'

offset = result.offset;
// TODO promote return error of set to a ReadResult error
self.spec.set(struct, field.name, result.value);

@@ -382,0 +387,0 @@ }

@@ -43,2 +43,3 @@ // Copyright (c) 2015 Uber Technologies, Inc.

require('./exception');
require('./union');
require('./service');

@@ -45,0 +46,0 @@ require('./thrift');

@@ -174,3 +174,5 @@ // Copyright (c) 2015 Uber Technologies, Inc.

try {
var thriftGraph = new Thrift({source: 'struct Graph { 1: required map<byte, byte> (js.type = "bogus") edges }'});
var thriftGraph = new Thrift({
source: 'struct Graph { 1: required map<byte, byte> (js.type = "bogus") edges }'
});
assert.ok(!thriftGraph, 'should not parse');

@@ -177,0 +179,0 @@ } catch (err) {

@@ -32,2 +32,3 @@ // Copyright (c) 2015 Uber Technologies, Inc.

var ThriftException = require('./exception').ThriftException;
var ThriftUnion = require('./union').ThriftUnion;
var ThriftEnum = require('./enum').ThriftEnum;

@@ -118,4 +119,4 @@

Struct: 'compileStruct',
Typedef: 'compileTypedef'
// TODO Union: 'compileUnion'
Typedef: 'compileTypedef',
Union: 'compileUnion'
};

@@ -152,2 +153,11 @@

Thrift.prototype.compileUnion = function compileUnion(def) {
var self = this;
var spec = new ThriftUnion({strict: self.strict});
spec.compile(def, self);
self.claim(spec.fullName, def);
self.types[spec.fullName] = spec;
return spec;
};
Thrift.prototype.compileTypedef = function compileTypedef(def) {

@@ -154,0 +164,0 @@ var self = this;

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