resolve-protobuf-schema
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -14,4 +14,3 @@ var schema = require('protobuf-schema') | ||
var proto = fs.readFileSync(filename, 'utf-8') | ||
var sch = schema(sch) | ||
var sch = schema(fs.readFileSync(filename, 'utf-8')) | ||
var imports = [].concat(sch.imports || []) | ||
@@ -18,0 +17,0 @@ |
{ | ||
"name": "resolve-protobuf-schema", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Read a protobuf schema from the disk, parse it and resolve all imports", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,2 +9,4 @@ # resolve-protobuf-schema | ||
[![build status](http://img.shields.io/travis/mafintosh/resolve-protobuf-schema.svg?style=flat)](http://travis-ci.org/mafintosh/resolve-protobuf-schema) | ||
## Usage | ||
@@ -44,3 +46,3 @@ | ||
* `resolve(path, cb)` read and resolve a schema | ||
* `resolve.sync()` sync version of `resolve` | ||
* `resolve.sync(path)` sync version of `resolve` | ||
@@ -47,0 +49,0 @@ ## License |
var tape = require('tape') | ||
var schema = require('../') | ||
tape('c', function(t) { | ||
var test = function(name, fn) { | ||
tape(name, function(t) { | ||
fn(t, schema) | ||
}) | ||
tape(name+' sync', function(t) { | ||
fn(t, function(name, cb) { | ||
cb(null, schema.sync(name)) | ||
}) | ||
}) | ||
} | ||
test('c', function(t, schema) { | ||
schema(__dirname+'/c.proto', function(err, sch) { | ||
@@ -16,3 +27,3 @@ t.notOk(err, 'no err') | ||
tape('b imports c', function(t) { | ||
test('b imports c', function(t, schema) { | ||
schema(__dirname+'/b.proto', function(err, sch) { | ||
@@ -29,3 +40,3 @@ t.notOk(err, 'no err') | ||
tape('a imports b imports c', function(t) { | ||
test('a imports b imports c', function(t, schema) { | ||
schema(__dirname+'/a.proto', function(err, sch) { | ||
@@ -32,0 +43,0 @@ t.notOk(err, 'no err') |
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
5240
10
81
50