@modern-js/utils 2.5.0 → 2.5.1-alpha.0
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/is/index.d.ts +7 -0
- package/dist/is/index.js +6 -0
- package/package.json +5 -5
package/dist/is/index.d.ts
CHANGED
@@ -40,6 +40,13 @@ export declare const isUseSSRBundle: (config: any) => boolean;
|
|
40
40
|
|
41
41
|
export declare const isServiceWorker: (config: any) => boolean;
|
42
42
|
export declare const isFastRefresh: () => boolean;
|
43
|
+
export declare const isRouterV5: (config: {
|
44
|
+
runtime?: {
|
45
|
+
router?: {
|
46
|
+
mode?: string;
|
47
|
+
} | boolean;
|
48
|
+
};
|
49
|
+
}) => boolean;
|
43
50
|
export * from './node-env';
|
44
51
|
export * from './platform';
|
45
52
|
export * from './type';
|
package/dist/is/index.js
CHANGED
@@ -27,6 +27,7 @@ __export(is_exports, {
|
|
27
27
|
isDepExists: () => isDepExists,
|
28
28
|
isEmpty: () => isEmpty,
|
29
29
|
isFastRefresh: () => isFastRefresh,
|
30
|
+
isRouterV5: () => isRouterV5,
|
30
31
|
isSSR: () => isSSR,
|
31
32
|
isServiceWorker: () => isServiceWorker,
|
32
33
|
isTypescript: () => isTypescript,
|
@@ -82,11 +83,16 @@ const isServiceWorker = (config) => {
|
|
82
83
|
return false;
|
83
84
|
};
|
84
85
|
const isFastRefresh = () => (0, import_node_env.isDev)() && process.env.FAST_REFRESH !== "false";
|
86
|
+
const isRouterV5 = (config) => {
|
87
|
+
var _a, _b, _c;
|
88
|
+
return typeof ((_a = config.runtime) == null ? void 0 : _a.router) !== "boolean" && ((_c = (_b = config == null ? void 0 : config.runtime) == null ? void 0 : _b.router) == null ? void 0 : _c.mode) === "react-router-5";
|
89
|
+
};
|
85
90
|
// Annotate the CommonJS export names for ESM import in node:
|
86
91
|
0 && (module.exports = {
|
87
92
|
isDepExists,
|
88
93
|
isEmpty,
|
89
94
|
isFastRefresh,
|
95
|
+
isRouterV5,
|
90
96
|
isSSR,
|
91
97
|
isServiceWorker,
|
92
98
|
isTypescript,
|
package/package.json
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
"modern",
|
12
12
|
"modern.js"
|
13
13
|
],
|
14
|
-
"version": "2.5.0",
|
14
|
+
"version": "2.5.1-alpha.0",
|
15
15
|
"jsnext:source": "./src/index.ts",
|
16
16
|
"types": "./dist/index.d.ts",
|
17
17
|
"main": "./dist/index.js",
|
@@ -128,14 +128,14 @@
|
|
128
128
|
"lodash": "^4.17.21"
|
129
129
|
},
|
130
130
|
"devDependencies": {
|
131
|
+
"@modern-js/types": "2.5.0",
|
132
|
+
"@scripts/build": "2.5.0",
|
133
|
+
"@scripts/jest-config": "2.5.0",
|
131
134
|
"@types/jest": "^27",
|
132
135
|
"@types/node": "^14",
|
133
136
|
"jest": "^27",
|
134
137
|
"typescript": "^4",
|
135
|
-
"webpack": "^5.75.0"
|
136
|
-
"@modern-js/types": "2.5.0",
|
137
|
-
"@scripts/jest-config": "2.5.0",
|
138
|
-
"@scripts/build": "2.5.0"
|
138
|
+
"webpack": "^5.75.0"
|
139
139
|
},
|
140
140
|
"sideEffects": false,
|
141
141
|
"scripts": {
|