Repository: digitalocean/nginxconfig.io
File: src/nginxconfig/util/backwards_compatibility.js (JavaScript)

Code before:
const domainMap = {
    domain:                 ['server', 'domain'],
    path:                   ['server', 'path'],
    document_root:          ['server', 'documentRoot'],
    non_www:                ['server', 'wwwSubdomain', val => !oldBool(val)],
    cdn:                    ['server', 'cdnSubdomain', oldBool],
    redirect:               ['server', 'redirectSubdomains', oldBool],
    ipv4:                   ['server', 'listenIpv4'],
    ipv6:                   ['server', 'listenIpv6'],

    https:                  ['https', 'https', oldBool],
    http2:                  ['https', 'http2', oldBool],
    force_https:            ['https', 'forceHttps', oldBool],
    hsts:                   ['https', 'hsts', oldBool],
    hsts_subdomains:        ['https', 'hstsSubdomains', oldBool],
    hsts_preload:           ['https', 'hstsPreload', oldBool],
    cert_type:              ['https', 'certType', val => val.toLowerCase().trim() === 'custom' ? 'custom' : 'letsEncrypt'],
    email:                  ['https', 'letsEncryptEmail'],
    ssl_certificate:        ['https', 'sslCertificate'],
    ssl_certificate_key:    ['https', 'sslCertificateKey'],

    php:                    ['php', 'php', oldBool],
    wordpress:              ['php', 'wordPressRules', oldBool],
    drupal:                 ['php', 'drupalRules', oldBool],
    magento:                ['php', 'magentoRules', oldBool],
    joomla:                 ['php', 'joomlaRules', oldBool],

    python:                 ['python', 'python', oldBool],
    django:                 ['python', 'djangoRules', oldBool],

    proxy:                  ['reverseProxy', 'reverseProxy', oldBool],
    proxy_path:             ['reverseProxy', 'path'],
    proxy_pass:             ['reverseProxy', 'proxyPass'],

    root:                   ['routing', 'root', oldBool],
    index:                  ['routing', 'index'],
    fallback_html:          ['routing', 'fallbackHtml', oldBool],
    fallback_php:           ['routing', 'fallbackPhp', oldBool],
    fallback_php_path:      ['routing', 'fallbackPhpPath'],
    php_legacy_routing:     ['routing', 'legacyPhpRouting', oldBool],

    access_log_domain:      ['logging', 'accessLog', oldBool],
    error_log_domain:       ['logging', 'errorLog', oldBool],
};

// Handle converting the old query format from nginxconfig.io-angular to our new query params
export default data => {
    // Hold any mapped global data
    const mappedGlobal = {};

    // Handle converting global settings & storing domains

Review comment (suggestion):
```suggestion
```
Joomla was not supported on the old tool, so no backwards compatibility is needed

Code after:
const domainMap = {
    domain:                 ['server', 'domain'],
    path:                   ['server', 'path'],
    document_root:          ['server', 'documentRoot'],
    non_www:                ['server', 'wwwSubdomain', val => !oldBool(val)],
    cdn:                    ['server', 'cdnSubdomain', oldBool],
    redirect:               ['server', 'redirectSubdomains', oldBool],
    ipv4:                   ['server', 'listenIpv4'],
    ipv6:                   ['server', 'listenIpv6'],

    https:                  ['https', 'https', oldBool],
    http2:                  ['https', 'http2', oldBool],
    force_https:            ['https', 'forceHttps', oldBool],
    hsts:                   ['https', 'hsts', oldBool],
    hsts_subdomains:        ['https', 'hstsSubdomains', oldBool],
    hsts_preload:           ['https', 'hstsPreload', oldBool],
    cert_type:              ['https', 'certType', val => val.toLowerCase().trim() === 'custom' ? 'custom' : 'letsEncrypt'],
    email:                  ['https', 'letsEncryptEmail'],
    ssl_certificate:        ['https', 'sslCertificate'],
    ssl_certificate_key:    ['https', 'sslCertificateKey'],

    php:                    ['php', 'php', oldBool],
    wordpress:              ['php', 'wordPressRules', oldBool],
    drupal:                 ['php', 'drupalRules', oldBool],
    magento:                ['php', 'magentoRules', oldBool],

    python:                 ['python', 'python', oldBool],
    django:                 ['python', 'djangoRules', oldBool],

    proxy:                  ['reverseProxy', 'reverseProxy', oldBool],
    proxy_path:             ['reverseProxy', 'path'],
    proxy_pass:             ['reverseProxy', 'proxyPass'],

    root:                   ['routing', 'root', oldBool],
    index:                  ['routing', 'index'],
    fallback_html:          ['routing', 'fallbackHtml', oldBool],
    fallback_php:           ['routing', 'fallbackPhp', oldBool],
    fallback_php_path:      ['routing', 'fallbackPhpPath'],
    php_legacy_routing:     ['routing', 'legacyPhpRouting', oldBool],

    access_log_domain:      ['logging', 'accessLog', oldBool],
    error_log_domain:       ['logging', 'errorLog', oldBool],
};

// Handle converting the old query format from nginxconfig.io-angular to our new query params
export default data => {
    // Hold any mapped global data
    const mappedGlobal = {};

    // Handle converting global settings & storing domains
    for (const key in data) {