diff options
author | Fabio Berger <me@fabioberger.com> | 2017-12-22 04:24:54 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-12-22 04:24:54 +0800 |
commit | e01c0f054d2dbb043aec8b4cb8e1c47f83bd5eb9 (patch) | |
tree | 241b630db5044974cc17130f149ca64728d9c619 /packages/website/ts/pages/documentation/docs_info.ts | |
parent | d725de72861c6a6218c7f4822a339175a2da7403 (diff) | |
parent | cb3582289ff94857d5956bbd71dbf68ee3f42ecf (diff) | |
download | dexon-sol-tools-e01c0f054d2dbb043aec8b4cb8e1c47f83bd5eb9.tar.gz dexon-sol-tools-e01c0f054d2dbb043aec8b4cb8e1c47f83bd5eb9.tar.zst dexon-sol-tools-e01c0f054d2dbb043aec8b4cb8e1c47f83bd5eb9.zip |
Merge branch 'development' into fix/docLinks
* development:
Update and standardize contracts README
Add to CHANGELOG
Refactor toBaseUnitAmount so that it throws if user supplies unitAmount with too many decimals
Make assertion stricter so that one cannot submit invalid baseUnit amounts to `toUnitAmount`
Add some missed underscores, update changelog and comments
Add new underscore-privates rule to @0xproject/tslint-config and fix lint errors
# Conflicts:
# packages/website/ts/pages/documentation/documentation.tsx
# packages/website/ts/pages/shared/nested_sidebar_menu.tsx
Diffstat (limited to 'packages/website/ts/pages/documentation/docs_info.ts')
-rw-r--r-- | packages/website/ts/pages/documentation/docs_info.ts | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/packages/website/ts/pages/documentation/docs_info.ts b/packages/website/ts/pages/documentation/docs_info.ts index 1afcf8aaf..b88b247e8 100644 --- a/packages/website/ts/pages/documentation/docs_info.ts +++ b/packages/website/ts/pages/documentation/docs_info.ts @@ -19,7 +19,7 @@ export class DocsInfo { public menu: DocsMenu; public sections: SectionsMap; public sectionNameToMarkdown: {[sectionName: string]: string}; - private docsInfo: DocsInfoConfig; + private _docsInfo: DocsInfoConfig; constructor(config: DocsInfoConfig) { this.displayName = config.displayName; this.packageUrl = config.packageUrl; @@ -28,32 +28,32 @@ export class DocsInfo { this.docsJsonRoot = config.docsJsonRoot; this.sections = config.sections; this.sectionNameToMarkdown = config.sectionNameToMarkdown; - this.docsInfo = config; + this._docsInfo = config; } public isPublicType(typeName: string): boolean { - if (_.isUndefined(this.docsInfo.publicTypes)) { + if (_.isUndefined(this._docsInfo.publicTypes)) { return false; } - const isPublic = _.includes(this.docsInfo.publicTypes, typeName); + const isPublic = _.includes(this._docsInfo.publicTypes, typeName); return isPublic; } public getModulePathsIfExists(sectionName: string): string[] { - const modulePathsIfExists = this.docsInfo.sectionNameToModulePath[sectionName]; + const modulePathsIfExists = this._docsInfo.sectionNameToModulePath[sectionName]; return modulePathsIfExists; } public getMenu(selectedVersion?: string): {[section: string]: string[]} { - if (_.isUndefined(selectedVersion) || _.isUndefined(this.docsInfo.menuSubsectionToVersionWhenIntroduced)) { - return this.docsInfo.menu; + if (_.isUndefined(selectedVersion) || _.isUndefined(this._docsInfo.menuSubsectionToVersionWhenIntroduced)) { + return this._docsInfo.menu; } - const finalMenu = _.cloneDeep(this.docsInfo.menu); + const finalMenu = _.cloneDeep(this._docsInfo.menu); if (_.isUndefined(finalMenu.contracts)) { return finalMenu; } // TODO: refactor to include more sections then simply the `contracts` section finalMenu.contracts = _.filter(finalMenu.contracts, (contractName: string) => { - const versionIntroducedIfExists = this.docsInfo.menuSubsectionToVersionWhenIntroduced[contractName]; + const versionIntroducedIfExists = this._docsInfo.menuSubsectionToVersionWhenIntroduced[contractName]; if (!_.isUndefined(versionIntroducedIfExists)) { const existsInSelectedVersion = compareVersions(selectedVersion, versionIntroducedIfExists) >= 0; @@ -104,9 +104,9 @@ export class DocsInfo { return typeDefinitionByName; } public isVisibleConstructor(sectionName: string): boolean { - return _.includes(this.docsInfo.visibleConstructors, sectionName); + return _.includes(this._docsInfo.visibleConstructors, sectionName); } public convertToDocAgnosticFormat(docObj: DoxityDocObj|TypeDocNode): DocAgnosticFormat { - return this.docsInfo.convertToDocAgnosticFormatFn(docObj, this); + return this._docsInfo.convertToDocAgnosticFormatFn(docObj, this); } } |