Skip to content

Commit

Permalink
chore: update project to use ESM imports
Browse files Browse the repository at this point in the history
  • Loading branch information
edenhermelin committed Apr 14, 2022
1 parent 409b02c commit a10861c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
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"

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;
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

0 comments on commit a10861c

Please sign in to comment.