Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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"))
// {
Expand Down
6 changes: 3 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +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


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


/**
Expand Down Expand Up @@ -71,4 +71,4 @@ const parseUrl = (url, normalize = false) => {
return parsed;
}

module.exports = parseUrl;
export default parseUrl;
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "parse-url",
"version": "7.0.2",
"version": "7.0.3",
"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,7 +33,7 @@
},
"dependencies": {
"is-ssh": "^1.4.0",
"normalize-url": "^6.1.0",
"normalize-url": "^7.0.3",
"parse-path": "^5.0.0",
"protocols": "^2.0.1"
},
Expand Down
7 changes: 3 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Dependencies
const parseUrl = require("../lib")
, tester = require("tester")
, normalizeUrl = require("normalize-url")
;
import parseUrl from "../lib/index.js";
import tester from "tester";
import normalizeUrl from "normalize-url";

const INPUTS = [
[
Expand Down