ts-japi
Version:
A highly-modular (typescript-friendly)-framework agnostic library for serializing data to the JSON:API specification
29 lines • 935 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const meta_model_1 = __importDefault(require("../models/meta.model"));
/**
* The {@link Metaizer} class is used to construct [meta information](https://jsonapi.org/format/#document-meta).
*
* Example:
* ```typescript
* [[include:metaizer.example.ts]]
* ```
*/
class Metaizer {
/** @internal Generates a {@link Meta}. */
metaize;
/**
* Creates a {@link Metaizer}.
*
* @param metaize - A function to generate [meta information](https://jsonapi.org/format/#document-meta)
* from its arguments.
*/
constructor(metaize) {
this.metaize = (...datas) => new meta_model_1.default(metaize(...datas));
}
}
exports.default = Metaizer;
//# sourceMappingURL=metaizer.js.map