Socket
Socket
Sign inDemoInstall

vscode-uri

Package Overview
Dependencies
Maintainers
3
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vscode-uri - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

.travis.yml

28

lib/index.js

@@ -173,2 +173,5 @@ /*---------------------------------------------------------------------------------------------

Uri.from = function (components) {
if (!components) {
throw new Error();
}
return new Uri().with(components);

@@ -283,9 +286,10 @@ };

: encodeNoop;
var parts = [];
var result = '';
var scheme = uri.scheme, authority = uri.authority, path = uri.path, query = uri.query, fragment = uri.fragment;
if (scheme) {
parts.push(scheme, ':');
result += scheme;
result += ':';
}
if (authority || scheme === 'file') {
parts.push('//');
result += '//';
}

@@ -296,6 +300,7 @@ if (authority) {

if (idx === -1) {
parts.push(encoder(authority));
result += encoder(authority);
}
else {
parts.push(encoder(authority.substr(0, idx)), authority.substr(idx));
result += encoder(authority.substr(0, idx));
result += authority.substr(idx);
}

@@ -317,6 +322,7 @@ }

if (idx === -1) {
parts.push(encoder(path.substring(lastIdx)).replace(/[#?]/, _encode));
result += encoder(path.substring(lastIdx)).replace(/[#?]/, _encode);
break;
}
parts.push(encoder(path.substring(lastIdx, idx)).replace(/[#?]/, _encode), Uri._slash);
result += encoder(path.substring(lastIdx, idx)).replace(/[#?]/, _encode);
result += Uri._slash;
lastIdx = idx + 1;

@@ -327,8 +333,10 @@ }

if (query) {
parts.push('?', encoder(query));
result += '?';
result += encoder(query);
}
if (fragment) {
parts.push('#', encoder(fragment));
result += '#';
result += encoder(fragment);
}
return parts.join(Uri._empty);
return result;
};

@@ -335,0 +343,0 @@ Uri.prototype.toJSON = function () {

{
"name": "vscode-uri",
"author": "Microsoft",
"version": "0.0.2",
"version": "0.0.3",
"description": "The URI implementation that is used by VS Code and its extensions",

@@ -6,0 +6,0 @@ "main": "lib/index.js",

## vscode-uri
[![Build Status](https://travis-ci.org/Microsoft/vscode-uri.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-uri)
This module contains the URI implementation that is used by VS Code and its extensions.

@@ -20,3 +22,3 @@ It has support for parsing a string into `scheme`, `authority`, `path`, `query`, and

```js
import Uri from ('vscode-uri')
import Uri from 'vscode-uri'

@@ -32,2 +34,3 @@ // parse an Uri from string

assert.ok(uri.fragment === 'frag');
assert.ok(uri.toString() === 'https://code.visualstudio.com/docs/extensions/overview#frag')

@@ -44,2 +47,3 @@

assert.ok(uri.fragment === '');
assert.ok(uri.toString() === 'file:///users/me/c%23-projects/')
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc