@compiled/react 0.11.3 → 0.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/runtime/is-server-environment.js +4 -3
- package/dist/browser/runtime/is-server-environment.js.map +1 -1
- package/dist/cjs/runtime/is-server-environment.js +4 -3
- package/dist/cjs/runtime/is-server-environment.js.map +1 -1
- package/dist/esm/runtime/is-server-environment.js +4 -3
- package/dist/esm/runtime/is-server-environment.js.map +1 -1
- package/package.json +1 -1
- package/src/runtime/is-server-environment.ts +6 -3
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
var isJsDomEnvironment = function () {
|
|
6
6
|
return window.name === 'nodejs' ||
|
|
7
|
-
navigator.userAgent.includes('Node.js') ||
|
|
8
|
-
navigator.userAgent.includes('jsdom');
|
|
7
|
+
(navigator === null || navigator === void 0 ? void 0 : navigator.userAgent.includes('Node.js')) ||
|
|
8
|
+
(navigator === null || navigator === void 0 ? void 0 : navigator.userAgent.includes('jsdom'));
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Returns `true` when inside a node environment,
|
|
@@ -20,7 +20,8 @@ var isJsDomEnvironment = function () {
|
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
export var isServerEnvironment = function () {
|
|
23
|
-
if (typeof
|
|
23
|
+
if (typeof window === 'undefined' ||
|
|
24
|
+
(typeof process !== 'undefined' && process.versions != null && process.versions.node != null)) {
|
|
24
25
|
return true;
|
|
25
26
|
}
|
|
26
27
|
if (isJsDomEnvironment()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-server-environment.js","sourceRoot":"","sources":["../../../src/runtime/is-server-environment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,IAAM,kBAAkB,GAAG;IACzB,OAAA,MAAM,CAAC,IAAI,KAAK,QAAQ;
|
|
1
|
+
{"version":3,"file":"is-server-environment.js","sourceRoot":"","sources":["../../../src/runtime/is-server-environment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,IAAM,kBAAkB,GAAG;IACzB,OAAA,MAAM,CAAC,IAAI,KAAK,QAAQ;SACxB,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;SACxC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;AAFtC,CAEsC,CAAC;AACzC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,IAAM,mBAAmB,GAAG;IACjC,IACE,OAAO,MAAM,KAAK,WAAW;QAC7B,CAAC,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,EAC7F;QACA,OAAO,IAAI,CAAC;KACb;IACD,IAAI,kBAAkB,EAAE,EAAE;QACxB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
|
@@ -7,8 +7,8 @@ exports.isServerEnvironment = void 0;
|
|
|
7
7
|
*/
|
|
8
8
|
var isJsDomEnvironment = function () {
|
|
9
9
|
return window.name === 'nodejs' ||
|
|
10
|
-
navigator.userAgent.includes('Node.js') ||
|
|
11
|
-
navigator.userAgent.includes('jsdom');
|
|
10
|
+
(navigator === null || navigator === void 0 ? void 0 : navigator.userAgent.includes('Node.js')) ||
|
|
11
|
+
(navigator === null || navigator === void 0 ? void 0 : navigator.userAgent.includes('jsdom'));
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Returns `true` when inside a node environment,
|
|
@@ -23,7 +23,8 @@ var isJsDomEnvironment = function () {
|
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
var isServerEnvironment = function () {
|
|
26
|
-
if (typeof
|
|
26
|
+
if (typeof window === 'undefined' ||
|
|
27
|
+
(typeof process !== 'undefined' && process.versions != null && process.versions.node != null)) {
|
|
27
28
|
return true;
|
|
28
29
|
}
|
|
29
30
|
if (isJsDomEnvironment()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-server-environment.js","sourceRoot":"","sources":["../../../src/runtime/is-server-environment.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAM,kBAAkB,GAAG;IACzB,OAAA,MAAM,CAAC,IAAI,KAAK,QAAQ;
|
|
1
|
+
{"version":3,"file":"is-server-environment.js","sourceRoot":"","sources":["../../../src/runtime/is-server-environment.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAM,kBAAkB,GAAG;IACzB,OAAA,MAAM,CAAC,IAAI,KAAK,QAAQ;SACxB,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;SACxC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;AAFtC,CAEsC,CAAC;AACzC;;;;;;;;;;;GAWG;AACI,IAAM,mBAAmB,GAAG;IACjC,IACE,OAAO,MAAM,KAAK,WAAW;QAC7B,CAAC,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,EAC7F;QACA,OAAO,IAAI,CAAC;KACb;IACD,IAAI,kBAAkB,EAAE,EAAE;QACxB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAXW,QAAA,mBAAmB,uBAW9B"}
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
var isJsDomEnvironment = function () {
|
|
6
6
|
return window.name === 'nodejs' ||
|
|
7
|
-
navigator.userAgent.includes('Node.js') ||
|
|
8
|
-
navigator.userAgent.includes('jsdom');
|
|
7
|
+
(navigator === null || navigator === void 0 ? void 0 : navigator.userAgent.includes('Node.js')) ||
|
|
8
|
+
(navigator === null || navigator === void 0 ? void 0 : navigator.userAgent.includes('jsdom'));
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Returns `true` when inside a node environment,
|
|
@@ -20,7 +20,8 @@ var isJsDomEnvironment = function () {
|
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
export var isServerEnvironment = function () {
|
|
23
|
-
if (typeof
|
|
23
|
+
if (typeof window === 'undefined' ||
|
|
24
|
+
(typeof process !== 'undefined' && process.versions != null && process.versions.node != null)) {
|
|
24
25
|
return true;
|
|
25
26
|
}
|
|
26
27
|
if (isJsDomEnvironment()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-server-environment.js","sourceRoot":"","sources":["../../../src/runtime/is-server-environment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,IAAM,kBAAkB,GAAG;IACzB,OAAA,MAAM,CAAC,IAAI,KAAK,QAAQ;
|
|
1
|
+
{"version":3,"file":"is-server-environment.js","sourceRoot":"","sources":["../../../src/runtime/is-server-environment.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,IAAM,kBAAkB,GAAG;IACzB,OAAA,MAAM,CAAC,IAAI,KAAK,QAAQ;SACxB,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAA;SACxC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;AAFtC,CAEsC,CAAC;AACzC;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,IAAM,mBAAmB,GAAG;IACjC,IACE,OAAO,MAAM,KAAK,WAAW;QAC7B,CAAC,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,IAAI,IAAI,CAAC,EAC7F;QACA,OAAO,IAAI,CAAC;KACb;IACD,IAAI,kBAAkB,EAAE,EAAE;QACxB,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
const isJsDomEnvironment = () =>
|
|
6
6
|
window.name === 'nodejs' ||
|
|
7
|
-
navigator
|
|
8
|
-
navigator
|
|
7
|
+
navigator?.userAgent.includes('Node.js') ||
|
|
8
|
+
navigator?.userAgent.includes('jsdom');
|
|
9
9
|
/**
|
|
10
10
|
* Returns `true` when inside a node environment,
|
|
11
11
|
* else `false`.
|
|
@@ -19,7 +19,10 @@ const isJsDomEnvironment = () =>
|
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
21
|
export const isServerEnvironment = (): boolean => {
|
|
22
|
-
if (
|
|
22
|
+
if (
|
|
23
|
+
typeof window === 'undefined' ||
|
|
24
|
+
(typeof process !== 'undefined' && process.versions != null && process.versions.node != null)
|
|
25
|
+
) {
|
|
23
26
|
return true;
|
|
24
27
|
}
|
|
25
28
|
if (isJsDomEnvironment()) {
|