Comparing version 0.0.6 to 0.0.7
@@ -5,2 +5,4 @@ # Changelog | ||
### [0.0.7](https://github.com/nuxt-contrib/ohmyfetch/compare/v0.0.6...v0.0.7) (2020-12-12) | ||
### [0.0.6](https://github.com/nuxt-contrib/ohmyfetch/compare/v0.0.5...v0.0.6) (2020-12-12) | ||
@@ -7,0 +9,0 @@ |
@@ -102,7 +102,17 @@ 'use strict'; | ||
const parsed = parseURL(input); | ||
for (const name in params) { | ||
parsed.url.searchParams.set(name, params[name]); | ||
} | ||
const mergedParams = {...getParams(input), ...params}; | ||
parsed.url.search = Object.keys(mergedParams).map((n) => { | ||
const val = mergedParams[n]; | ||
return val ? `${n}=${decodeURIComponent(mergedParams[n])}` : n; | ||
}).join("&"); | ||
return normalizeURL(parsed); | ||
} | ||
function getParams(input) { | ||
const parsed = parseURL(input); | ||
const params = {}; | ||
parsed.url.searchParams.forEach((value, key) => { | ||
params[key] = value; | ||
}); | ||
return params; | ||
} | ||
function joinURL(input0, ...input) { | ||
@@ -109,0 +119,0 @@ const path = input.map(parseURL); |
16
index.js
@@ -102,7 +102,17 @@ 'use strict'; | ||
const parsed = parseURL(input); | ||
for (const name in params) { | ||
parsed.url.searchParams.set(name, params[name]); | ||
} | ||
const mergedParams = {...getParams(input), ...params}; | ||
parsed.url.search = Object.keys(mergedParams).map((n) => { | ||
const val = mergedParams[n]; | ||
return val ? `${n}=${decodeURIComponent(mergedParams[n])}` : n; | ||
}).join("&"); | ||
return normalizeURL(parsed); | ||
} | ||
function getParams(input) { | ||
const parsed = parseURL(input); | ||
const params = {}; | ||
parsed.url.searchParams.forEach((value, key) => { | ||
params[key] = value; | ||
}); | ||
return params; | ||
} | ||
function joinURL(input0, ...input) { | ||
@@ -109,0 +119,0 @@ const path = input.map(parseURL); |
16
node.js
@@ -108,7 +108,17 @@ 'use strict'; | ||
const parsed = parseURL(input); | ||
for (const name in params) { | ||
parsed.url.searchParams.set(name, params[name]); | ||
} | ||
const mergedParams = {...getParams(input), ...params}; | ||
parsed.url.search = Object.keys(mergedParams).map((n) => { | ||
const val = mergedParams[n]; | ||
return val ? `${n}=${decodeURIComponent(mergedParams[n])}` : n; | ||
}).join("&"); | ||
return normalizeURL(parsed); | ||
} | ||
function getParams(input) { | ||
const parsed = parseURL(input); | ||
const params = {}; | ||
parsed.url.searchParams.forEach((value, key) => { | ||
params[key] = value; | ||
}); | ||
return params; | ||
} | ||
function joinURL(input0, ...input) { | ||
@@ -115,0 +125,0 @@ const path = input.map(parseURL); |
{ | ||
"name": "ohmyfetch", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "oh-my-fetch", | ||
@@ -38,3 +38,3 @@ "repository": "nuxt-contrib/ohmyfetch", | ||
"@nuxt/h2": "^0.0.14", | ||
"@nuxt/ufo": "^0.1.2", | ||
"@nuxt/ufo": "^0.1.3", | ||
"@nuxtjs/eslint-config-typescript": "latest", | ||
@@ -41,0 +41,0 @@ "@types/flat": "latest", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40258
1056