New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

url-buddy

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

url-buddy - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

2

package.json
{
"name": "url-buddy",
"version": "0.1.0",
"version": "0.2.0",
"description": "Parse URL strings and extract multiple properties from them.",

@@ -5,0 +5,0 @@ "main": "lib",

@@ -22,3 +22,13 @@ # url-buddy

// That's all folks!
const parsedUrl = urlBuddy('https://github.com:32199/users/tj#foo?bar=baz#qux');
parsedUrl.hash // 'foo'
parsedUrl.host // 'github.com:32199'
parsedUrl.hostname // 'github.com'
parsedUrl.pathname // '/users/tj'
parsedUrl.port // '32199'
parsedUrl.protocol // 'https'
parsedUrl.query // { bar: 'baz', qux: true }
parsedUrl.url // 'https://github.com:32199/users/tj#foo?bar=baz#qux'
parsedUrl.valid // true
```

@@ -25,0 +35,0 @@

@@ -27,3 +27,3 @@ import { extractWithRegex } from './util';

.reduce((query, [key, value]) =>
Object.assign({}, query, { [key]: (value || true) }), {});
Object.assign({}, query, { [key]: value || true }), {});
};

@@ -24,5 +24,5 @@ import {

export const urlBuddy = (url) => {
export default (url) => {
if (!isValidUrl(url)) { return getBaseProperties({ url, valid: false }); }
return getExtractedProperties(url);
};
import _ from 'lodash';
import { describe } from 'ava-spec';
import { urlBuddy } from '../src';
import urlBuddy from '../src';

@@ -5,0 +5,0 @@ describe('urlBuddy\t\t=>', (it) => {

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