From 7f85a775d6149adb131d8478efe89e10c1a6679c Mon Sep 17 00:00:00 2001 From: James Roper Date: Fri, 29 Mar 2019 16:03:51 +1100 Subject: [PATCH] Fixed load/loadSync filename parameter type Fixes #805. Changed the type of the filename parameter to the proto-loader load method to match the type of the protobuf.js load method that it is passed to. Signed-off-by: James Roper --- packages/proto-loader/src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/proto-loader/src/index.ts b/packages/proto-loader/src/index.ts index 2e1a2b84..f3273635 100644 --- a/packages/proto-loader/src/index.ts +++ b/packages/proto-loader/src/index.ts @@ -243,8 +243,8 @@ function addIncludePathResolver(root: Protobuf.Root, includePaths: string[]) { /** * Load a .proto file with the specified options. - * @param filename The file path to load. Can be an absolute path or relative to - * an include path. + * @param filename One or multiple file paths to load. Can be an absolute path + * or relative to an include path. * @param options.keepCase Preserve field names. The default is to change them * to camel case. * @param options.longs The type that should be used to represent `long` values. @@ -265,7 +265,7 @@ function addIncludePathResolver(root: Protobuf.Root, includePaths: string[]) { * name * @param options.includeDirs Paths to search for imported `.proto` files. */ -export function load(filename: string, options?: Options): Promise { +export function load(filename: string | string[], options?: Options): Promise { const root: Protobuf.Root = new Protobuf.Root(); options = options || {}; if (!!options.includeDirs) { @@ -280,7 +280,7 @@ export function load(filename: string, options?: Options): Promise