mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-25 18:13:44 +03:00
fix: A couple minor bug fixes (#436)
* Fix so deref always returns an object. * Fix SelectOnClick so it does not crash * chore: fix demo's webpack.config.ts * Fix space
This commit is contained in:
parent
390f6c1324
commit
5dc21af281
|
@ -2,7 +2,7 @@ import * as React from 'react';
|
||||||
import { render } from 'react-dom';
|
import { render } from 'react-dom';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
import { resolve as urlResolve } from 'url';
|
import { resolve as urlResolve } from 'url';
|
||||||
import { RedocStandalone } from '../';
|
import { RedocStandalone } from '../src';
|
||||||
import ComboBox from './ComboBox';
|
import ComboBox from './ComboBox';
|
||||||
|
|
||||||
const demos = [
|
const demos = [
|
||||||
|
|
|
@ -28,6 +28,10 @@ export default {
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.ts', '.tsx', '.js', '.json'],
|
extensions: ['.ts', '.tsx', '.js', '.json'],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
node: {
|
||||||
|
fs: 'empty',
|
||||||
|
},
|
||||||
|
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
|
@ -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: [
|
plugins: [
|
||||||
|
|
|
@ -5,7 +5,7 @@ import { ClipboardService } from '../../services';
|
||||||
export class SelectOnClick extends React.PureComponent {
|
export class SelectOnClick extends React.PureComponent {
|
||||||
private child: HTMLDivElement | null;
|
private child: HTMLDivElement | null;
|
||||||
handleClick = () => {
|
handleClick = () => {
|
||||||
ClipboardService.selectElement(this.refs.child);
|
ClipboardService.selectElement(this.child);
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
|
@ -105,7 +105,7 @@ export class OpenAPIParser {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
return res;
|
return res || {};
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user