/** * Copyright (c) 2017-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ const React = require('react'); const CompLibrary = require('../../core/CompLibrary'); const Container = CompLibrary.Container; const GridBlock = CompLibrary.GridBlock; const CWD = process.cwd(); const siteConfig = require(CWD + '/siteConfig.js'); const versions = require(CWD + '/versions.json'); const repoUrl = `https://github.com/${siteConfig.repoPath}`; const docsUrl = `${siteConfig.baseUrl}docs`; const VersionsTable = ({ versions }) => ( {versions.map(version => ( ))}
{version.name} Documentation {version.infoLabel}
); class Versions extends React.Component { get latestVersion() { const name = versions[0]; return [{ name, docs: docsUrl, infoLabel: 'Release Notes', infoUrl: `${repoUrl}/releases/v${name}` }]; } get nextVersion() { return [{ name: 'master', docs: `${docsUrl}/next`, infoLabel: 'Source code', infoUrl: repoUrl }]; } get olderVersions() { return versions.slice(1).map(version => ({ name: version, docs: `${docsUrl}/${version}/`, infoLabel: 'Release Notes', infoUrl: `${repoUrl}/releases/v${version}` })); } render() { return (

{siteConfig.title + ' Versions'}

Current version (Stable)

Latest version of express-validator.

Latest version

Here you can find the latest documentation and unreleased code.

{this.olderVersions.length > 0 && (

Past versions

Here you can find documentation for previous versions of express-validator.

You can find past versions of this project{' '} on GitHub .

)}
); } } module.exports = Versions;