@@ -48,7 +48,7 @@ export interface PackageDefinition {
48
48
}
49
49
50
50
export type Options = Protobuf . IParseOptions & Protobuf . IConversionOptions & {
51
- include ?: string [ ] ;
51
+ includeDirs ?: string [ ] ;
52
52
} ;
53
53
54
54
function joinName ( baseName : string , name : string ) : string {
@@ -154,15 +154,15 @@ function addIncludePathResolver(root: Protobuf.Root, includePaths: string[]) {
154
154
* `defaults` is `false`. Defaults to `false`.
155
155
* @param options.oneofs Set virtual oneof properties to the present field's
156
156
* name
157
- * @param options.include Paths to search for imported `.proto` files.
157
+ * @param options.includeDirs Paths to search for imported `.proto` files.
158
158
*/
159
159
export function load ( filename : string , options : Options ) : Promise < PackageDefinition > {
160
160
const root : Protobuf . Root = new Protobuf . Root ( ) ;
161
- if ( ! ! options . include ) {
162
- if ( ! ( options . include instanceof Array ) ) {
163
- return Promise . reject ( new Error ( 'The include option must be an array' ) ) ;
161
+ if ( ! ! options . includeDirs ) {
162
+ if ( ! ( options . includeDirs instanceof Array ) ) {
163
+ return Promise . reject ( new Error ( 'The includeDirs option must be an array' ) ) ;
164
164
}
165
- addIncludePathResolver ( root , options . include as string [ ] ) ;
165
+ addIncludePathResolver ( root , options . includeDirs as string [ ] ) ;
166
166
}
167
167
return root . load ( filename , options ) . then ( ( loadedRoot ) => {
168
168
loadedRoot . resolveAll ( ) ;
@@ -172,11 +172,11 @@ export function load(filename: string, options: Options): Promise<PackageDefinit
172
172
173
173
export function loadSync ( filename : string , options : Options ) : PackageDefinition {
174
174
const root : Protobuf . Root = new Protobuf . Root ( ) ;
175
- if ( ! ! options . include ) {
176
- if ( ! ( options . include instanceof Array ) ) {
175
+ if ( ! ! options . includeDirs ) {
176
+ if ( ! ( options . includeDirs instanceof Array ) ) {
177
177
throw new Error ( 'The include option must be an array' ) ;
178
178
}
179
- addIncludePathResolver ( root , options . include as string [ ] ) ;
179
+ addIncludePathResolver ( root , options . includeDirs as string [ ] ) ;
180
180
}
181
181
const loadedRoot = root . loadSync ( filename , options ) ;
182
182
loadedRoot . resolveAll ( ) ;
0 commit comments