rjweb-server
Version:
Easy and Robust Way to create a Web Server with Many Easy-to-use Features in NodeJS
28 lines (27 loc) • 816 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const parseURL_1 = __importDefault(require("../functions/parseURL"));
/**
* A Utility to wrap a parsed URL
* @example
* ```
* const url = new URLObject(...)
* ```
* @since 5.6.0
*/ class URLObject {
/**
* Create a new URL object for an easier Wrapper of `parseURL()`
* @since 5.6.0
*/ constructor(url, method) {
const parsed = (0, parseURL_1.default)(url);
this.href = parsed.href;
this.path = parsed.path;
this.query = parsed.query;
this.fragments = parsed.fragments;
this.method = method;
}
}
exports.default = URLObject;