UNPKG

1.21 kBJavaScriptView Raw
1"use strict";
2/**
3 * @license
4 * Copyright Google LLC All Rights Reserved.
5 *
6 * Use of this source code is governed by an MIT-style license that can be
7 * found in the LICENSE file at https://angular.io/license
8 */
9Object.defineProperty(exports, "__esModule", { value: true });
10exports.forceAutocomplete = exports.ngDebug = exports.disableVersionCheck = exports.isCI = exports.analyticsDisabled = void 0;
11function isPresent(variable) {
12 return typeof variable === 'string' && variable !== '';
13}
14function isDisabled(variable) {
15 return isPresent(variable) && (variable === '0' || variable.toLowerCase() === 'false');
16}
17function isEnabled(variable) {
18 return isPresent(variable) && (variable === '1' || variable.toLowerCase() === 'true');
19}
20function optional(variable) {
21 if (!isPresent(variable)) {
22 return undefined;
23 }
24 return isEnabled(variable);
25}
26exports.analyticsDisabled = isDisabled(process.env['NG_CLI_ANALYTICS']);
27exports.isCI = isEnabled(process.env['CI']);
28exports.disableVersionCheck = isEnabled(process.env['NG_DISABLE_VERSION_CHECK']);
29exports.ngDebug = isEnabled(process.env['NG_DEBUG']);
30exports.forceAutocomplete = optional(process.env['NG_FORCE_AUTOCOMPLETE']);