@volar/shared
Advanced tools
Comparing version 1.3.0-alpha.0 to 1.3.0-alpha.1
@@ -1,7 +0,3 @@ | ||
import * as path from 'typesafe-path'; | ||
export declare function normalizeFileName(fsPath: string): path.PosixPath; | ||
export declare function uriToFileName(uri: string): path.PosixPath; | ||
export declare function fileNameToUri(path: string): string; | ||
export declare function syntaxToLanguageId(syntax: string): string; | ||
export declare function sleep(ms: number): Promise<unknown>; | ||
export declare function notEmpty<T>(value: T | null | undefined): value is T; |
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.notEmpty = exports.sleep = exports.syntaxToLanguageId = exports.fileNameToUri = exports.uriToFileName = exports.normalizeFileName = void 0; | ||
const vscode_uri_1 = require("vscode-uri"); | ||
function normalizeFileName(fsPath) { | ||
return uriToFileName(fileNameToUri(fsPath)); | ||
} | ||
exports.normalizeFileName = normalizeFileName; | ||
function uriToFileName(uri) { | ||
if (uri.startsWith('https://unpkg.com/')) { | ||
return '/__uri__/node_modules/' + uri.replace('https://unpkg.com/', ''); | ||
} | ||
const _uri = vscode_uri_1.URI.parse(uri); | ||
if (_uri.scheme === 'file') { | ||
return _uri.fsPath.replace(/\\/g, '/'); | ||
} | ||
else { | ||
return '/__uri__/' + uri.replace('://', '__uri_scheme__'); | ||
} | ||
} | ||
exports.uriToFileName = uriToFileName; | ||
function fileNameToUri(path) { | ||
if (path.startsWith('/__uri__/node_modules/')) { | ||
return path.replace('/__uri__/node_modules/', 'https://unpkg.com/'); | ||
} | ||
if (path.startsWith('/__uri__/')) { | ||
return path.replace('/__uri__/', '').replace('__uri_scheme__', '://'); | ||
} | ||
return vscode_uri_1.URI.file(path).toString(); | ||
} | ||
exports.fileNameToUri = fileNameToUri; | ||
exports.notEmpty = exports.sleep = exports.syntaxToLanguageId = void 0; | ||
function syntaxToLanguageId(syntax) { | ||
@@ -32,0 +4,0 @@ switch (syntax) { |
{ | ||
"name": "@volar/shared", | ||
"version": "1.3.0-alpha.0", | ||
"version": "1.3.0-alpha.1", | ||
"main": "out/index.js", | ||
@@ -19,3 +19,3 @@ "license": "MIT", | ||
}, | ||
"gitHead": "7582403cc521d33f642183a32da44fb1f64e65ef" | ||
"gitHead": "2926dc4af31890e01f6218773e88578ddf0de658" | ||
} |
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
2619
29