Skip to content

Commit

Permalink
build(deps): fix ufo import
Browse files Browse the repository at this point in the history
fix #181
  • Loading branch information
flavienrako authored and Stun3R committed Aug 21, 2023
1 parent 8113f8d commit fec471f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
],
"scripts": {
"start": "rollup -c --watch",
"build": "rollup -c",
"build": "rm -rf dist && rollup -c",
"clean": "rm -rf bin dist coverage",
"lint": "eslint . --ext .ts,.js",
"lint:fix": "eslint . --ext .ts,.js --fix",
Expand Down
17 changes: 7 additions & 10 deletions src/lib/strapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import axios, {
import defu from "defu";
import qs from "qs";
import Cookies from "js-cookie";
import ufo from "ufo";
import * as ufo from "ufo";

const { cleanDoubleSlashes, joinURL } = ufo;

// Load custom types
import type {
Expand Down Expand Up @@ -66,13 +68,13 @@ export class Strapi {
// clean url & prefix
this.options = {
..._options,
url: ufo.cleanDoubleSlashes(_options?.url),
prefix: ufo.cleanDoubleSlashes(_options?.prefix),
url: cleanDoubleSlashes(_options?.url),
prefix: cleanDoubleSlashes(_options?.prefix),
};

// create axios instance
this.axios = axios.create({
baseURL: ufo.joinURL(this.options.url, this.options.prefix),
baseURL: joinURL(this.options.url, this.options.prefix),
paramsSerializer: qs.stringify,
...this.options.axiosOptions,
});
Expand Down Expand Up @@ -261,12 +263,7 @@ export class Strapi {
* @returns string
*/
public getProviderAuthenticationUrl(provider: StrapiAuthProvider): string {
return ufo.joinURL(
this.options.url,
this.options.prefix,
"connect",
provider
);
return joinURL(this.options.url, this.options.prefix, "connect", provider);
}

/**
Expand Down

0 comments on commit fec471f

Please sign in to comment.