Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tiny-parse

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny-parse - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

24

lib/parse.js
"use strict";
const coerce = require("tiny-coerce"),
url = require("url");
url = require("url"),
space = /\s+/;

@@ -67,4 +68,21 @@ function trim (obj) {

function parse (uri) {
let luri = uri,
function uri (req) {
let header = req.headers.authorization || "",
auth = "",
token;
if (!isEmpty(header)) {
token = header.split(space).pop() || "";
auth = new Buffer(token, "base64").toString();
if (!isEmpty(auth)) {
auth += "@";
}
}
return "http://" + auth + req.headers.host + req.url;
}
function parse (arg) {
let luri = arg.url ? uri(arg) : arg,
idxAscii, idxQ, parsed;

@@ -71,0 +89,0 @@

2

package.json
{
"name": "tiny-parse",
"version": "1.0.1",
"version": "1.0.2",
"description": "URL parsing with coercion of `query`",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -17,4 +17,8 @@ # tiny-parse

### API
*parse()*
Parses the input, accepts a URL or `http.ClientRequest`
## License
Copyright (c) 2016 Jason Mulligan
Licensed under the BSD-3 license.
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