diff options
author | Fabio Berger <me@fabioberger.com> | 2017-11-28 11:38:09 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-11-28 11:38:09 +0800 |
commit | 0a19ba3014ac68c1c94fcb376bc1ddb5081db757 (patch) | |
tree | 0f7a8572c1fb6172b3f0474dd6e6356f569f8760 /packages/website/ts/utils/doc_utils.ts | |
parent | 88bd0f5328863141564faf2718118594732b66ca (diff) | |
download | dexon-sol-tools-0a19ba3014ac68c1c94fcb376bc1ddb5081db757.tar.gz dexon-sol-tools-0a19ba3014ac68c1c94fcb376bc1ddb5081db757.tar.zst dexon-sol-tools-0a19ba3014ac68c1c94fcb376bc1ddb5081db757.zip |
Fix tslint issues
Diffstat (limited to 'packages/website/ts/utils/doc_utils.ts')
-rw-r--r-- | packages/website/ts/utils/doc_utils.ts | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/packages/website/ts/utils/doc_utils.ts b/packages/website/ts/utils/doc_utils.ts index ca6e0dc52..594e3bae6 100644 --- a/packages/website/ts/utils/doc_utils.ts +++ b/packages/website/ts/utils/doc_utils.ts @@ -1,9 +1,9 @@ -import * as _ from 'lodash'; import findVersions = require('find-versions'); -import convert = require('xml-js'); +import * as _ from 'lodash'; +import {DoxityDocObj, S3FileObject, TypeDocNode, VersionToFileName} from 'ts/types'; import {constants} from 'ts/utils/constants'; import {utils} from 'ts/utils/utils'; -import {VersionToFileName, S3FileObject, TypeDocNode, DoxityDocObj} from 'ts/types'; +import convert = require('xml-js'); export const docUtils = { async getVersionToFileNameAsync(s3DocJsonRoot: string): @@ -29,12 +29,10 @@ export const docUtils = { compact: true, }); const responseObj = JSON.parse(responseJSONString); - let fileObjs: S3FileObject[]; - if (_.isArray(responseObj.ListBucketResult.Contents)) { - fileObjs = responseObj.ListBucketResult.Contents as S3FileObject[]; - } else { - fileObjs = [responseObj.ListBucketResult.Contents]; - } + const fileObjs: S3FileObject[] = (_.isArray(responseObj.ListBucketResult.Contents)) ? + responseObj.ListBucketResult.Contents as S3FileObject[] : + [responseObj.ListBucketResult.Contents]; + const versionFileNames = _.map(fileObjs, fileObj => { return fileObj.Key._text; }); |