@emeryld/rrroutes-contract 2.7.10 → 2.7.11

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@emeryld/rrroutes-contract",
3
3
  "description": "TypeScript contract definitions for RRRoutes",
4
- "version": "2.7.10",
4
+ "version": "2.7.11",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "main": "dist/index.cjs",
@@ -773,8 +773,20 @@
773
773
  function sourceHref(source) {
774
774
  if (!source || !source.file) return undefined
775
775
  const normalizedPath = String(source.file).replace(/\\/g, '/')
776
- const prefix = normalizedPath.startsWith('/') ? 'file://' : 'file:///'
777
- return `${prefix}${encodeURI(normalizedPath)}`
776
+ const platform =
777
+ (navigator.userAgentData && navigator.userAgentData.platform) ||
778
+ navigator.platform ||
779
+ ''
780
+ const isWindows = /win/i.test(platform)
781
+ const vscodePath = isWindows
782
+ ? normalizedPath.replace(/^\/+/, '')
783
+ : normalizedPath.startsWith('/')
784
+ ? normalizedPath
785
+ : `/${normalizedPath}`
786
+ const line = Number.isFinite(source.line) ? source.line : 1
787
+ const column = Number.isFinite(source.column) ? source.column : 1
788
+
789
+ return `vscode://file/${encodeURI(vscodePath)}:${line}:${column}`
778
790
  }
779
791
 
780
792
  function sourceDisplay(source) {