ts-japi
Version:
A highly-modular (typescript-friendly)-framework agnostic library for serializing data to the JSON:API specification
16 lines • 416 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class Link {
url;
meta;
constructor(href, meta) {
this.url = new URL(href);
this.meta = meta;
}
toJSON = this.toString.bind(this);
toString() {
return this.meta ? { href: this.url.href, meta: this.meta } : this.url.href;
}
}
exports.default = Link;
//# sourceMappingURL=link.model.js.map