@yuw-cli-dev/format-path 1.0.37
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/README.md +11 -0
- package/lib/index.js +16 -0
- package/package.json +30 -0
package/README.md
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const path = require("path");
|
|
4
|
+
|
|
5
|
+
function formatPath(path) {
|
|
6
|
+
if (path && typeof path !== "string") {
|
|
7
|
+
const sep = path.sep;
|
|
8
|
+
if (sep !== "/") {
|
|
9
|
+
return path;
|
|
10
|
+
} else {
|
|
11
|
+
return path.replace(/\\/g, "/");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return path;
|
|
15
|
+
}
|
|
16
|
+
module.exports = formatPath;
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yuw-cli-dev/format-path",
|
|
3
|
+
"version": "1.0.37",
|
|
4
|
+
"description": "format path",
|
|
5
|
+
"author": "yuwei <yuwei@huya.com>",
|
|
6
|
+
"homepage": "https://github.com/yousanjin/yuw-cli#readme",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"main": "lib/index.js",
|
|
9
|
+
"directories": {
|
|
10
|
+
"lib": "lib",
|
|
11
|
+
"test": "__tests__"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"lib"
|
|
15
|
+
],
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "git+https://github.com/yousanjin/yuw-cli.git"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
25
|
+
},
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/yousanjin/yuw-cli/issues"
|
|
28
|
+
},
|
|
29
|
+
"gitHead": "ab03556d97ed9d4caf7af33d1720f4e45e34749a"
|
|
30
|
+
}
|