@aws-amplify/core
Version:
Core category of aws-amplify
18 lines (17 loc) • 726 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.nextSSRDetect = exports.nextWebDetect = void 0;
var helpers_1 = require("./helpers");
// Tested with next 13.4 / react 18.2
function nextWebDetect() {
// @ts-ignore
return (0, helpers_1.windowExists)() && window['next'] && typeof window['next'] === 'object';
}
exports.nextWebDetect = nextWebDetect;
function nextSSRDetect() {
return ((0, helpers_1.globalExists)() &&
((0, helpers_1.keyPrefixMatch)(global, '__next') || (0, helpers_1.keyPrefixMatch)(global, '__NEXT')));
}
exports.nextSSRDetect = nextSSRDetect;
;