import { Pagination } from '../classes/pagination'; import { ATTRIBUTE_PROPERTIES_METADATA_KEY } from '../constants/metadata.constant'; import { ModelProperty as ModelPropertyEnum } from '../enums/model-property.enum'; import { getObjProperty } from '../helpers/metadata/metadata.helper'; import { updatePropertyMetadata } from '../helpers/update-property-metadata/update-property-metadata.helper'; import { AttributeOptions, DEFAULT_ATTRIBUTE_OPTIONS, } from '../interfaces/attribute-options.interface'; import { AttributeModelProperty } from '../interfaces/model-property.interface'; import { HalModel } from '../models/hal.model'; import { deepmergeWrapper } from '../utils/deepmerge-wrapper'; export function Attribute
(options: AttributeOptions
= {}) { return (model: HalModel
, propertyName: string) => { const attributeOptions: AttributeOptions
= deepmergeWrapper(
DEFAULT_ATTRIBUTE_OPTIONS,
options,
);
const existingAttributeProperties: Array