@jsenv/urls 1.2.4 → 1.2.7
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/package.json +4 -5
- package/src/{urls.js → main.js} +0 -1
- package/src/url_trace.js +1 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/urls",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
"directory": "packages/urls"
|
|
9
9
|
},
|
|
10
10
|
"publishConfig": {
|
|
11
|
-
"access": "public"
|
|
12
|
-
"registry": "https://registry.npmjs.org"
|
|
11
|
+
"access": "public"
|
|
13
12
|
},
|
|
14
13
|
"author": {
|
|
15
14
|
"name": "dmail",
|
|
@@ -19,7 +18,7 @@
|
|
|
19
18
|
"type": "module",
|
|
20
19
|
"exports": {
|
|
21
20
|
".": {
|
|
22
|
-
"import": "./src/
|
|
21
|
+
"import": "./src/main.js"
|
|
23
22
|
},
|
|
24
23
|
"./*": "./*"
|
|
25
24
|
},
|
|
@@ -30,4 +29,4 @@
|
|
|
30
29
|
"test": "node --conditions=development ./scripts/test.mjs"
|
|
31
30
|
},
|
|
32
31
|
"dependencies": {}
|
|
33
|
-
}
|
|
32
|
+
}
|
package/src/{urls.js → main.js}
RENAMED
package/src/url_trace.js
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
// https://github.com/postcss/postcss/blob/fd30d3df5abc0954a0ec642a3cdc644ab2aacf9c/lib/terminal-highlight.js#L50
|
|
4
4
|
// https://github.com/babel/babel/blob/eea156b2cb8deecfcf82d52aa1b71ba4995c7d68/packages/babel-code-frame/src/index.js#L1
|
|
5
5
|
|
|
6
|
-
import { urlToFileSystemPath } from "./url_to_filesystem_path.js"
|
|
7
|
-
|
|
8
6
|
export const stringifyUrlTrace = (trace) => {
|
|
9
7
|
let string = ""
|
|
10
8
|
trace.forEach(({ type, url, line, column, source }, index) => {
|
|
@@ -41,7 +39,7 @@ export const stringifyUrlSite = (
|
|
|
41
39
|
color,
|
|
42
40
|
} = {},
|
|
43
41
|
) => {
|
|
44
|
-
let string =
|
|
42
|
+
let string = url
|
|
45
43
|
|
|
46
44
|
if (typeof line === "number") {
|
|
47
45
|
string += `:${line}`
|
|
@@ -67,15 +65,6 @@ export const stringifyUrlSite = (
|
|
|
67
65
|
${sourceLoc}`
|
|
68
66
|
}
|
|
69
67
|
|
|
70
|
-
export const humanizeUrl = (url) => {
|
|
71
|
-
if (url.startsWith("file://")) {
|
|
72
|
-
// we prefer file system path because vscode reliably make them clickable
|
|
73
|
-
// and sometimes it won't for file:// urls
|
|
74
|
-
return urlToFileSystemPath(url)
|
|
75
|
-
}
|
|
76
|
-
return url
|
|
77
|
-
}
|
|
78
|
-
|
|
79
68
|
export const showSourceLocation = ({
|
|
80
69
|
content,
|
|
81
70
|
line,
|