@ctx-core/source-map 0.1.1 → 0.1.3
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctx-core/source-map",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Extensions to source-map...like sourcemap_writable_stream_",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"./package.json": "./package.json"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"ctx-core": "^5.19.
|
|
32
|
+
"ctx-core": "^5.19.1",
|
|
33
33
|
"source-map": "^0.7.4"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
@@ -18,7 +18,7 @@ export function sourcemap_writable_stream_(write_stream) {
|
|
|
18
18
|
const match =
|
|
19
19
|
stream_line.match(/^\s+at ([^(]+ )?\(?(.*):(.*):([^)]*)\)?/)
|
|
20
20
|
if (!match) {
|
|
21
|
-
write_stream.write(stream_line)
|
|
21
|
+
write_stream.write(stream_line + '\n')
|
|
22
22
|
return
|
|
23
23
|
}
|
|
24
24
|
const [
|
|
@@ -29,7 +29,7 @@ export function sourcemap_writable_stream_(write_stream) {
|
|
|
29
29
|
column_str
|
|
30
30
|
] = match
|
|
31
31
|
if (!path || !await file_exists_(path + '.map')) {
|
|
32
|
-
write_stream.write(stream_line)
|
|
32
|
+
write_stream.write(stream_line + '\n')
|
|
33
33
|
return
|
|
34
34
|
}
|
|
35
35
|
const methodName = methodName_match ? methodName_match.trim() : ''
|
|
@@ -41,7 +41,7 @@ export function sourcemap_writable_stream_(write_stream) {
|
|
|
41
41
|
JSON.parse(
|
|
42
42
|
await readFile(path + '.map').then(buf=>'' + buf)))
|
|
43
43
|
if (line == null || line < 1) {
|
|
44
|
-
write_stream.write(' ' + (methodName || '[unknown]'))
|
|
44
|
+
write_stream.write(' ' + (methodName || '[unknown]') + '\n')
|
|
45
45
|
} else {
|
|
46
46
|
const pos =
|
|
47
47
|
smc.originalPositionFor({ line, column })
|
|
@@ -49,12 +49,12 @@ export function sourcemap_writable_stream_(write_stream) {
|
|
|
49
49
|
write_stream.write(
|
|
50
50
|
' at '
|
|
51
51
|
+ (pos.name || methodName || '[unknown]')
|
|
52
|
-
+ ' (' + pos.source + ':' + pos.line + ':' + pos.column + ')')
|
|
52
|
+
+ ' (' + pos.source + ':' + pos.line + ':' + pos.column + ')\n')
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
} catch (err) {
|
|
56
56
|
console.error(err)
|
|
57
|
-
write_stream.write(' at FAILED_TO_PARSE_LINE')
|
|
57
|
+
write_stream.write(' at FAILED_TO_PARSE_LINE\n')
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}))
|
|
@@ -39,7 +39,7 @@ error: test error
|
|
|
39
39
|
.pipeThrough(new TextEncoderStream())
|
|
40
40
|
.pipeTo(sourcemap_writable_stream_(write_stream))
|
|
41
41
|
await sleep(100)
|
|
42
|
-
equal(write_stream_out_a.join('
|
|
42
|
+
equal(write_stream_out_a.join(''), `
|
|
43
43
|
server__build|watch
|
|
44
44
|
browser__build|watch
|
|
45
45
|
server started on port 3000
|
|
@@ -54,6 +54,6 @@ http://localhost:3000/
|
|
|
54
54
|
error: test error
|
|
55
55
|
at [unknown] (../../src/app/index.server.ts:8:9)
|
|
56
56
|
at processTicksAndRejections (:61:77)
|
|
57
|
-
`.trim())
|
|
57
|
+
`.trim() + '\n')
|
|
58
58
|
})
|
|
59
59
|
test.run()
|