@volar/shared
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -1,7 +0,5 @@ | ||
import { URI } from 'vscode-uri'; | ||
import * as path from 'typesafe-path'; | ||
export declare function getPathOfUri(uri: string): path.PosixPath; | ||
export declare function normalizeFileName(fsPath: string): path.PosixPath; | ||
export declare function normalizeUri(uri: string): string; | ||
export declare function getUriByPath(rootUri: URI, path: string): string; | ||
export declare function getUriByPath(path: string): string; | ||
export declare function isFileInDir(fileName: path.OsPath, dir: path.OsPath): boolean; |
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.isFileInDir = exports.getUriByPath = exports.normalizeUri = exports.normalizeFileName = exports.getPathOfUri = void 0; | ||
exports.isFileInDir = exports.getUriByPath = exports.normalizeFileName = exports.getPathOfUri = void 0; | ||
const vscode_uri_1 = require("vscode-uri"); | ||
const path = require("typesafe-path"); | ||
function getPathOfUri(uri) { | ||
return vscode_uri_1.URI.parse(uri).fsPath.replace(/\\/g, '/'); | ||
const _uri = vscode_uri_1.URI.parse(uri); | ||
if (_uri.scheme === 'file') { | ||
return _uri.fsPath.replace(/\\/g, '/'); | ||
} | ||
else { | ||
return '/__uri__/' + uri.replace('://', '__uriScheme__/'); | ||
} | ||
} | ||
@@ -13,12 +19,8 @@ exports.getPathOfUri = getPathOfUri; | ||
exports.normalizeFileName = normalizeFileName; | ||
function normalizeUri(uri) { | ||
return vscode_uri_1.URI.parse(uri).toString(); | ||
function getUriByPath(path) { | ||
if (path.startsWith('/__uri__/')) { | ||
return path.replace('/__uri__/', '').replace('__uriScheme__/', '://'); | ||
} | ||
return vscode_uri_1.URI.file(path).toString(); | ||
} | ||
exports.normalizeUri = normalizeUri; | ||
function getUriByPath(rootUri, path) { | ||
return vscode_uri_1.URI.file(path).with({ | ||
scheme: rootUri.scheme, | ||
authority: rootUri.authority, | ||
}).toString(); | ||
} | ||
exports.getUriByPath = getUriByPath; | ||
@@ -25,0 +27,0 @@ function isFileInDir(fileName, dir) { |
{ | ||
"name": "@volar/shared", | ||
"version": "1.0.11", | ||
"version": "1.0.12", | ||
"main": "out/index.js", | ||
@@ -19,3 +19,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "aff3d7c0896a391412a605597adca7d796e9accf" | ||
"gitHead": "2426aa8ec6731a6f6d88086da7021a32d9306de3" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5631