@aws-amplify/core
Version:
Core category of aws-amplify
23 lines (21 loc) • 992 B
JavaScript
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
Object.defineProperty(exports, "__esModule", { value: true });
exports.angularSSRDetect = exports.angularWebDetect = void 0;
const helpers_1 = require("./helpers");
// Tested with @angular/core 16.0.0
function angularWebDetect() {
const angularVersionSetInDocument = Boolean((0, helpers_1.documentExists)() && document.querySelector('[ng-version]'));
const angularContentSetInWindow = Boolean((0, helpers_1.windowExists)() && typeof window.ng !== 'undefined');
return angularVersionSetInDocument || angularContentSetInWindow;
}
exports.angularWebDetect = angularWebDetect;
function angularSSRDetect() {
return (((0, helpers_1.processExists)() &&
typeof process.env === 'object' &&
process.env.npm_lifecycle_script?.startsWith('ng ')) ||
false);
}
exports.angularSSRDetect = angularSSRDetect;
//# sourceMappingURL=Angular.js.map
;