Comparing version 3.0.1 to 3.0.2
@@ -44,3 +44,3 @@ // Copyright (c) 2015 Uber Technologies, Inc. | ||
var end = paths[0].lastIndexOf('/', length - 1); | ||
return paths[0].slice(0, end); | ||
return paths[0].slice(0, end + 1); | ||
} | ||
@@ -47,0 +47,0 @@ |
{ | ||
"name": "thriftrw", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "thrift encoding/decoding using bufrw", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -55,15 +55,21 @@ // Copyright (c) 2015 Uber Technologies, Inc. | ||
'/home/luser/app/idl/common.thrift' | ||
], path: '/home/luser/app/idl'}, | ||
], path: '/home/luser/app/idl/'}, | ||
{paths: [ | ||
'/home/luser/app/idl/alice/alice.thrift', | ||
'/home/luser/app/idl/alice.thrift' | ||
], path: '/home/luser/app/idl'}, | ||
], path: '/home/luser/app/idl/'}, | ||
{paths: [ | ||
'/home/luser/app/idl/alice', | ||
'/home/luser/app/idl/bob' | ||
], path: '/home/luser/app/idl'}, | ||
], path: '/home/luser/app/idl/'}, | ||
{paths: [ | ||
'/home/luser/app/idl/', | ||
'/home/luser/app/idl/' | ||
], path: '/home/luser/app/idl'} | ||
], path: '/home/luser/app/idl/'}, | ||
{paths: [ | ||
'service.thrift' | ||
], path: ''}, | ||
{paths: [ | ||
'/home/luser/app/idl/service.thrift' | ||
], path: '/home/luser/app/idl/'} | ||
]; | ||
@@ -70,0 +76,0 @@ |
@@ -31,6 +31,11 @@ // Copyright (c) 2015 Uber Technologies, Inc. | ||
test('thrift parses', function t(assert) { | ||
test('thrift parses from source', function t(assert) { | ||
var filename = path.join(__dirname, 'thrift.thrift'); | ||
var source = fs.readFileSync(filename, 'ascii'); | ||
thrift = new Thrift({source: source}); | ||
assert.equal( | ||
thrift.getSources().entryPoint, | ||
'service.thrift', | ||
'Correct default entryPoint value when no includes' | ||
); | ||
assert.pass('thrift parses'); | ||
@@ -40,2 +45,17 @@ assert.end(); | ||
test('thrift parses from entryPoint', function t(assert) { | ||
var filename = path.join(__dirname, 'thrift.thrift'); | ||
thrift = new Thrift({ | ||
entryPoint: filename, | ||
allowFilesystemAccess: true | ||
}); | ||
assert.equal( | ||
thrift.getSources().entryPoint, | ||
'thrift.thrift', | ||
'Correct default entryPoint value when no includes' | ||
); | ||
assert.pass('thrift parses'); | ||
assert.end(); | ||
}); | ||
test('can get type result from thrift', function t(assert) { | ||
@@ -42,0 +62,0 @@ var res = thrift.getTypeResult('Struct'); |
@@ -64,4 +64,4 @@ // Copyright (c) 2015 Uber Technologies, Inc. | ||
assert(typeof options.source === 'string', 'source must be string'); | ||
options.entryPoint = 'source.thrift'; | ||
options.idls = {'source.thrift': options.source}; | ||
options.entryPoint = 'service.thrift'; | ||
options.idls = {'service.thrift': options.source}; | ||
} | ||
@@ -158,5 +158,5 @@ | ||
var filename = filenames[index]; | ||
idls[filename.slice(common.length + 1)] = self.idls[filename]; | ||
idls[filename.slice(common.length)] = self.idls[filename]; | ||
} | ||
var entryPoint = self.filename.slice(common.length + 1); | ||
var entryPoint = self.filename.slice(common.length); | ||
return {entryPoint: entryPoint, idls: idls}; | ||
@@ -163,0 +163,0 @@ }; |
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
419512
7640