Skip to content

Commit e6e0d2b

Browse files
committed
utils: Fixed parseUrl and serializeObject methods
1 parent 1ed9cc2 commit e6e0d2b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/utils/src/misc.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ export function parseUrl(
159159
protocol?: string;
160160
relative?: string;
161161
} {
162+
if (!url) {
163+
return {};
164+
}
165+
162166
const match = url.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);
163167

164168
if (!match) {

packages/utils/src/object.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,6 @@ function serializeValue<T>(value: T): T | string {
202202

203203
/** JSDoc */
204204
function serializeObject<T>(value: T, depth: number): T | string | {} {
205-
return value;
206-
207205
if (depth === 0) {
208206
return serializeValue(value);
209207
}

0 commit comments

Comments
 (0)