mirror of https://github.com/grpc/grpc-node.git
Merge pull request #806 from jroper/multi-filenames
Fixed load/loadSync filename parameter type
This commit is contained in:
commit
e5acca5a76
|
@ -270,8 +270,8 @@ function addIncludePathResolver(root: Protobuf.Root, includePaths: string[]) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load a .proto file with the specified options.
|
* Load a .proto file with the specified options.
|
||||||
* @param filename The file path to load. Can be an absolute path or relative to
|
* @param filename One or multiple file paths to load. Can be an absolute path
|
||||||
* an include path.
|
* or relative to an include path.
|
||||||
* @param options.keepCase Preserve field names. The default is to change them
|
* @param options.keepCase Preserve field names. The default is to change them
|
||||||
* to camel case.
|
* to camel case.
|
||||||
* @param options.longs The type that should be used to represent `long` values.
|
* @param options.longs The type that should be used to represent `long` values.
|
||||||
|
@ -293,7 +293,7 @@ function addIncludePathResolver(root: Protobuf.Root, includePaths: string[]) {
|
||||||
* @param options.includeDirs Paths to search for imported `.proto` files.
|
* @param options.includeDirs Paths to search for imported `.proto` files.
|
||||||
*/
|
*/
|
||||||
export function load(
|
export function load(
|
||||||
filename: string, options?: Options): Promise<PackageDefinition> {
|
filename: string | string[], options?: Options): Promise<PackageDefinition> {
|
||||||
const root: Protobuf.Root = new Protobuf.Root();
|
const root: Protobuf.Root = new Protobuf.Root();
|
||||||
options = options || {};
|
options = options || {};
|
||||||
if (!!options.includeDirs) {
|
if (!!options.includeDirs) {
|
||||||
|
@ -310,7 +310,7 @@ export function load(
|
||||||
}
|
}
|
||||||
|
|
||||||
export function loadSync(
|
export function loadSync(
|
||||||
filename: string, options?: Options): PackageDefinition {
|
filename: string | string[], options?: Options): PackageDefinition {
|
||||||
const root: Protobuf.Root = new Protobuf.Root();
|
const root: Protobuf.Root = new Protobuf.Root();
|
||||||
options = options || {};
|
options = options || {};
|
||||||
if (!!options.includeDirs) {
|
if (!!options.includeDirs) {
|
||||||
|
|
Loading…
Reference in New Issue