Comparing version 0.1.0 to 0.2.0
{ | ||
"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) => { |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
13634
38
1