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

thriftrw

Package Overview
Dependencies
Maintainers
5
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 3.11.0 to 3.11.1

.idea/thriftrw-node.iml

5

CHANGELOG.md

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

# v3.11.1
- Propagate defaultAsUndefined to dependent Thrift constructors so that imported structs
will respect the configuration of the root Thrift object.
# v3.11.0

@@ -2,0 +7,0 @@

2

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

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

@@ -28,7 +28,7 @@ // Copyright (c) 2017 Uber Technologies, Inc.

var path = require('path');
var source = fs.readFileSync(path.join(__dirname, 'default.thrift'), 'ascii');
var entryIdl = path.join(__dirname, 'default.thrift');
var model;
test('default values on structs work', function t(assert) {
model = new Thrift({source: source});
model = new Thrift({entryPoint: entryIdl, allowFilesystemAccess: true});
var health = new model.Health({name: 'grand'});

@@ -40,2 +40,3 @@ assert.equals(health.ok, true, 'default truth value passes through');

assert.equals(health.respected, null, 'null is default value');
assert.equals(health.ragdoll, null, 'null is default value for dependent thrifts');
assert.deepEquals(health.numbers, [1, 2, 3], 'complex defaults serialize');

@@ -46,6 +47,7 @@ assert.end();

test('default value as undefined respected in constructor', function t(assert) {
model = new Thrift({source: source, defaultAsUndefined: true});
model = new Thrift({entryPoint: entryIdl, allowFilesystemAccess: true, defaultAsUndefined: true});
var health = new model.Health({name: 'grand'});
assert.equals(health.respected, undefined, 'undefined as default value');
assert.equals(health.ragdoll, undefined, 'undefined as default value for dependent thrifts');
assert.end();
});

@@ -88,2 +88,3 @@ // Copyright (c) 2017 Uber Technologies, Inc.

this.defaultValueDefinition = new Literal(options.defaultAsUndefined ? undefined : null);
this.defaultAsUndefined = options.defaultAsUndefined;

@@ -287,3 +288,4 @@ // [name] :Thrift* implementing {compile, link, &c}

allowOptionalArguments: this.allowOptionalArguments,
noLink: true
noLink: true,
defaultAsUndefined: this.defaultAsUndefined
});

@@ -290,0 +292,0 @@ }

Sorry, the diff of this file is not supported yet

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