@modern-js/utils 2.54.6 → 2.56.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -28,6 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var path_exports = {};
30
30
  __export(path_exports, {
31
+ formatImportPath: () => formatImportPath,
31
32
  getRealTemporaryDirectory: () => getRealTemporaryDirectory,
32
33
  getTemplatePath: () => getTemplatePath,
33
34
  isPathString: () => isPathString,
@@ -72,8 +73,12 @@ function splitPathString(str) {
72
73
  const removeLeadingSlash = (s) => s.replace(/^\/+/, "");
73
74
  const removeTailSlash = (s) => s.replace(/\/+$/, "");
74
75
  const removeSlash = (s) => removeLeadingSlash(removeTailSlash(s));
76
+ function formatImportPath(str) {
77
+ return str.replace(/\\/g, "/");
78
+ }
75
79
  // Annotate the CommonJS export names for ESM import in node:
76
80
  0 && (module.exports = {
81
+ formatImportPath,
77
82
  getRealTemporaryDirectory,
78
83
  getTemplatePath,
79
84
  isPathString,
@@ -48,7 +48,11 @@ var removeTailSlash = function(s) {
48
48
  var removeSlash = function(s) {
49
49
  return removeLeadingSlash(removeTailSlash(s));
50
50
  };
51
+ function formatImportPath(str) {
52
+ return str.replace(/\\/g, "/");
53
+ }
51
54
  export {
55
+ formatImportPath,
52
56
  getRealTemporaryDirectory,
53
57
  getTemplatePath,
54
58
  isPathString,
@@ -30,7 +30,11 @@ function splitPathString(str) {
30
30
  const removeLeadingSlash = (s) => s.replace(/^\/+/, "");
31
31
  const removeTailSlash = (s) => s.replace(/\/+$/, "");
32
32
  const removeSlash = (s) => removeLeadingSlash(removeTailSlash(s));
33
+ function formatImportPath(str) {
34
+ return str.replace(/\\/g, "/");
35
+ }
33
36
  export {
37
+ formatImportPath,
34
38
  getRealTemporaryDirectory,
35
39
  getTemplatePath,
36
40
  isPathString,
@@ -8,3 +8,4 @@ export declare function splitPathString(str: string): string[];
8
8
  export declare const removeLeadingSlash: (s: string) => string;
9
9
  export declare const removeTailSlash: (s: string) => string;
10
10
  export declare const removeSlash: (s: string) => string;
11
+ export declare function formatImportPath(str: string): string;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.54.6",
18
+ "version": "2.56.0",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -161,10 +161,10 @@
161
161
  "@types/node": "^14",
162
162
  "jest": "^29",
163
163
  "typescript": "^5",
164
- "webpack": "^5.92.0",
165
- "@modern-js/types": "2.54.6",
166
- "@scripts/jest-config": "2.54.6",
167
- "@scripts/build": "2.54.6"
164
+ "webpack": "^5.93.0",
165
+ "@modern-js/types": "2.56.0",
166
+ "@scripts/jest-config": "2.56.0",
167
+ "@scripts/build": "2.56.0"
168
168
  },
169
169
  "sideEffects": false,
170
170
  "scripts": {