Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion example/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Dependencies
const parseUrl = require("../lib")
import parseUrl from "../lib/index.js";

console.log(parseUrl("http://ionicabizau.net/blog"))
// { protocols: [ 'http' ],
Expand Down
7 changes: 4 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"use strict"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESM files are strict by default


const parsePath = require("parse-path")
, normalizeUrl = require("normalize-url")
import parsePath from "parse-path";

import normalizeUrl from "normalize-url";

/**
* parseUrl
Expand Down Expand Up @@ -48,4 +49,4 @@ function parseUrl(url, normalize = false) {
return parsed;
}

module.exports = parseUrl;
export default parseUrl;
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "parse-url",
"version": "6.0.0",
"version": "7.0.0",
"description": "An advanced url parser supporting git urls too.",
"main": "lib/index.js",
"type": "module",
"directories": {
"example": "example",
"test": "test"
Expand Down Expand Up @@ -32,6 +33,7 @@
},
"dependencies": {
"is-ssh": "^1.3.0",
"normalize-url": "^7.0.3",
"normalize-url": "^6.1.0",
"parse-path": "^4.0.0",
"protocols": "^1.4.0"
Expand Down
9 changes: 4 additions & 5 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// Dependencies
const parseUrl = require("../lib")
, tester = require("tester")
, normalizeUrl = require("normalize-url")
, qs = require("querystring")
;
import parseUrl from "../lib";
import tester from "tester";
import normalizeUrl from "normalize-url";
import qs from "querystring";

const INPUTS = [
[
Expand Down