Skip to content

Commit

Permalink
fix: A couple minor bug fixes (#436)
Browse files Browse the repository at this point in the history
* Fix so deref always returns an object.
* Fix SelectOnClick so it does not crash
* chore: fix demo's webpack.config.ts
* Fix space
  • Loading branch information
MrBlenny authored and RomanHotsiy committed Mar 14, 2018
1 parent 390f6c1 commit 5dc21af
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion demo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { render } from 'react-dom';
import styled from 'styled-components';
import { resolve as urlResolve } from 'url';
import { RedocStandalone } from '../';
import { RedocStandalone } from '../src';
import ComboBox from './ComboBox';

const demos = [
Expand Down
15 changes: 15 additions & 0 deletions demo/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ export default {
resolve: {
extensions: ['.ts', '.tsx', '.js', '.json'],
},

node: {
fs: 'empty',
},

module: {
rules: [
Expand Down Expand Up @@ -56,6 +60,17 @@ export default {
},
},
},
{
test: /node_modules\/(swagger2openapi|reftools)\/.*\.js$/,
use: {
loader: 'awesome-typescript-loader',
options: {
transpileOnly: true,
allowJs: true,
instance: 'ts2js-transpiler-only',
},
},
},
],
},
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion src/components/SelectOnClick/SelectOnClick.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ClipboardService } from '../../services';
export class SelectOnClick extends React.PureComponent {
private child: HTMLDivElement | null;
handleClick = () => {
ClipboardService.selectElement(this.refs.child);
ClipboardService.selectElement(this.child);
};

render() {
Expand Down
2 changes: 1 addition & 1 deletion src/services/OpenAPIParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class OpenAPIParser {
} catch (e) {
// do nothing
}
return res;
return res || {};
};

/**
Expand Down

0 comments on commit 5dc21af

Please sign in to comment.