UNPKG

rjweb-server

Version:

Easy and Robust Way to create a Web Server with Many Easy-to-use Features in NodeJS

22 lines (21 loc) 547 B
import parseURL from "../functions/parseURL"; /** * A Utility to wrap a parsed URL * @example * ``` * const url = new URLObject(...) * ``` * @since 5.6.0 */ export default class URLObject { /** * Create a new URL object for an easier Wrapper of `parseURL()` * @since 5.6.0 */ constructor(url, method) { const parsed = parseURL(url); this.href = parsed.href; this.path = parsed.path; this.query = parsed.query; this.fragments = parsed.fragments; this.method = method; } }