react-antd-admin-panel
Version:
Easy prototyping admin panel using React and Antd
31 lines • 1.17 kB
JavaScript
export default class Path {
constructor(object) {
var _a, _b, _c, _d;
this._search = undefined;
this._query = undefined;
this._route = undefined;
if (object.search) {
const params = new URLSearchParams(object.search);
let paramObj = {};
params.forEach((value, key) => {
paramObj[key] = value;
});
this._query = paramObj;
this._search = object.search;
}
this._route = (_a = object.route) !== null && _a !== void 0 ? _a : undefined;
this._params = (_b = object.params) !== null && _b !== void 0 ? _b : undefined;
this._actualPath = (_c = object.actualPath) !== null && _c !== void 0 ? _c : undefined;
this._matchedPath = (_d = object.matchedPath) !== null && _d !== void 0 ? _d : undefined;
}
copy() {
return new Path({
route: this._route,
search: this._search,
params: this._params,
actualPath: this._actualPath,
matchedPath: this._matchedPath,
});
}
}
//# sourceMappingURL=Path.js.map