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

Code before:
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

import isObject from './is_object';

const oldBool = val => val.toString().trim() === '' ? true : val;

const globalMap = {
    ssl_profile:                ['https', 'sslProfile'],
    resolver_cloudflare:        ['https', 'ocspCloudflare', oldBool],
    resolver_google:            ['https', 'ocspGoogle', oldBool],
    resolver_opendns:           ['https', 'ocspOpenDns', oldBool],
    directory_letsencrypt:      ['https', 'letsEncryptRoot'],

    referrer_policy:            ['security', 'referrerPolicy'],
    content_security_policy:    ['security', 'contentSecurityPolicy'],
    server_tokens:              ['security', 'serverTokens', oldBool],
    limit_req:                  ['security', 'limitReq', oldBool],

    php_server:                 ['php', 'phpServer'],
    php_server_backup:          ['php', 'phpBackupServer'],

    python_server:              ['python', 'pythonServer'],

    disableHtmlCaching:         ['performance', 'disableHtmlCaching', oldBool],
    gzip:                       ['performance', 'gzipCompression', oldBool],
    brotli:                     ['performance', 'brotliCompression', oldBool],
    expires_assets:             ['performance', 'assetsExpiration'],
    expires_media:              ['performance', 'mediaExpiration'],
    expires_svg:                ['performance', 'svgExpiration'],
    expires_fonts:              ['performance', 'fontsExpiration'],

    access_log:                 ['logging', 'accessLog'],
    error_log:                  ['logging', 'errorLog'],
    log_not_found:              ['logging', 'logNotFound', oldBool],

    directory_nginx:            ['nginx', 'nginxConfigDirectory'],
    worker_processes:           ['nginx', 'workerProcesses'],
    user:                       ['nginx', 'user'],
    pid:                        ['nginx', 'pid'],
    client_max_body_size:       ['nginx', 'clientMaxBodySize'],

    file_structure:             ['tools', 'modularizedStructure', val => val.toLowerCase().trim() === 'modularized'],
    symlink:                    ['tools', 'symlinkVhost', oldBool],
};

const domainMap = {
    domain:                 ['server', 'domain'],
    path:                   ['server', 'path'],
    document_root:          ['server', 'documentRoot'],

Review comment (suggestion):
```suggestion
```
This doesn't need to be included here as this was never a feature in the Angular version of the tool

Code after:
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

import isObject from './is_object';

const oldBool = val => val.toString().trim() === '' ? true : val;

const globalMap = {
    ssl_profile:                ['https', 'sslProfile'],
    resolver_cloudflare:        ['https', 'ocspCloudflare', oldBool],
    resolver_google:            ['https', 'ocspGoogle', oldBool],
    resolver_opendns:           ['https', 'ocspOpenDns', oldBool],
    directory_letsencrypt:      ['https', 'letsEncryptRoot'],

    referrer_policy:            ['security', 'referrerPolicy'],
    content_security_policy:    ['security', 'contentSecurityPolicy'],
    server_tokens:              ['security', 'serverTokens', oldBool],
    limit_req:                  ['security', 'limitReq', oldBool],

    php_server:                 ['php', 'phpServer'],
    php_server_backup:          ['php', 'phpBackupServer'],

    python_server:              ['python', 'pythonServer'],

    gzip:                       ['performance', 'gzipCompression', oldBool],
    brotli:                     ['performance', 'brotliCompression', oldBool],
    expires_assets:             ['performance', 'assetsExpiration'],
    expires_media:              ['performance', 'mediaExpiration'],
    expires_svg:                ['performance', 'svgExpiration'],
    expires_fonts:              ['performance', 'fontsExpiration'],

    access_log:                 ['logging', 'accessLog'],
    error_log:                  ['logging', 'errorLog'],
    log_not_found:              ['logging', 'logNotFound', oldBool],

    directory_nginx:            ['nginx', 'nginxConfigDirectory'],
    worker_processes:           ['nginx', 'workerProcesses'],
    user:                       ['nginx', 'user'],
    pid:                        ['nginx', 'pid'],
    client_max_body_size:       ['nginx', 'clientMaxBodySize'],

    file_structure:             ['tools', 'modularizedStructure', val => val.toLowerCase().trim() === 'modularized'],
    symlink:                    ['tools', 'symlinkVhost', oldBool],
};

const domainMap = {
    domain:                 ['server', 'domain'],
    path:                   ['server', 'path'],
    document_root:          ['server', 'documentRoot'],
    non_www:                ['server', 'wwwSubdomain', val => !oldBool(val)],