Skip to content

Commit

Permalink
Change name of option
Browse files Browse the repository at this point in the history
  • Loading branch information
k15a committed Feb 7, 2018
1 parent e92d325 commit c3d2dc3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/babel-plugin-flow-runtime/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The plugin supports the following options:

- `assert` - Boolean, indicates whether types should be asserted at runtime. Defaults to `true` if `process.env.NODE_ENV === 'development'`, otherwise `false`.
- `annotate` - Boolean, indicates whether object or function values that have type annotations should be decorated with those types at runtime. Defaults to `true`.
- `flowRuntimePath` - String, indicates which runtime to use. Defaults to `flow-runtime`
- `libraryName` - String, indicates which runtime to use. Defaults to `flow-runtime`


If `assert` is `true`, the following code:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('transform', () => {
}
if (customRuntime) {
it(`should transform ${name} with custom runtime path`, () => {
testTransform(input, {flowRuntimePath: './custom-flow-runtime'}, customRuntime);
testTransform(input, {libraryName: './custom-flow-runtime'}, customRuntime);
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ export type Options = {
suppressTypes?: string[];
// deprecated
decorate?: boolean;
flowRuntimePath?: string,
libraryName?: string,
};

export default function createConversionContext (options: Options): ConversionContext {

const context = new ConversionContext();

if (options.flowRuntimePath) {
context.libraryName = options.flowRuntimePath;
if (options.libraryName) {
context.libraryName = options.libraryName;
}

context.optInOnly = options.optInOnly ? true : false;
Expand Down

0 comments on commit c3d2dc3

Please sign in to comment.